Bug 1279045 - Remove broadcastHealthReport* and its call sites. r=ahunt
MozReview-Commit-ID: G5Pz9l5GAi3
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -1597,21 +1597,16 @@ public abstract class GeckoApp
ThreadUtils.getBackgroundHandler().postDelayed(new Runnable() {
@Override
public void run() {
final HealthRecorder rec = mHealthRecorder;
if (rec != null) {
rec.recordJavaStartupTime(javaDuration);
}
-
- // Kick off our background services. We do this by invoking the broadcast
- // receiver, which uses the system alarm infrastructure to perform tasks at
- // intervals.
- GeckoPreferences.broadcastHealthReportUploadPref(GeckoApp.this);
}
}, 50);
final int updateServiceDelay = 30 * 1000;
ThreadUtils.getBackgroundHandler().postDelayed(new Runnable() {
@Override
public void run() {
UpdateServiceHelper.registerForUpdates(GeckoApp.this);
@@ -2137,21 +2132,16 @@ public abstract class GeckoApp
if (prefs.getBoolean(GeckoApp.PREFS_CLEANUP_TEMP_FILES, true)) {
File tempDir = GeckoLoader.getGREDir(GeckoApp.this);
FileUtils.delTree(tempDir, new FileUtils.NameAndAgeFilter(null, ONE_DAY_MS), false);
editor.putBoolean(GeckoApp.PREFS_CLEANUP_TEMP_FILES, false);
}
editor.apply();
-
- // In theory, the first browser session will not run long enough that we need to
- // prune during it and we'd rather run it when the browser is inactive so we wait
- // until here to register the prune service.
- GeckoPreferences.broadcastHealthReportPrune(context);
}
});
if (mAppStateListeners != null) {
for (GeckoAppShell.AppStateListener listener : mAppStateListeners) {
listener.onPause();
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
@@ -969,41 +969,16 @@ OnSharedPreferenceChangeListener
if (profile != null) {
intent.putExtra("profileName", profile.getName())
.putExtra("profilePath", profile.getDir().getAbsolutePath());
}
}
/**
* Broadcast the provided value as the value of the
- * <code>PREFS_HEALTHREPORT_UPLOAD_ENABLED</code> pref.
- */
- public static void broadcastHealthReportUploadPref(final Context context, final boolean value) {
- //broadcastPrefAction(context,
- // HealthReportConstants.ACTION_HEALTHREPORT_UPLOAD_PREF,
- // PREFS_HEALTHREPORT_UPLOAD_ENABLED,
- // value);
- }
-
- /**
- * Broadcast the current value of the
- * <code>PREFS_HEALTHREPORT_UPLOAD_ENABLED</code> pref.
- */
- public static void broadcastHealthReportUploadPref(final Context context) {
- //final boolean value = getBooleanPref(context, PREFS_HEALTHREPORT_UPLOAD_ENABLED, true);
- //broadcastHealthReportUploadPref(context, value);
- }
-
- public static void broadcastHealthReportPrune(final Context context) {
- //final Intent intent = new Intent(HealthReportConstants.ACTION_HEALTHREPORT_PRUNE);
- //broadcastAction(context, intent);
- }
-
- /**
- * Broadcast the provided value as the value of the
* <code>PREFS_GEO_REPORTING</code> pref.
*/
public static void broadcastStumblerPref(final Context context, final boolean value) {
Intent intent = new Intent(ACTION_STUMBLER_UPLOAD_PREF)
.putExtra("pref", PREFS_GEO_REPORTING)
.putExtra("branch", GeckoSharedPrefs.APP_PREFS_NAME)
.putExtra("enabled", value)
.putExtra("moz_mozilla_api_key", AppConstants.MOZ_MOZILLA_API_KEY);
@@ -1188,22 +1163,17 @@ OnSharedPreferenceChangeListener
if (PREFS_MENU_CHAR_ENCODING.equals(prefName)) {
setCharEncodingState(((String) newValue).equals("true"));
} else if (PREFS_UPDATER_AUTODOWNLOAD.equals(prefName)) {
UpdateServiceHelper.setAutoDownloadPolicy(this, UpdateService.AutoDownloadPolicy.get((String) newValue));
} else if (PREFS_UPDATER_URL.equals(prefName)) {
UpdateServiceHelper.setUpdateUrl(this, (String) newValue);
} else if (PREFS_HEALTHREPORT_UPLOAD_ENABLED.equals(prefName)) {
- // The healthreport pref only lives in Android, so we do not persist
- // to Gecko, but we do broadcast intent to the health report
- // background uploader service, which will start or stop the
- // repeated background upload attempts.
final Boolean newBooleanValue = (Boolean) newValue;
- broadcastHealthReportUploadPref(this, newBooleanValue);
AdjustConstants.getAdjustHelper().setEnabled(newBooleanValue);
} else if (PREFS_GEO_REPORTING.equals(prefName)) {
if ((Boolean) newValue) {
enableStumbler((CheckBoxPreference) preference);
return false;
} else {
broadcastStumblerPref(GeckoPreferences.this, false);
return true;