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

Commit 11302498 authored by Eric Laurent's avatar Eric Laurent
Browse files

PermissionCache: expose a method to purge permission cache

Expose PermissionCache::purge() method. This is needed when running CTS
tests that adopt the shell permission identity to make sure the CTS apk
permissions are checked again after adopting the shell permission.

Bug: 185972521
Test: AudioRecordSharedAudioTest
Change-Id: I2c013eb857917e4c4477abf6237d0a76ef70aa9a
parent 82f6e7f8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -109,5 +109,10 @@ bool PermissionCache::checkPermission(
    return granted;
}

void PermissionCache::purgeCache() {
    PermissionCache& pc(PermissionCache::getInstance());
    pc.purge();
}

// ---------------------------------------------------------------------------
} // namespace android
+2 −0
Original line number Diff line number Diff line
@@ -73,6 +73,8 @@ public:

    static bool checkPermission(const String16& permission,
            pid_t pid, uid_t uid);

    static void purgeCache();
};

// ---------------------------------------------------------------------------