Loading services/java/com/android/server/am/ActivityManagerService.java +14 −4 Original line number Original line Diff line number Diff line Loading @@ -1106,7 +1106,12 @@ public final class ActivityManagerService extends ActivityManagerNative implemen mHandler.sendMessageDelayed(nmsg, BROADCAST_TIMEOUT); mHandler.sendMessageDelayed(nmsg, BROADCAST_TIMEOUT); return; return; } } // Only process broadcast timeouts if the system is ready. That way // PRE_BOOT_COMPLETED broadcasts can't timeout as they are intended // to do heavy lifting for system up if (mSystemReady) { broadcastTimeout(); broadcastTimeout(); } } break; } break; case PAUSE_TIMEOUT_MSG: { case PAUSE_TIMEOUT_MSG: { IBinder token = (IBinder)msg.obj; IBinder token = (IBinder)msg.obj; Loading Loading @@ -13117,9 +13122,14 @@ public final class ActivityManagerService extends ActivityManagerNative implemen // Ensure that even if something goes awry with the timeout // Ensure that even if something goes awry with the timeout // detection, we catch "hung" broadcasts here, discard them, // detection, we catch "hung" broadcasts here, discard them, // and continue to make progress. // and continue to make progress. // // This is only done if the system is ready so that PRE_BOOT_COMPLETED // receivers don't get executed with with timeouts. They're intended for // one time heavy lifting after system upgrades and can take // significant amounts of time. int numReceivers = (r.receivers != null) ? r.receivers.size() : 0; int numReceivers = (r.receivers != null) ? r.receivers.size() : 0; if (mSystemReady && r.dispatchTime > 0) { long now = SystemClock.uptimeMillis(); long now = SystemClock.uptimeMillis(); if (r.dispatchTime > 0) { if ((numReceivers > 0) && if ((numReceivers > 0) && (now > r.dispatchTime + (2*BROADCAST_TIMEOUT*numReceivers))) { (now > r.dispatchTime + (2*BROADCAST_TIMEOUT*numReceivers))) { Slog.w(TAG, "Hung broadcast discarded after timeout failure:" Slog.w(TAG, "Hung broadcast discarded after timeout failure:" Loading
services/java/com/android/server/am/ActivityManagerService.java +14 −4 Original line number Original line Diff line number Diff line Loading @@ -1106,7 +1106,12 @@ public final class ActivityManagerService extends ActivityManagerNative implemen mHandler.sendMessageDelayed(nmsg, BROADCAST_TIMEOUT); mHandler.sendMessageDelayed(nmsg, BROADCAST_TIMEOUT); return; return; } } // Only process broadcast timeouts if the system is ready. That way // PRE_BOOT_COMPLETED broadcasts can't timeout as they are intended // to do heavy lifting for system up if (mSystemReady) { broadcastTimeout(); broadcastTimeout(); } } break; } break; case PAUSE_TIMEOUT_MSG: { case PAUSE_TIMEOUT_MSG: { IBinder token = (IBinder)msg.obj; IBinder token = (IBinder)msg.obj; Loading Loading @@ -13117,9 +13122,14 @@ public final class ActivityManagerService extends ActivityManagerNative implemen // Ensure that even if something goes awry with the timeout // Ensure that even if something goes awry with the timeout // detection, we catch "hung" broadcasts here, discard them, // detection, we catch "hung" broadcasts here, discard them, // and continue to make progress. // and continue to make progress. // // This is only done if the system is ready so that PRE_BOOT_COMPLETED // receivers don't get executed with with timeouts. They're intended for // one time heavy lifting after system upgrades and can take // significant amounts of time. int numReceivers = (r.receivers != null) ? r.receivers.size() : 0; int numReceivers = (r.receivers != null) ? r.receivers.size() : 0; if (mSystemReady && r.dispatchTime > 0) { long now = SystemClock.uptimeMillis(); long now = SystemClock.uptimeMillis(); if (r.dispatchTime > 0) { if ((numReceivers > 0) && if ((numReceivers > 0) && (now > r.dispatchTime + (2*BROADCAST_TIMEOUT*numReceivers))) { (now > r.dispatchTime + (2*BROADCAST_TIMEOUT*numReceivers))) { Slog.w(TAG, "Hung broadcast discarded after timeout failure:" Slog.w(TAG, "Hung broadcast discarded after timeout failure:"