Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: mobile/android/base/BrowserApp.java

Issue 29325561: Issue 2967 - Show about:feedback automatically (Closed)
Patch Set: Created Sept. 2, 2015, 2:55 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mobile/android/base/BrowserApp.java
diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java
index 690b3004f1d5f539347df8ad5b4a883326291e98..a1d61dd633d743f17e5643158c0099c03c42e5c3 100644
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -232,9 +232,10 @@ public class BrowserApp extends GeckoApp
private FindInPageBar mFindInPageBar;
private MediaCastingBar mMediaCastingBar;
- // Don't show about:feedback automatically in Adblock Browser, see
- // https://issues.adblockplus.org/ticket/2521
- private static final int FEEDBACK_LAUNCH_COUNT = 0;
+ // We again show about:feedback automatically in Adblock Browser, after
+ // 5 application starts, but only for installations from the PlayStore,
+ // see https://issues.adblockplus.org/ticket/2967
+ private static final int FEEDBACK_LAUNCH_COUNT = 5;
// Stored value of the toolbar height, so we know when it's changed.
private int mToolbarHeight;
@@ -3542,7 +3543,7 @@ public class BrowserApp extends GeckoApp
settings.edit().putInt(keyName, launchCount).apply();
// If we've reached our magic number, show the feedback page.
- if (launchCount == FEEDBACK_LAUNCH_COUNT) {
+ if (launchCount == FEEDBACK_LAUNCH_COUNT && wasInstalledFromPlayStore()) {
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Feedback:Show", null));
}
}
@@ -3551,6 +3552,11 @@ public class BrowserApp extends GeckoApp
}
}
+ private boolean wasInstalledFromPlayStore() {
+ final String installer = this.getPackageManager().getInstallerPackageName(this.getPackageName());
+ return "com.android.vending".equals(installer);
+ }
+
private void showTabQueuePromptIfApplicable(final Intent intent) {
ThreadUtils.postToBackgroundThread(new Runnable() {
@Override
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld