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

Commit 4ff9f6d4 authored by Hai Zhang's avatar Hai Zhang
Browse files

Optimize check for requested permissions.

Added requestedPackageStates in evalutePermissionState() so that
requested permissions is only checked for one time.

any/forEachRequestingPackageInAppId() is removed in favor of
any/forEachPackageInAppId() - other usages outside of
evaluatePermissionState() can manually check for requested permissions
if needed, and this also benefits performance a bit in that other faster
checks can be done before checking requested permissions.

Also changed revokePermissionsOnPackageUpdate() to check for all packages
in the app ID, because storage isolation always applies to the entire
UID regardless of whether they requested a certain permission, and
this is also more consistent with the old subsystem.

The added reduce*() extension functions are hard coded to work with
Int instead of using generics, because generics will compile into
boxed Integer in bytecode despite that the functions are inlined.

Bug: 278913322
Test: presubmit
Change-Id: I6cbace38b5ea7d1782da3b1c1ee68683073080ba
parent d9041331
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment