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

Commit db8767f1 authored by Hai Zhang's avatar Hai Zhang
Browse files

Add package cache handling to PermissionService.

Since it's also in PermissionManagerServiceImpl.

The other corkPackageInfoCache() call in
PermissionManagerServiceImpl.updateAllPermissions() is skipped because
we are already properly batching the change notifications and there will
only be one invalidation call.

Bug: 263504888
Test: presubmit
Change-Id: I03246bb359f72321dfa930a83c582572d4c6a00a
parent dcdcf650
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -142,6 +142,12 @@ class PermissionService(
        userManagerInternal = LocalServices.getService(UserManagerInternal::class.java)
        userManagerService = UserManagerService.getInstance()

        // The package info cache is the cache for package and permission information.
        // Disable the package info and package permission caches locally but leave the
        // checkPermission cache active.
        PackageManager.invalidatePackageInfoCache();
        PermissionManager.disablePackageNamePermissionCache();

        handlerThread = ServiceThread(LOG_TAG, Process.THREAD_PRIORITY_BACKGROUND, true)
            .apply { start() }
        handler = Handler(handlerThread.looper)