Merge "Add a source parameter for resrictions logging" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
5953a3386c
@@ -559,7 +559,8 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
|
|||||||
if (android.app.Flags.appRestrictionsApi()) {
|
if (android.app.Flags.appRestrictionsApi()) {
|
||||||
am.noteAppRestrictionEnabled(pkgName, mAppEntry.info.uid,
|
am.noteAppRestrictionEnabled(pkgName, mAppEntry.info.uid,
|
||||||
ActivityManager.RESTRICTION_LEVEL_FORCE_STOPPED, true,
|
ActivityManager.RESTRICTION_LEVEL_FORCE_STOPPED, true,
|
||||||
ActivityManager.RESTRICTION_REASON_USER, "settings", 0L);
|
ActivityManager.RESTRICTION_REASON_USER,
|
||||||
|
"settings", ActivityManager.RESTRICTION_SOURCE_USER, 0L);
|
||||||
}
|
}
|
||||||
am.forceStopPackage(pkgName);
|
am.forceStopPackage(pkgName);
|
||||||
int userId = UserHandle.getUserId(mAppEntry.info.uid);
|
int userId = UserHandle.getUserId(mAppEntry.info.uid);
|
||||||
|
@@ -393,7 +393,7 @@ public class BatteryUtils {
|
|||||||
packageName, uid, ActivityManager.RESTRICTION_LEVEL_BACKGROUND_RESTRICTED,
|
packageName, uid, ActivityManager.RESTRICTION_LEVEL_BACKGROUND_RESTRICTED,
|
||||||
mode == AppOpsManager.MODE_IGNORED,
|
mode == AppOpsManager.MODE_IGNORED,
|
||||||
ActivityManager.RESTRICTION_REASON_USER,
|
ActivityManager.RESTRICTION_REASON_USER,
|
||||||
"settings", 0);
|
"settings", ActivityManager.RESTRICTION_SOURCE_USER, 0L);
|
||||||
}
|
}
|
||||||
// Control whether app could run jobs in the background
|
// Control whether app could run jobs in the background
|
||||||
mAppOpsManager.setMode(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, uid, packageName, mode);
|
mAppOpsManager.setMode(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, uid, packageName, mode);
|
||||||
|
@@ -160,7 +160,8 @@ class PackageInfoPresenter(
|
|||||||
context.activityManager.noteAppRestrictionEnabled(
|
context.activityManager.noteAppRestrictionEnabled(
|
||||||
packageName, uid,
|
packageName, uid,
|
||||||
ActivityManager.RESTRICTION_LEVEL_FORCE_STOPPED, true,
|
ActivityManager.RESTRICTION_LEVEL_FORCE_STOPPED, true,
|
||||||
ActivityManager.RESTRICTION_REASON_USER, "settings", 0)
|
ActivityManager.RESTRICTION_REASON_USER, "settings",
|
||||||
|
ActivityManager.RESTRICTION_SOURCE_USER, 0)
|
||||||
}
|
}
|
||||||
context.activityManager.forceStopPackageAsUser(packageName, userId)
|
context.activityManager.forceStopPackageAsUser(packageName, userId)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user