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
diff --git a/libs/binder/PermissionCache.cpp b/libs/binder/PermissionCache.cpp
index 6eae5ef..670fd55 100644
--- a/libs/binder/PermissionCache.cpp
+++ b/libs/binder/PermissionCache.cpp
@@ -109,5 +109,10 @@
     return granted;
 }
 
+void PermissionCache::purgeCache() {
+    PermissionCache& pc(PermissionCache::getInstance());
+    pc.purge();
+}
+
 // ---------------------------------------------------------------------------
 } // namespace android