Remove retainHardAndSoftRestrictedPermissions().

We already skip permissions that aren't soft or hard restricted in
setAllowlistedRestrictedPermissionsInternal().

Bug: 158736025
Test: presubmit
Change-Id: If3ac1fc929413036648eaa26f4dcc7a2bb93ccd9
This commit is contained in:
Hai Zhang
2020-12-05 00:10:10 -08:00
parent c43d935c42
commit b3b019b050
3 changed files with 0 additions and 25 deletions

View File

@@ -686,11 +686,6 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
}
}
if (params.whitelistedRestrictedPermissions != null) {
mPermissionManager.retainHardAndSoftRestrictedPermissions(
params.whitelistedRestrictedPermissions);
}
final int sessionId;
final PackageInstallerSession session;
synchronized (mSessions) {

View File

@@ -5147,20 +5147,6 @@ public class PermissionManagerService extends IPermissionManager.Stub {
true, mDefaultPermissionCallback);
}
@Override
public void retainHardAndSoftRestrictedPermissions(@NonNull List<String> permissionNames) {
synchronized (mLock) {
Iterator<String> iterator = permissionNames.iterator();
while (iterator.hasNext()) {
final String permissionName = iterator.next();
final Permission permission = mRegistry.getPermission(permissionName);
if (permission == null || !permission.isHardOrSoftRestricted()) {
iterator.remove();
}
}
}
}
@Override
public void readLegacyPermissionsTEMP(
@NonNull LegacyPermissionSettings legacyPermissionSettings) {

View File

@@ -183,12 +183,6 @@ public interface PermissionManagerServiceInternal extends PermissionManagerInter
//@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)
void stopShellPermissionIdentityDelegation();
/**
* Removes invalid permissions which are not {@link PermissionInfo#FLAG_HARD_RESTRICTED} or
* {@link PermissionInfo#FLAG_SOFT_RESTRICTED} from the input.
*/
void retainHardAndSoftRestrictedPermissions(@NonNull List<String> permissionNames);
/**
* Read legacy permissions from legacy permission settings.
*