summaryrefslogtreecommitdiffstats
path: root/services/core/java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-07-15 11:32:32 -0700
committerDianne Hackborn <hackbod@google.com>2015-07-15 11:32:32 -0700
commit16f3671620bab310f5ed4f9222d4a36a8dcef562 (patch)
treea16a07ecb71ba4c0b911b5d1579c7521a98b2d52 /services/core/java
parent1d4247c4cc89c6d62e44ed3115f26579979b44b5 (diff)
downloadframeworks_base-16f3671620bab310f5ed4f9222d4a36a8dcef562.zip
frameworks_base-16f3671620bab310f5ed4f9222d4a36a8dcef562.tar.gz
frameworks_base-16f3671620bab310f5ed4f9222d4a36a8dcef562.tar.bz2
Fix issue #22487155: Device unresponsive (deadlock in system_server)
Using my magic potion, Deadlock-B-Gone! Change-Id: If5c0a2b18134dc95444f3782ab5aa475414b5839
Diffstat (limited to 'services/core/java')
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 37aa408..1582037 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -10801,6 +10801,8 @@ public final class ActivityManagerService extends ActivityManagerNative
}
// We are now ready to launch the assist activity.
+ IResultReceiver sendReceiver = null;
+ Bundle sendBundle = null;
synchronized (this) {
buildAssistBundleLocked(pae, extras);
boolean exists = mPendingAssistExtras.remove(pae);
@@ -10809,19 +10811,21 @@ public final class ActivityManagerService extends ActivityManagerNative
// Timed out.
return;
}
- if (pae.receiver != null) {
+ if ((sendReceiver=pae.receiver) != null) {
// Caller wants result sent back to them.
- Bundle topBundle = new Bundle();
- topBundle.putBundle("data", pae.extras);
- topBundle.putParcelable("structure", pae.structure);
- topBundle.putParcelable("content", pae.content);
- try {
- pae.receiver.send(0, topBundle);
- } catch (RemoteException e) {
- }
- return;
+ sendBundle = new Bundle();
+ sendBundle.putBundle("data", pae.extras);
+ sendBundle.putParcelable("structure", pae.structure);
+ sendBundle.putParcelable("content", pae.content);
}
}
+ if (sendReceiver != null) {
+ try {
+ sendReceiver.send(0, sendBundle);
+ } catch (RemoteException e) {
+ }
+ return;
+ }
long ident = Binder.clearCallingIdentity();
try {