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
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 9019af6..fd0edaa 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -796,7 +796,7 @@
                     scheduler = mMainThread.getHandler();
                 }
                 rd = new ActivityThread.PackageInfo.ReceiverDispatcher(
-                        receiver, context, scheduler, null, false).getIIntentReceiver();
+                        receiver, context, scheduler, null, true).getIIntentReceiver();
             }
         }
         try {