Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16f36716 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #22487155: Device unresponsive (deadlock in system_server)

Using my magic potion, Deadlock-B-Gone!

Change-Id: If5c0a2b18134dc95444f3782ab5aa475414b5839
parent 1d4247c4
Loading
Loading
Loading
Loading
+14 −10
Original line number Diff line number Diff line
@@ -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);
                sendBundle = new Bundle();
                sendBundle.putBundle("data", pae.extras);
                sendBundle.putParcelable("structure", pae.structure);
                sendBundle.putParcelable("content", pae.content);
            }
        }
        if (sendReceiver != null) {
            try {
                    pae.receiver.send(0, topBundle);
                sendReceiver.send(0, sendBundle);
            } catch (RemoteException e) {
            }
            return;
        }
        }
        long ident = Binder.clearCallingIdentity();
        try {