Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 062b1514 authored by Chris Tate's avatar Chris Tate Committed by Android (Google) Code Review
Browse files

Merge "Whitelist package verifiers for bg operation" into rvc-dev

parents d43e376c bccdd48e
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -18284,12 +18284,16 @@ public class ActivityManagerService extends IActivityManager.Stub
            }
        }
        // Now safely dispatch changes to device idle controller.
        // 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.
        synchronized(this) {
+4 −0
Original line number Diff line number Diff line
@@ -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());
    }

+12 −1
Original line number Diff line number Diff line
@@ -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) {