Merge "Fix issue #22487155: Device unresponsive (deadlock in system_server)" into mnc-dev

This commit is contained in:
Dianne Hackborn
2015-07-15 23:30:49 +00:00
committed by Android (Google) Code Review

View File

@@ -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 {