summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server
diff options
context:
space:
mode:
authorJeff Hamilton <jham@android.com>2010-05-27 09:40:23 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-05-27 09:40:23 -0700
commitedf228ce1fc9aae9fe314229c19e80a434bb4393 (patch)
tree599592ce0f346fb9245294d9c71f6faf9c000563 /services/java/com/android/server
parent8316e875baee53b661d5af8fa843d97e51acbcf6 (diff)
parentdc46f6f6cc44954c23229019270b54b8912be825 (diff)
downloadframeworks_base-edf228ce1fc9aae9fe314229c19e80a434bb4393.zip
frameworks_base-edf228ce1fc9aae9fe314229c19e80a434bb4393.tar.gz
frameworks_base-edf228ce1fc9aae9fe314229c19e80a434bb4393.tar.bz2
am dc46f6f6: Merge "Don\'t enforce broadcast timeouts for PRE_BOOT_COMPLETED broadcasts." into froyo
Merge commit 'dc46f6f6cc44954c23229019270b54b8912be825' into froyo-plus-aosp * commit 'dc46f6f6cc44954c23229019270b54b8912be825': Don't enforce broadcast timeouts for PRE_BOOT_COMPLETED broadcasts.
Diffstat (limited to 'services/java/com/android/server')
-rw-r--r--services/java/com/android/server/am/ActivityManagerService.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 022eccf..61ab197 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -1106,7 +1106,12 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
mHandler.sendMessageDelayed(nmsg, BROADCAST_TIMEOUT);
return;
}
- broadcastTimeout();
+ // 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();
+ }
} break;
case PAUSE_TIMEOUT_MSG: {
IBinder token = (IBinder)msg.obj;
@@ -13116,10 +13121,15 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
// Ensure that even if something goes awry with the timeout
// 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;
- long now = SystemClock.uptimeMillis();
- if (r.dispatchTime > 0) {
+ if (mSystemReady && r.dispatchTime > 0) {
+ long now = SystemClock.uptimeMillis();
if ((numReceivers > 0) &&
(now > r.dispatchTime + (2*BROADCAST_TIMEOUT*numReceivers))) {
Slog.w(TAG, "Hung broadcast discarded after timeout failure:"