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

Skip to content
Commit 32a2a1f8 authored by Winson Chiu's avatar Winson Chiu
Browse files

Add PackageInstaller.SessionParams.setPermissionState

Allows an installer to request specific permissions be granted
or denied during installation.

This deprecates and replaces the old setGrantedRuntimePermissions.
The usage of that method is now mapped to call setPermissionState
with PERMISSION_STATE_GRANTED.

However, there is no equivalent in the new API for granting all
requested permissions. This is probably not a great pattern to maintain,
but the behavior has been preserved for existing callers like shell
by reusing the existing flag and effectively disabling the new API
if it's used.

Modern app stores should use setPermissionState, and privilieged stores
that need to maintain compatibility should use a compat utility to
branch the logic between the old and new APIs.

Bug: 266955680

Test: atest PackageInstallerSessionTest

Change-Id: I27775eab73462f053a517a4185f6e3c509e16ba7
parent 0d5fb943
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment