From d4caac40d4ed252afcad964db4c36017f7850bb0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Nov 2013 09:39:43 +0400 Subject: [PATCH] disable trial stuff on amazon devices --- src/org/fox/ttrss/CommonActivity.java | 4 ++++ src/org/fox/ttrss/FeedsActivity.java | 6 ++++-- src/org/fox/ttrss/OnlineActivity.java | 25 ++++++++++++++++--------- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/org/fox/ttrss/CommonActivity.java b/src/org/fox/ttrss/CommonActivity.java index ad15b0cc..a844df39 100644 --- a/src/org/fox/ttrss/CommonActivity.java +++ b/src/org/fox/ttrss/CommonActivity.java @@ -43,6 +43,10 @@ public class CommonActivity extends SherlockFragmentActivity { public boolean getUnreadOnly() { return m_prefs.getBoolean("show_unread_only", true); } + + public static boolean isAmazonDevice() { + return android.os.Build.MANUFACTURER.equals("Amazon"); + } public void setUnreadOnly(boolean unread) { SharedPreferences.Editor editor = m_prefs.edit(); diff --git a/src/org/fox/ttrss/FeedsActivity.java b/src/org/fox/ttrss/FeedsActivity.java index 242ca1cf..95adda7f 100644 --- a/src/org/fox/ttrss/FeedsActivity.java +++ b/src/org/fox/ttrss/FeedsActivity.java @@ -127,8 +127,10 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe ft.commit(); - AppRater.appLaunched(this); - checkTrial(true); + if (!isAmazonDevice()) { + AppRater.appLaunched(this); + checkTrial(true); + } } else { // savedInstanceState != null m_actionbarUpEnabled = savedInstanceState.getBoolean("actionbarUpEnabled"); diff --git a/src/org/fox/ttrss/OnlineActivity.java b/src/org/fox/ttrss/OnlineActivity.java index 241f54da..5704302d 100644 --- a/src/org/fox/ttrss/OnlineActivity.java +++ b/src/org/fox/ttrss/OnlineActivity.java @@ -173,7 +173,10 @@ public class OnlineActivity extends CommonActivity { if (isOffline) { switchOfflineSuccess(); } else { - checkTrial(false); + + if (!isAmazonDevice()) { + checkTrial(false); + } /* if (getIntent().getExtras() != null) { Intent i = getIntent(); @@ -1226,15 +1229,19 @@ public class OnlineActivity extends CommonActivity { initMenu(); - List pkgs = getPackageManager() - .getInstalledPackages(0); - - for (PackageInfo p : pkgs) { - if ("org.fox.ttrss.key".equals(p.packageName)) { - Log.d(TAG, "license apk found"); - menu.findItem(R.id.donate).setVisible(false); - break; + if (!isAmazonDevice()) { + List pkgs = getPackageManager() + .getInstalledPackages(0); + + for (PackageInfo p : pkgs) { + if ("org.fox.ttrss.key".equals(p.packageName)) { + Log.d(TAG, "license apk found"); + menu.findItem(R.id.donate).setVisible(false); + break; + } } + } else { + menu.findItem(R.id.donate).setVisible(false); } return true;