Do not inherit all permissions from shell
adoptShellPermissionIdentity has two modes:
- Totally become the shell from the permissions perspective. This
includes _not_having_ permissions the shell does not have
- Only add a few permission from the shell to the current app. I.e. keep
permissions the shell might not have.
As the shell is missing some permissions the PermissionController has we
need to choose option 2 as otherwise the PermissionController might be
temporarily deprivilidged and some parallel ongoing action might crash.
Test: atest --rerun-until-failure 100 GooglePermissionControllerUnitTests:com.android.permissioncontroller.ui.handheld.ManageStandardPermissionsFragmentTest#groupSummaryGetsUpdatedWhenPermissionGetsRevoked GooglePermissionControllerUnitTests:com.android.permissioncontroller.ui.handheld.ManageStandardPermissionsFragmentTest#groupSummaryGetsUpdatedWhenAppGetsUninstalled
Fixes: 154750267
Change-Id: I68f90fe597fb9607e8733f26f78769d4367fc3ad
2 files changed