Merge "Whitelist package verifiers for bg operation" into rvc-dev am: 062b151415
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11854551 Change-Id: Iba909192d46e511645edef4102d7242993a8e605
This commit is contained in:
@@ -18284,11 +18284,15 @@ public class ActivityManagerService extends IActivityManager.Stub
|
||||
}
|
||||
}
|
||||
|
||||
// Now safely dispatch changes to device idle controller.
|
||||
for (int i = 0; i < N; i++) {
|
||||
PendingTempWhitelist ptw = list[i];
|
||||
mLocalDeviceIdleController.addPowerSaveTempWhitelistAppDirect(ptw.targetUid,
|
||||
ptw.duration, true, ptw.tag);
|
||||
// Now safely dispatch changes to device idle controller. Skip this if we're early
|
||||
// in boot and the controller hasn't yet been brought online: we do not apply
|
||||
// device idle policy anyway at this phase.
|
||||
if (mLocalDeviceIdleController != null) {
|
||||
for (int i = 0; i < N; i++) {
|
||||
PendingTempWhitelist ptw = list[i];
|
||||
mLocalDeviceIdleController.addPowerSaveTempWhitelistAppDirect(ptw.targetUid,
|
||||
ptw.duration, true, ptw.tag);
|
||||
}
|
||||
}
|
||||
|
||||
// And now we can safely remove them from the map.
|
||||
|
||||
@@ -904,6 +904,10 @@ public final class BroadcastQueue {
|
||||
} else if (r.intent.getData() != null) {
|
||||
b.append(r.intent.getData());
|
||||
}
|
||||
if (DEBUG_BROADCAST) {
|
||||
Slog.v(TAG, "Broadcast temp whitelist uid=" + uid + " duration=" + duration
|
||||
+ " : " + b.toString());
|
||||
}
|
||||
mService.tempWhitelistUidLocked(uid, duration, b.toString());
|
||||
}
|
||||
|
||||
|
||||
@@ -15173,8 +15173,13 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
idleController.addPowerSaveTempWhitelistAppDirect(Process.myUid(),
|
||||
idleDuration,
|
||||
false, "integrity component");
|
||||
final BroadcastOptions options = BroadcastOptions.makeBasic();
|
||||
options.setTemporaryAppWhitelistDuration(idleDuration);
|
||||
|
||||
mContext.sendOrderedBroadcastAsUser(integrityVerification, UserHandle.SYSTEM,
|
||||
/* receiverPermission= */ null,
|
||||
/* appOp= */ AppOpsManager.OP_NONE,
|
||||
/* options= */ options.toBundle(),
|
||||
new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
@@ -15274,6 +15279,8 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
DeviceIdleInternal idleController =
|
||||
mInjector.getLocalDeviceIdleController();
|
||||
final long idleDuration = getVerificationTimeout();
|
||||
final BroadcastOptions options = BroadcastOptions.makeBasic();
|
||||
options.setTemporaryAppWhitelistDuration(idleDuration);
|
||||
|
||||
/*
|
||||
* If any sufficient verifiers were listed in the package
|
||||
@@ -15293,7 +15300,9 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
|
||||
final Intent sufficientIntent = new Intent(verification);
|
||||
sufficientIntent.setComponent(verifierComponent);
|
||||
mContext.sendBroadcastAsUser(sufficientIntent, verifierUser);
|
||||
mContext.sendBroadcastAsUser(sufficientIntent, verifierUser,
|
||||
/* receiverPermission= */ null,
|
||||
options.toBundle());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15312,6 +15321,8 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
verifierUser.getIdentifier(), false, "package verifier");
|
||||
mContext.sendOrderedBroadcastAsUser(verification, verifierUser,
|
||||
android.Manifest.permission.PACKAGE_VERIFICATION_AGENT,
|
||||
/* appOp= */ AppOpsManager.OP_NONE,
|
||||
/* options= */ options.toBundle(),
|
||||
new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
||||
Reference in New Issue
Block a user