Loading services/core/java/com/android/server/Watchdog.java +13 −11 Original line number Diff line number Diff line Loading @@ -17,34 +17,33 @@ package com.android.server; import android.app.IActivityController; import android.os.Binder; import android.os.Build; import android.os.RemoteException; import android.system.ErrnoException; import android.system.Os; import android.system.OsConstants; import android.system.StructRlimit; import com.android.internal.os.ZygoteConnectionConstants; import com.android.server.am.ActivityManagerService; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.hidl.manager.V1_0.IServiceManager; import android.os.Binder; import android.os.Build; import android.os.Debug; import android.os.Handler; import android.os.IPowerManager; import android.os.Looper; import android.os.Process; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemClock; import android.os.SystemProperties; import android.system.ErrnoException; import android.system.Os; import android.system.OsConstants; import android.system.StructRlimit; import android.util.EventLog; import android.util.Log; import android.util.Slog; import com.android.internal.os.ZygoteConnectionConstants; import com.android.server.am.ActivityManagerService; import java.io.File; import java.io.FileWriter; import java.io.IOException; Loading @@ -62,6 +61,8 @@ import java.util.List; public class Watchdog extends Thread { static final String TAG = "Watchdog"; private static final boolean DEBUG = true; // STOPSHIP disable it (b/113252928) // Set this to true to use debug default values. static final boolean DB = false; Loading Loading @@ -478,6 +479,7 @@ public class Watchdog extends Thread { continue; } else if (waitState == WAITED_HALF) { if (!waitedHalf) { if (DEBUG) Slog.d(TAG, "WAITED_HALF"); // We've waited half the deadlock-detection interval. Pull a stack // trace and wait another half. ArrayList<Integer> pids = new ArrayList<Integer>(); Loading services/core/java/com/android/server/am/ActivityManagerDebugConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ class ActivityManagerDebugConfig { // Available log categories in the activity manager package. static final boolean DEBUG_ADD_REMOVE = DEBUG_ALL_ACTIVITIES || false; static final boolean DEBUG_ANR = false; static final boolean DEBUG_ANR = true; // STOPSHIP disable it (b/113252928) static final boolean DEBUG_APP = DEBUG_ALL_ACTIVITIES || false; static final boolean DEBUG_BACKGROUND_CHECK = DEBUG_ALL || false; static final boolean DEBUG_BACKUP = DEBUG_ALL || false; Loading services/core/java/com/android/server/am/ActivityManagerService.java +19 −0 Original line number Diff line number Diff line Loading @@ -1618,6 +1618,9 @@ public class ActivityManagerService extends IActivityManager.Stub break; } case DISPATCH_UIDS_CHANGED_UI_MSG: { if (false) { // DO NOT SUBMIT WITH TRUE maybeTriggerWatchdog(); } dispatchUidsChanged(); } break; case DISPATCH_OOM_ADJ_OBSERVER_MSG: { Loading Loading @@ -21551,4 +21554,20 @@ public class ActivityManagerService extends IActivityManager.Stub return superImpl.apply(permName, uid); } } /** * If debug.trigger.watchdog is set to 1, sleep 10 minutes with the AM lock held, which would * cause a watchdog kill. */ void maybeTriggerWatchdog() { if (SystemProperties.getInt("debug.trigger.watchdog", 0) == 1) { Slog.w(TAG, "TRIGGERING WATCHDOG"); synchronized (ActivityManagerService.this) { try { Thread.sleep(600 * 1000); } catch (InterruptedException e) { } } } } } Loading
services/core/java/com/android/server/Watchdog.java +13 −11 Original line number Diff line number Diff line Loading @@ -17,34 +17,33 @@ package com.android.server; import android.app.IActivityController; import android.os.Binder; import android.os.Build; import android.os.RemoteException; import android.system.ErrnoException; import android.system.Os; import android.system.OsConstants; import android.system.StructRlimit; import com.android.internal.os.ZygoteConnectionConstants; import com.android.server.am.ActivityManagerService; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.hidl.manager.V1_0.IServiceManager; import android.os.Binder; import android.os.Build; import android.os.Debug; import android.os.Handler; import android.os.IPowerManager; import android.os.Looper; import android.os.Process; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemClock; import android.os.SystemProperties; import android.system.ErrnoException; import android.system.Os; import android.system.OsConstants; import android.system.StructRlimit; import android.util.EventLog; import android.util.Log; import android.util.Slog; import com.android.internal.os.ZygoteConnectionConstants; import com.android.server.am.ActivityManagerService; import java.io.File; import java.io.FileWriter; import java.io.IOException; Loading @@ -62,6 +61,8 @@ import java.util.List; public class Watchdog extends Thread { static final String TAG = "Watchdog"; private static final boolean DEBUG = true; // STOPSHIP disable it (b/113252928) // Set this to true to use debug default values. static final boolean DB = false; Loading Loading @@ -478,6 +479,7 @@ public class Watchdog extends Thread { continue; } else if (waitState == WAITED_HALF) { if (!waitedHalf) { if (DEBUG) Slog.d(TAG, "WAITED_HALF"); // We've waited half the deadlock-detection interval. Pull a stack // trace and wait another half. ArrayList<Integer> pids = new ArrayList<Integer>(); Loading
services/core/java/com/android/server/am/ActivityManagerDebugConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ class ActivityManagerDebugConfig { // Available log categories in the activity manager package. static final boolean DEBUG_ADD_REMOVE = DEBUG_ALL_ACTIVITIES || false; static final boolean DEBUG_ANR = false; static final boolean DEBUG_ANR = true; // STOPSHIP disable it (b/113252928) static final boolean DEBUG_APP = DEBUG_ALL_ACTIVITIES || false; static final boolean DEBUG_BACKGROUND_CHECK = DEBUG_ALL || false; static final boolean DEBUG_BACKUP = DEBUG_ALL || false; Loading
services/core/java/com/android/server/am/ActivityManagerService.java +19 −0 Original line number Diff line number Diff line Loading @@ -1618,6 +1618,9 @@ public class ActivityManagerService extends IActivityManager.Stub break; } case DISPATCH_UIDS_CHANGED_UI_MSG: { if (false) { // DO NOT SUBMIT WITH TRUE maybeTriggerWatchdog(); } dispatchUidsChanged(); } break; case DISPATCH_OOM_ADJ_OBSERVER_MSG: { Loading Loading @@ -21551,4 +21554,20 @@ public class ActivityManagerService extends IActivityManager.Stub return superImpl.apply(permName, uid); } } /** * If debug.trigger.watchdog is set to 1, sleep 10 minutes with the AM lock held, which would * cause a watchdog kill. */ void maybeTriggerWatchdog() { if (SystemProperties.getInt("debug.trigger.watchdog", 0) == 1) { Slog.w(TAG, "TRIGGERING WATCHDOG"); synchronized (ActivityManagerService.this) { try { Thread.sleep(600 * 1000); } catch (InterruptedException e) { } } } } }