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

Commit dfdee53c authored by Jing Ji's avatar Jing Ji
Browse files

Use ActivityManagerService lock in grantUriPermission

Fix the incorrect lock ordering

Bug: 179469221
Bug: 179476377
Test: atest CtsAppSecurityHostTestCases:ExternalStorageHostTest
Change-Id: Ie5f60be173ab6d5cb9264e2d0f93f030c6fd7bb6
parent 8098f49d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5632,7 +5632,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            final int modeFlags, int userId) {
        enforceNotIsolatedCaller("grantUriPermission");
        GrantUri grantUri = new GrantUri(userId, uri, modeFlags);
        synchronized (mProcLock) {
        synchronized (this) {
            final ProcessRecord r = getRecordForAppLOSP(caller);
            if (r == null) {
                throw new SecurityException("Unable to find app for caller "
@@ -5666,7 +5666,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    public void revokeUriPermission(IApplicationThread caller, String targetPackage, Uri uri,
            final int modeFlags, int userId) {
        enforceNotIsolatedCaller("revokeUriPermission");
        synchronized (mProcLock) {
        synchronized (this) {
            final ProcessRecord r = getRecordForAppLOSP(caller);
            if (r == null) {
                throw new SecurityException("Unable to find app for caller "