diff options
author | 2021-04-23 16:57:33 +0200 | |
---|---|---|
committer | 2021-04-27 11:37:55 +0200 | |
commit | 881030a5c86f642a5783156568571ff369366f9c (patch) | |
tree | 6af274af1218ed197de4abd27828957d54cae599 | |
parent | 1488a15856a20ab3c0df3ecab1a14a8c4afc30d8 (diff) |
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: AudioRecord regression tests
Change-Id: I2c013eb857917e4c4477abf6237d0a76ef70aa9a
Merged-In: I2c013eb857917e4c4477abf6237d0a76ef70aa9a
-rw-r--r-- | libs/binder/PermissionCache.cpp | 5 | ||||
-rw-r--r-- | libs/binder/include/binder/PermissionCache.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libs/binder/PermissionCache.cpp b/libs/binder/PermissionCache.cpp index 6eae5efc29..670fd55da3 100644 --- a/libs/binder/PermissionCache.cpp +++ b/libs/binder/PermissionCache.cpp @@ -109,5 +109,10 @@ bool PermissionCache::checkPermission( return granted; } +void PermissionCache::purgeCache() { + PermissionCache& pc(PermissionCache::getInstance()); + pc.purge(); +} + // --------------------------------------------------------------------------- } // namespace android diff --git a/libs/binder/include/binder/PermissionCache.h b/libs/binder/include/binder/PermissionCache.h index 835a3a8eb8..21aa705ff7 100644 --- a/libs/binder/include/binder/PermissionCache.h +++ b/libs/binder/include/binder/PermissionCache.h @@ -73,6 +73,8 @@ public: static bool checkPermission(const String16& permission, pid_t pid, uid_t uid); + + static void purgeCache(); }; // --------------------------------------------------------------------------- |