Bug 785960 - "Don't keep activities" developer option gets counted as OOM in telemetry. r=kats
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Tue, 09 Oct 2012 17:59:42 +0200
changeset 109756 c0b4572696b64295fdfc72c9d61e9e76290bddd6
parent 109755 ec34a79837f61c5f501a3883d503cb5dbd908c54
child 109757 c80a02b9d4780bed291bc030651c06c096f16c6a
push id23652
push userryanvm@gmail.com
push dateWed, 10 Oct 2012 01:10:20 +0000
treeherdermozilla-central@5cca0408a73f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs785960
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 785960 - "Don't keep activities" developer option gets counted as OOM in telemetry. r=kats
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1506,17 +1506,19 @@ abstract public class GeckoApp
         if (savedInstanceState != null) {
             Log.i(LOGTAG, "Restoring from OOM");
             mRestoreMode = GeckoAppShell.RESTORE_OOM;
 
             boolean wasInBackground =
                 savedInstanceState.getBoolean(SAVED_STATE_IN_BACKGROUND, false);
             Log.i(LOGTAG, "Was in background: " + wasInBackground);
 
-            if (!wasInBackground) {
+            // Don't log OOM-kills if only one activity was destroyed. (For example
+            // from "Don't keep activities" on ICS)
+            if (!wasInBackground && !mIsRestoringActivity) {
                 Telemetry.HistogramAdd("OUT_OF_MEMORY_KILLED", 1);
             }
         }
 
         GeckoBackgroundThread.getHandler().post(new Runnable() {
             public void run() {
                 SharedPreferences prefs =
                     GeckoApp.mAppContext.getSharedPreferences(PREFS_NAME, 0);