Skip to content
Commit 65d46e9b authored by Hai Zhang's avatar Hai Zhang
Browse files

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
parent a5a96475
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