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

Commit 5b3d6804 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Don't hold AM lock in AMS.getIntentSender

Nothing in the method requires the lock to be held as both the
user controller and pending intent controller have their own locks.
So, safe to remove to avoid deadlock where WM calls into PM which in
turn calls this method.

Change-Id: If91c0fb7477a0b71efce029089e6186b5dac8255
Fixes: 119559831
Test: N/A
parent 97dbb7b9
Loading
Loading
Loading
Loading
+36 −34
Original line number Original line Diff line number Diff line
@@ -4804,6 +4804,10 @@ public class ActivityManagerService extends IActivityManager.Stub
            String packageName, IBinder token, String resultWho,
            String packageName, IBinder token, String resultWho,
            int requestCode, Intent[] intents, String[] resolvedTypes,
            int requestCode, Intent[] intents, String[] resolvedTypes,
            int flags, Bundle bOptions, int userId) {
            int flags, Bundle bOptions, int userId) {
        // NOTE: The service lock isn't held in this method because nothing in the method requires
        // the service lock to be held.
        enforceNotIsolatedCaller("getIntentSender");
        enforceNotIsolatedCaller("getIntentSender");
        // Refuse possible leaked file descriptors
        // Refuse possible leaked file descriptors
        if (intents != null) {
        if (intents != null) {
@@ -4835,7 +4839,6 @@ public class ActivityManagerService extends IActivityManager.Stub
            }
            }
        }
        }
        synchronized(this) {
        int callingUid = Binder.getCallingUid();
        int callingUid = Binder.getCallingUid();
        int origUserId = userId;
        int origUserId = userId;
        userId = mUserController.handleIncomingUser(Binder.getCallingPid(), callingUid, userId,
        userId = mUserController.handleIncomingUser(Binder.getCallingPid(), callingUid, userId,
@@ -4873,7 +4876,6 @@ public class ActivityManagerService extends IActivityManager.Stub
            throw new SecurityException(e);
            throw new SecurityException(e);
        }
        }
    }
    }
    }
    @Override
    @Override
    public int sendIntentSender(IIntentSender target, IBinder whitelistToken, int code,
    public int sendIntentSender(IIntentSender target, IBinder whitelistToken, int code,