Refactor getAppOpPermissionPackages() as API.
- Remove IPermissionManager.getAppOpPermissionPackages() and its usage
because we are not going to expose it as a new API on
PermissionManager.
- Make PermissionManagerServiceInternal.getAppOpPermissionPackages()
unchecked because it's an internal API. Internal APIs should be by
default unchecked and checks should be done manually when
necessary.
- The parameters and return value of
PermissionManagerServiceInternal.getAppOpPermissionPackages() are
also made non-null to be a good API, and EmptyArray.STRING is
returned in the empty case so there won't be a performance penalty.
IPackageManager.getAppOpPermissionPackages() will return an empty
array for null permissionName before calling
PermissionManagerServiceInternal.getAppOpPermissionPackages() for
compatibility, and clients should handle returned empty arrays as
good as null.
- Use PermissionManagerServiceInternal.getAppOpPermissionPackages()
only to support the @UnsupportedAppUsage of
IPackageManager.getAppOpPermissionPackages() and perform checks
there.
Bug: 158736025
Test: presubmit
Change-Id: I0f96e898daa4cf40706430f1b7fbd5737a1f97f8
5 files changed