Merge RQ1A.210105.003 to aosp-master - DO NOT MERGE
Merged-In: I034d45f1afcdd07c0b12e2db7e4134b695ec5c70 Change-Id: I329407db7c9ed7d2b512e505df6e50c4f471fafa
This commit is contained in:
@@ -16,16 +16,23 @@
|
||||
package android.accounts;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.widget.TextView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.view.View;
|
||||
import android.view.LayoutInflater;
|
||||
import android.app.ActivityTaskManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.Process;
|
||||
import android.os.RemoteException;
|
||||
import android.os.UserHandle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.internal.R;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -42,11 +49,15 @@ public class GrantCredentialsPermissionActivity extends Activity implements View
|
||||
private Account mAccount;
|
||||
private String mAuthTokenType;
|
||||
private int mUid;
|
||||
private int mCallingUid;
|
||||
private Bundle mResultBundle = null;
|
||||
protected LayoutInflater mInflater;
|
||||
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWindow().addSystemFlags(
|
||||
android.view.WindowManager.LayoutParams
|
||||
.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
|
||||
setContentView(R.layout.grant_credentials_permission);
|
||||
setTitle(R.string.grant_permissions_header_text);
|
||||
|
||||
@@ -74,6 +85,20 @@ public class GrantCredentialsPermissionActivity extends Activity implements View
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
IBinder activityToken = getActivityToken();
|
||||
mCallingUid = ActivityTaskManager.getService().getLaunchedFromUid(activityToken);
|
||||
} catch (RemoteException re) {
|
||||
// Couldn't figure out caller details
|
||||
Log.w(getClass().getSimpleName(), "Unable to get caller identity \n" + re);
|
||||
}
|
||||
|
||||
if (!UserHandle.isSameApp(mCallingUid, Process.SYSTEM_UID) && mCallingUid != mUid) {
|
||||
setResult(Activity.RESULT_CANCELED);
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
String accountTypeLabel;
|
||||
try {
|
||||
accountTypeLabel = getAccountLabel(mAccount);
|
||||
|
||||
@@ -153,6 +153,7 @@ public abstract class SliceProvider extends ContentProvider {
|
||||
*/
|
||||
public static final String EXTRA_PKG = "pkg";
|
||||
/**
|
||||
* @Deprecated provider pkg is now being extracted in SlicePermissionActivity
|
||||
* @hide
|
||||
*/
|
||||
public static final String EXTRA_PROVIDER_PKG = "provider_pkg";
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.android.packageinstaller;
|
||||
|
||||
import static android.app.AppOpsManager.MODE_ALLOWED;
|
||||
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
|
||||
|
||||
import static com.android.packageinstaller.PackageUtil.getMaxTargetSdkVersionForUid;
|
||||
|
||||
@@ -87,6 +88,8 @@ public class UninstallerActivity extends Activity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
|
||||
|
||||
// Never restore any state, esp. never create any fragments. The data in the fragment might
|
||||
// be stale, if e.g. the app was uninstalled while the activity was destroyed.
|
||||
super.onCreate(null);
|
||||
|
||||
@@ -16,6 +16,7 @@ package com.android.systemui;
|
||||
|
||||
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.slice.SliceManager;
|
||||
@@ -29,6 +30,7 @@ import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.BidiFormatter;
|
||||
import android.util.EventLog;
|
||||
import android.util.Log;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.TextView;
|
||||
@@ -50,10 +52,12 @@ public class SlicePermissionActivity extends Activity implements OnClickListener
|
||||
|
||||
mUri = getIntent().getParcelableExtra(SliceProvider.EXTRA_BIND_URI);
|
||||
mCallingPkg = getIntent().getStringExtra(SliceProvider.EXTRA_PKG);
|
||||
mProviderPkg = getIntent().getStringExtra(SliceProvider.EXTRA_PROVIDER_PKG);
|
||||
|
||||
try {
|
||||
PackageManager pm = getPackageManager();
|
||||
mProviderPkg = pm.resolveContentProvider(mUri.getAuthority(),
|
||||
PackageManager.GET_META_DATA).applicationInfo.packageName;
|
||||
verifyCallingPkg();
|
||||
CharSequence app1 = BidiFormatter.getInstance().unicodeWrap(pm.getApplicationInfo(
|
||||
mCallingPkg, 0).loadSafeLabel(pm, PackageItemInfo.DEFAULT_MAX_LABEL_SIZE_PX,
|
||||
PackageItemInfo.SAFE_LABEL_FLAG_TRIM
|
||||
@@ -97,4 +101,27 @@ public class SlicePermissionActivity extends Activity implements OnClickListener
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
finish();
|
||||
}
|
||||
|
||||
private void verifyCallingPkg() {
|
||||
final String providerPkg = getIntent().getStringExtra(SliceProvider.EXTRA_PROVIDER_PKG);
|
||||
if (providerPkg == null || mProviderPkg.equals(providerPkg)) return;
|
||||
final String callingPkg = getCallingPkg();
|
||||
EventLog.writeEvent(0x534e4554, "159145361", getUid(callingPkg));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getCallingPkg() {
|
||||
final Uri referrer = getReferrer();
|
||||
if (referrer == null) return null;
|
||||
return referrer.getHost();
|
||||
}
|
||||
|
||||
private int getUid(@Nullable final String pkg) {
|
||||
if (pkg == null) return -1;
|
||||
try {
|
||||
return getPackageManager().getApplicationInfo(pkg, 0).uid;
|
||||
} catch (NameNotFoundException e) {
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,7 +372,10 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
|
||||
|
||||
checkArgument(getCallingUserId() == userId,
|
||||
"Must be called by either same user or system");
|
||||
mAppOpsManager.checkPackage(Binder.getCallingUid(), pkg);
|
||||
int callingUid = Binder.getCallingUid();
|
||||
if (mAppOpsManager.checkPackage(callingUid, pkg) != AppOpsManager.MODE_ALLOWED) {
|
||||
throw new SecurityException(pkg + " doesn't belong to uid " + callingUid);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10459,12 +10459,10 @@ public class ActivityManagerService extends IActivityManager.Stub
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(identity);
|
||||
}
|
||||
if (uid == Process.INVALID_UID) {
|
||||
return Process.INVALID_UID;
|
||||
}
|
||||
// If the uid is Process.INVALID_UID, the below 'if' check will be always true
|
||||
if (UserHandle.getAppId(uid) != UserHandle.getAppId(callingUid)) {
|
||||
// Requires the DUMP permission if the target package doesn't belong
|
||||
// to the caller.
|
||||
// to the caller or it doesn't exist.
|
||||
enforceCallingPermission(android.Manifest.permission.DUMP, function);
|
||||
}
|
||||
return uid;
|
||||
|
||||
@@ -16,16 +16,22 @@
|
||||
|
||||
package com.android.server.biometrics;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.ActivityTaskManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.hardware.biometrics.BiometricAuthenticator;
|
||||
import android.hardware.biometrics.BiometricConstants;
|
||||
import android.hardware.biometrics.BiometricsProtoEnums;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.security.KeyStore;
|
||||
import android.util.EventLog;
|
||||
import android.util.Slog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A class to keep track of the authentication state for a given client.
|
||||
@@ -148,7 +154,54 @@ public abstract class AuthenticationClient extends ClientMonitor {
|
||||
+ ", requireConfirmation: " + mRequireConfirmation
|
||||
+ ", user: " + getTargetUserId());
|
||||
|
||||
// Ensure authentication only succeeds if the client activity is on top or is keyguard.
|
||||
boolean isBackgroundAuth = false;
|
||||
if (authenticated && !Utils.isKeyguard(getContext(), getOwnerString())) {
|
||||
try {
|
||||
final List<ActivityManager.RunningTaskInfo> tasks =
|
||||
ActivityTaskManager.getService().getTasks(1);
|
||||
if (tasks == null || tasks.isEmpty()) {
|
||||
Slog.e(TAG, "No running tasks reported");
|
||||
isBackgroundAuth = true;
|
||||
} else {
|
||||
final ComponentName topActivity = tasks.get(0).topActivity;
|
||||
if (topActivity == null) {
|
||||
Slog.e(TAG, "Unable to get top activity");
|
||||
isBackgroundAuth = true;
|
||||
} else {
|
||||
final String topPackage = topActivity.getPackageName();
|
||||
if (!topPackage.contentEquals(getOwnerString())) {
|
||||
Slog.e(TAG, "Background authentication detected, top: " + topPackage
|
||||
+ ", client: " + this);
|
||||
isBackgroundAuth = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "Unable to get running tasks", e);
|
||||
isBackgroundAuth = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Fail authentication if we can't confirm the client activity is on top.
|
||||
if (isBackgroundAuth) {
|
||||
Slog.e(TAG, "Failing possible background authentication");
|
||||
authenticated = false;
|
||||
|
||||
// SafetyNet logging for exploitation attempts of b/159249069.
|
||||
final ApplicationInfo appInfo = getContext().getApplicationInfo();
|
||||
EventLog.writeEvent(0x534e4554, "159249069", appInfo != null ? appInfo.uid : -1,
|
||||
"Attempted background authentication");
|
||||
}
|
||||
|
||||
if (authenticated) {
|
||||
// SafetyNet logging for b/159249069 if constraint is violated.
|
||||
if (isBackgroundAuth) {
|
||||
final ApplicationInfo appInfo = getContext().getApplicationInfo();
|
||||
EventLog.writeEvent(0x534e4554, "159249069", appInfo != null ? appInfo.uid : -1,
|
||||
"Successful background authentication!");
|
||||
}
|
||||
|
||||
mAlreadyDone = true;
|
||||
|
||||
if (listener != null) {
|
||||
|
||||
@@ -331,6 +331,7 @@ import com.android.internal.os.SomeArgs;
|
||||
import com.android.internal.os.Zygote;
|
||||
import com.android.internal.telephony.CarrierAppUtils;
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
import com.android.internal.util.CollectionUtils;
|
||||
import com.android.internal.util.ConcurrentUtils;
|
||||
import com.android.internal.util.DumpUtils;
|
||||
import com.android.internal.util.FastXmlSerializer;
|
||||
@@ -12455,12 +12456,17 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
mPermissionManager.addAllPermissionGroups(pkg, chatty);
|
||||
}
|
||||
|
||||
// If a permission has had its defining app changed, or it has had its protection
|
||||
// upgraded, we need to revoke apps that hold it
|
||||
final List<String> permissionsWithChangedDefinition;
|
||||
// Don't allow ephemeral applications to define new permissions.
|
||||
if ((scanFlags & SCAN_AS_INSTANT_APP) != 0) {
|
||||
permissionsWithChangedDefinition = null;
|
||||
Slog.w(TAG, "Permissions from package " + pkg.getPackageName()
|
||||
+ " ignored: instant apps cannot define new permissions.");
|
||||
} else {
|
||||
mPermissionManager.addAllPermissions(pkg, chatty);
|
||||
permissionsWithChangedDefinition =
|
||||
mPermissionManager.addAllPermissions(pkg, chatty);
|
||||
}
|
||||
|
||||
int collectionSize = ArrayUtils.size(pkg.getInstrumentations());
|
||||
@@ -12489,7 +12495,10 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
}
|
||||
}
|
||||
|
||||
if (oldPkg != null) {
|
||||
boolean hasOldPkg = oldPkg != null;
|
||||
boolean hasPermissionDefinitionChanges =
|
||||
!CollectionUtils.isEmpty(permissionsWithChangedDefinition);
|
||||
if (hasOldPkg || hasPermissionDefinitionChanges) {
|
||||
// We need to call revokeRuntimePermissionsIfGroupChanged async as permission
|
||||
// revoke callbacks from this method might need to kill apps which need the
|
||||
// mPackages lock on a different thread. This would dead lock.
|
||||
@@ -12500,9 +12509,16 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
// won't be granted yet, hence new packages are no problem.
|
||||
final ArrayList<String> allPackageNames = new ArrayList<>(mPackages.keySet());
|
||||
|
||||
AsyncTask.execute(() ->
|
||||
AsyncTask.execute(() -> {
|
||||
if (hasOldPkg) {
|
||||
mPermissionManager.revokeRuntimePermissionsIfGroupChanged(pkg, oldPkg,
|
||||
allPackageNames));
|
||||
allPackageNames);
|
||||
}
|
||||
if (hasPermissionDefinitionChanges) {
|
||||
mPermissionManager.revokeRuntimePermissionsIfPermissionDefinitionChanged(
|
||||
permissionsWithChangedDefinition, allPackageNames);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@ public final class BasePermission {
|
||||
|
||||
final @PermissionType int type;
|
||||
|
||||
private boolean mPermissionDefinitionChanged;
|
||||
|
||||
String sourcePackageName;
|
||||
|
||||
int protectionLevel;
|
||||
@@ -126,6 +128,11 @@ public final class BasePermission {
|
||||
public String getSourcePackageName() {
|
||||
return sourcePackageName;
|
||||
}
|
||||
|
||||
public boolean isPermissionDefinitionChanged() {
|
||||
return mPermissionDefinitionChanged;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
@@ -140,6 +147,10 @@ public final class BasePermission {
|
||||
this.perm = perm;
|
||||
}
|
||||
|
||||
public void setPermissionDefinitionChanged(boolean shouldOverride) {
|
||||
mPermissionDefinitionChanged = shouldOverride;
|
||||
}
|
||||
|
||||
public int[] computeGids(int userId) {
|
||||
if (perUser) {
|
||||
final int[] userGids = new int[gids.length];
|
||||
@@ -322,6 +333,7 @@ public final class BasePermission {
|
||||
final PackageSettingBase pkgSetting =
|
||||
(PackageSettingBase) packageManagerInternal.getPackageSetting(pkg.getPackageName());
|
||||
// Allow system apps to redefine non-system permissions
|
||||
boolean ownerChanged = false;
|
||||
if (bp != null && !Objects.equals(bp.sourcePackageName, p.getPackageName())) {
|
||||
final boolean currentOwnerIsSystem;
|
||||
if (bp.perm == null) {
|
||||
@@ -347,6 +359,7 @@ public final class BasePermission {
|
||||
String msg = "New decl " + pkg + " of permission "
|
||||
+ p.getName() + " is system; overriding " + bp.sourcePackageName;
|
||||
PackageManagerService.reportSettingsProblem(Log.WARN, msg);
|
||||
ownerChanged = true;
|
||||
bp = null;
|
||||
}
|
||||
}
|
||||
@@ -354,6 +367,7 @@ public final class BasePermission {
|
||||
if (bp == null) {
|
||||
bp = new BasePermission(p.getName(), p.getPackageName(), TYPE_NORMAL);
|
||||
}
|
||||
boolean wasNonRuntime = !bp.isRuntime();
|
||||
StringBuilder r = null;
|
||||
if (bp.perm == null) {
|
||||
if (bp.sourcePackageName == null
|
||||
@@ -397,6 +411,11 @@ public final class BasePermission {
|
||||
&& Objects.equals(bp.perm.getName(), p.getName())) {
|
||||
bp.protectionLevel = p.getProtectionLevel();
|
||||
}
|
||||
if (bp.isRuntime() && (ownerChanged || wasNonRuntime)) {
|
||||
// If this is a runtime permission and the owner has changed, or this was a normal
|
||||
// permission, then permission state should be cleaned up
|
||||
bp.mPermissionDefinitionChanged = true;
|
||||
}
|
||||
if (PackageManagerService.DEBUG_PACKAGE_SCANNING && r != null) {
|
||||
Log.d(TAG, " Permissions: " + r);
|
||||
}
|
||||
|
||||
@@ -2344,8 +2344,74 @@ public class PermissionManagerService extends IPermissionManager.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
private void addAllPermissions(AndroidPackage pkg, boolean chatty) {
|
||||
/**
|
||||
* If permissions are upgraded to runtime, or their owner changes to the system, then any
|
||||
* granted permissions must be revoked.
|
||||
*
|
||||
* @param permissionsToRevoke A list of permission names to revoke
|
||||
* @param allPackageNames All package names
|
||||
* @param permissionCallback Callback for permission changed
|
||||
*/
|
||||
private void revokeRuntimePermissionsIfPermissionDefinitionChanged(
|
||||
@NonNull List<String> permissionsToRevoke,
|
||||
@NonNull ArrayList<String> allPackageNames,
|
||||
@NonNull PermissionCallback permissionCallback) {
|
||||
|
||||
final int[] userIds = mUserManagerInt.getUserIds();
|
||||
final int numPermissions = permissionsToRevoke.size();
|
||||
final int numUserIds = userIds.length;
|
||||
final int numPackages = allPackageNames.size();
|
||||
final int callingUid = Binder.getCallingUid();
|
||||
|
||||
for (int permNum = 0; permNum < numPermissions; permNum++) {
|
||||
String permName = permissionsToRevoke.get(permNum);
|
||||
BasePermission bp = mSettings.getPermission(permName);
|
||||
if (bp == null || !bp.isRuntime()) {
|
||||
continue;
|
||||
}
|
||||
for (int userIdNum = 0; userIdNum < numUserIds; userIdNum++) {
|
||||
final int userId = userIds[userIdNum];
|
||||
for (int packageNum = 0; packageNum < numPackages; packageNum++) {
|
||||
final String packageName = allPackageNames.get(packageNum);
|
||||
final int uid = mPackageManagerInt.getPackageUid(packageName, 0, userId);
|
||||
if (uid < Process.FIRST_APPLICATION_UID) {
|
||||
// do not revoke from system apps
|
||||
continue;
|
||||
}
|
||||
final int permissionState = checkPermissionImpl(permName, packageName,
|
||||
userId);
|
||||
final int flags = getPermissionFlags(permName, packageName, userId);
|
||||
final int flagMask = FLAG_PERMISSION_SYSTEM_FIXED
|
||||
| FLAG_PERMISSION_POLICY_FIXED
|
||||
| FLAG_PERMISSION_GRANTED_BY_DEFAULT
|
||||
| FLAG_PERMISSION_GRANTED_BY_ROLE;
|
||||
if (permissionState == PackageManager.PERMISSION_GRANTED
|
||||
&& (flags & flagMask) == 0) {
|
||||
EventLog.writeEvent(0x534e4554, "154505240", uid,
|
||||
"Revoking permission " + permName + " from package "
|
||||
+ packageName + " due to definition change");
|
||||
EventLog.writeEvent(0x534e4554, "168319670", uid,
|
||||
"Revoking permission " + permName + " from package "
|
||||
+ packageName + " due to definition change");
|
||||
Slog.e(TAG, "Revoking permission " + permName + " from package "
|
||||
+ packageName + " due to definition change");
|
||||
try {
|
||||
revokeRuntimePermissionInternal(permName, packageName,
|
||||
false, callingUid, userId, null, permissionCallback);
|
||||
} catch (Exception e) {
|
||||
Slog.e(TAG, "Could not revoke " + permName + " from "
|
||||
+ packageName, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
bp.setPermissionDefinitionChanged(false);
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> addAllPermissions(AndroidPackage pkg, boolean chatty) {
|
||||
final int N = ArrayUtils.size(pkg.getPermissions());
|
||||
ArrayList<String> definitionChangedPermissions = new ArrayList<>();
|
||||
for (int i=0; i<N; i++) {
|
||||
ParsedPermission p = pkg.getPermissions().get(i);
|
||||
|
||||
@@ -2367,21 +2433,26 @@ public class PermissionManagerService extends IPermissionManager.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
final BasePermission bp;
|
||||
if (p.isTree()) {
|
||||
final BasePermission bp = BasePermission.createOrUpdate(
|
||||
bp = BasePermission.createOrUpdate(
|
||||
mPackageManagerInt,
|
||||
mSettings.getPermissionTreeLocked(p.getName()), p, pkg,
|
||||
mSettings.getAllPermissionTreesLocked(), chatty);
|
||||
mSettings.putPermissionTreeLocked(p.getName(), bp);
|
||||
} else {
|
||||
final BasePermission bp = BasePermission.createOrUpdate(
|
||||
bp = BasePermission.createOrUpdate(
|
||||
mPackageManagerInt,
|
||||
mSettings.getPermissionLocked(p.getName()),
|
||||
p, pkg, mSettings.getAllPermissionTreesLocked(), chatty);
|
||||
mSettings.putPermissionLocked(p.getName(), bp);
|
||||
}
|
||||
if (bp.isPermissionDefinitionChanged()) {
|
||||
definitionChangedPermissions.add(p.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return definitionChangedPermissions;
|
||||
}
|
||||
|
||||
private void addAllPermissionGroups(AndroidPackage pkg, boolean chatty) {
|
||||
@@ -4672,9 +4743,18 @@ public class PermissionManagerService extends IPermissionManager.Stub {
|
||||
PermissionManagerService.this.revokeRuntimePermissionsIfGroupChanged(newPackage,
|
||||
oldPackage, allPackageNames, mDefaultPermissionCallback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAllPermissions(AndroidPackage pkg, boolean chatty) {
|
||||
PermissionManagerService.this.addAllPermissions(pkg, chatty);
|
||||
public void revokeRuntimePermissionsIfPermissionDefinitionChanged(
|
||||
@NonNull List<String> permissionsToRevoke,
|
||||
@NonNull ArrayList<String> allPackageNames) {
|
||||
PermissionManagerService.this.revokeRuntimePermissionsIfPermissionDefinitionChanged(
|
||||
permissionsToRevoke, allPackageNames, mDefaultPermissionCallback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> addAllPermissions(AndroidPackage pkg, boolean chatty) {
|
||||
return PermissionManagerService.this.addAllPermissions(pkg, chatty);
|
||||
}
|
||||
@Override
|
||||
public void addAllPermissionGroups(AndroidPackage pkg, boolean chatty) {
|
||||
|
||||
@@ -253,13 +253,27 @@ public abstract class PermissionManagerServiceInternal extends PermissionManager
|
||||
@NonNull AndroidPackage oldPackage,
|
||||
@NonNull ArrayList<String> allPackageNames);
|
||||
|
||||
/**
|
||||
* Some permissions might have been owned by a non-system package, and the system then defined
|
||||
* said permission. Some other permissions may one have been install permissions, but are now
|
||||
* runtime or higher. These permissions should be revoked.
|
||||
*
|
||||
* @param permissionsToRevoke A list of permission names to revoke
|
||||
* @param allPackageNames All packages
|
||||
*/
|
||||
public abstract void revokeRuntimePermissionsIfPermissionDefinitionChanged(
|
||||
@NonNull List<String> permissionsToRevoke,
|
||||
@NonNull ArrayList<String> allPackageNames);
|
||||
|
||||
/**
|
||||
* Add all permissions in the given package.
|
||||
* <p>
|
||||
* NOTE: argument {@code groupTEMP} is temporary until mPermissionGroups is moved to
|
||||
* the permission settings.
|
||||
*
|
||||
* @return A list of BasePermissions that were updated, and need to be revoked from packages
|
||||
*/
|
||||
public abstract void addAllPermissions(@NonNull AndroidPackage pkg, boolean chatty);
|
||||
public abstract List<String> addAllPermissions(@NonNull AndroidPackage pkg, boolean chatty);
|
||||
public abstract void addAllPermissionGroups(@NonNull AndroidPackage pkg, boolean chatty);
|
||||
public abstract void removeAllPermissions(@NonNull AndroidPackage pkg, boolean chatty);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user