Loading services/core/java/com/android/server/uri/UriPermission.java +22 −10 Original line number Diff line number Diff line Loading @@ -208,16 +208,22 @@ final class UriPermission { persistedModeFlags &= ~Intent.FLAG_GRANT_READ_URI_PERMISSION; } globalModeFlags &= ~Intent.FLAG_GRANT_READ_URI_PERMISSION; ArraySet<UriPermissionOwner> readOwnersCopy = null; synchronized (this) { if (mReadOwners != null && includingOwners) { ownedModeFlags &= ~Intent.FLAG_GRANT_READ_URI_PERMISSION; for (UriPermissionOwner r : mReadOwners) { // Keeping a copy to remove the permission outside of UriPermission lock to // prevent Deadlock readOwnersCopy = new ArraySet<>(mReadOwners); mReadOwners = null; } } if (readOwnersCopy != null) { for (UriPermissionOwner r : readOwnersCopy) { if (r != null) { r.removeReadPermission(this); } } mReadOwners = null; } } } if ((modeFlags & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) { Loading @@ -226,16 +232,22 @@ final class UriPermission { persistedModeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION; } globalModeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION; ArraySet<UriPermissionOwner> writeOwnersCopy = null; synchronized (this) { if (mWriteOwners != null && includingOwners) { ownedModeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION; for (UriPermissionOwner r : mWriteOwners) { // Keeping a copy to remove the permission outside of UriPermission lock to // prevent Deadlock writeOwnersCopy = new ArraySet<>(mWriteOwners); mWriteOwners = null; } } if (writeOwnersCopy != null) { for (UriPermissionOwner r : writeOwnersCopy) { if (r != null) { r.removeWritePermission(this); } } mWriteOwners = null; } } } Loading Loading
services/core/java/com/android/server/uri/UriPermission.java +22 −10 Original line number Diff line number Diff line Loading @@ -208,16 +208,22 @@ final class UriPermission { persistedModeFlags &= ~Intent.FLAG_GRANT_READ_URI_PERMISSION; } globalModeFlags &= ~Intent.FLAG_GRANT_READ_URI_PERMISSION; ArraySet<UriPermissionOwner> readOwnersCopy = null; synchronized (this) { if (mReadOwners != null && includingOwners) { ownedModeFlags &= ~Intent.FLAG_GRANT_READ_URI_PERMISSION; for (UriPermissionOwner r : mReadOwners) { // Keeping a copy to remove the permission outside of UriPermission lock to // prevent Deadlock readOwnersCopy = new ArraySet<>(mReadOwners); mReadOwners = null; } } if (readOwnersCopy != null) { for (UriPermissionOwner r : readOwnersCopy) { if (r != null) { r.removeReadPermission(this); } } mReadOwners = null; } } } if ((modeFlags & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) { Loading @@ -226,16 +232,22 @@ final class UriPermission { persistedModeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION; } globalModeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION; ArraySet<UriPermissionOwner> writeOwnersCopy = null; synchronized (this) { if (mWriteOwners != null && includingOwners) { ownedModeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION; for (UriPermissionOwner r : mWriteOwners) { // Keeping a copy to remove the permission outside of UriPermission lock to // prevent Deadlock writeOwnersCopy = new ArraySet<>(mWriteOwners); mWriteOwners = null; } } if (writeOwnersCopy != null) { for (UriPermissionOwner r : writeOwnersCopy) { if (r != null) { r.removeWritePermission(this); } } mWriteOwners = null; } } } Loading