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

Commit 2bae4060 authored by Vairavan Srinivasan's avatar Vairavan Srinivasan Committed by Steve Kondik
Browse files

frameworks/base: release references of UriPermissionOwner

The list of references to UriPermissionOwner kept track in
writeOwners isn't cleared when requested by ActivityManagerService.
Fix is to check and clear writeOwners.

Change-Id: I0a7040a4041fff314cd283ce2d53fbe43ba2c324
parent 9b94f38b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -59,11 +59,11 @@ class UriPermission {
        if ((modeFlagsToClear&Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) {
            globalModeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
            modeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION;
            if (readOwners.size() > 0) {
            if (writeOwners.size() > 0) {
                for (UriPermissionOwner r : writeOwners) {
                    r.removeWritePermission(this);
                }
                readOwners.clear();
                writeOwners.clear();
            }
        }
    }