diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-04-13 22:57:49 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-04-14 09:54:21 -0700 |
commit | 399cccb85749e02f6d3e12d1d2846310e7cbfdf1 (patch) | |
tree | 029d692a88e79c9679cee5a2d092b1370241d63e /services | |
parent | 22b3644ac2027d055a6b187c979ef492ee6fb082 (diff) | |
download | frameworks_base-399cccb85749e02f6d3e12d1d2846310e7cbfdf1.zip frameworks_base-399cccb85749e02f6d3e12d1d2846310e7cbfdf1.tar.gz frameworks_base-399cccb85749e02f6d3e12d1d2846310e7cbfdf1.tar.bz2 |
Fix issue #593153: Broadcast time out when sending...
...ordered broadcast for ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE
Turns out this was because the broadcast receiver for ContextImpl was
not correctly being created, so when it received an ordered broadcast
it would not tell the activity manager when it was done.
This is now fixed, along with a ton of superficial changes to debug
output to help track this down and a little cleanup of dealing with
error cases in dispatching broadcasts. Also a fix for a NPE when
dumping the broadcast state.
Finally, a little fiddling with package manager to get rid of a lot
of the noise when removing and re-adding packages on the SD card.
Change-Id: I961c14836dc613d3ea8122b6e910ef866e7fcb25
Diffstat (limited to 'services')
3 files changed, 16 insertions, 10 deletions
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java index 78f7b33..7babb34 100644 --- a/services/java/com/android/server/PackageManagerService.java +++ b/services/java/com/android/server/PackageManagerService.java @@ -179,6 +179,8 @@ class PackageManagerService extends IPackageManager.Stub { static final int SCAN_NEW_INSTALL = 1<<4; static final int SCAN_NO_PATHS = 1<<5; + static final int REMOVE_CHATTY = 1<<16; + static final ComponentName DEFAULT_CONTAINER_COMPONENT = new ComponentName( "com.android.defcontainer", "com.android.defcontainer.DefaultContainerService"); @@ -6068,7 +6070,8 @@ class PackageManagerService extends IPackageManager.Stub { } synchronized (mInstallLock) { - res = deletePackageLI(packageName, deleteCodeAndResources, flags, info); + res = deletePackageLI(packageName, deleteCodeAndResources, + flags | REMOVE_CHATTY, info); } if(res && sendBroadCast) { @@ -6134,7 +6137,7 @@ class PackageManagerService extends IPackageManager.Stub { if (outInfo != null) { outInfo.removedPackage = packageName; } - removePackageLI(p, true); + removePackageLI(p, (flags&REMOVE_CHATTY) != 0); // Retrieve object to delete permissions for shared user later on PackageSetting deletedPs; synchronized (mPackages) { @@ -9589,8 +9592,7 @@ class PackageManagerService extends IPackageManager.Stub { continue; } // Parse package - int parseFlags = PackageParser.PARSE_CHATTY | - PackageParser.PARSE_ON_SDCARD | mDefParseFlags; + int parseFlags = PackageParser.PARSE_ON_SDCARD | mDefParseFlags; doGc = true; synchronized (mInstallLock) { final PackageParser.Package pkg = scanPackageLI(new File(codePath), diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index b6f323d..1486a1d 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -9905,7 +9905,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen } if (mOrderedBroadcasts.size() > 0) { pw.println(" "); - pw.println(" Active serialized broadcasts:"); + pw.println(" Active ordered broadcasts:"); } for (int i=mOrderedBroadcasts.size()-1; i>=0; i--) { pw.println(" Serialized Broadcast #" + i + ":"); @@ -12919,7 +12919,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen try { if (DEBUG_BROADCAST_LIGHT) { int seq = r.intent.getIntExtra("seq", -1); - Slog.i(TAG, "Delivering to " + filter.receiverList.app + Slog.i(TAG, "Delivering to " + filter + " (seq=" + seq + "): " + r); } performReceive(filter.receiverList.app, filter.receiverList.receiver, @@ -12959,7 +12959,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen if (DEBUG_BROADCAST) Slog.v(TAG, "processNextBroadcast: " + mParallelBroadcasts.size() + " broadcasts, " - + mOrderedBroadcasts.size() + " serialized broadcasts"); + + mOrderedBroadcasts.size() + " ordered broadcasts"); updateCpuStats(); @@ -12977,7 +12977,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen for (int i=0; i<N; i++) { Object target = r.receivers.get(i); if (DEBUG_BROADCAST) Slog.v(TAG, - "Delivering non-serialized to registered " + "Delivering non-ordered to registered " + target + ": " + r); deliverToRegisteredReceiver(r, (BroadcastFilter)target, false); } @@ -13115,12 +13115,14 @@ public final class ActivityManagerService extends ActivityManagerNative implemen // a direct call. BroadcastFilter filter = (BroadcastFilter)nextReceiver; if (DEBUG_BROADCAST) Slog.v(TAG, - "Delivering serialized to registered " + "Delivering ordered to registered " + filter + ": " + r); deliverToRegisteredReceiver(r, filter, r.ordered); if (r.receiver == null || !r.ordered) { // The receiver has already finished, so schedule to // process the next one. + if (DEBUG_BROADCAST) Slog.v(TAG, "Quick finishing: ordered=" + + r.ordered + " receiver=" + r.receiver); r.state = BroadcastRecord.IDLE; scheduleBroadcastsLocked(); } diff --git a/services/java/com/android/server/am/BroadcastRecord.java b/services/java/com/android/server/am/BroadcastRecord.java index 75c9600..c3f0b3e 100644 --- a/services/java/com/android/server/am/BroadcastRecord.java +++ b/services/java/com/android/server/am/BroadcastRecord.java @@ -126,7 +126,9 @@ class BroadcastRecord extends Binder { pw.println(prefix + "curApp=" + curApp); pw.println(prefix + "curComponent=" + (curComponent != null ? curComponent.toShortString() : "--")); - pw.println(prefix + "curSourceDir=" + curReceiver.applicationInfo.sourceDir); + if (curReceiver != null && curReceiver.applicationInfo != null) { + pw.println(prefix + "curSourceDir=" + curReceiver.applicationInfo.sourceDir); + } } String stateStr = " (?)"; switch (state) { |