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

Commit 4bdb79bc authored by Kenneth Ford's avatar Kenneth Ford Committed by Android (Google) Code Review
Browse files

Merge "Update cancel device state request to require foreground for cts compat" into main

parents e8f9fd63 5d272d0a
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -1002,9 +1002,9 @@ public final class DeviceStateManagerService extends SystemService {


    /**
    /**
     * Checks if the process can cancel a device state request. If the calling process ID is not
     * Checks if the process can cancel a device state request. If the calling process ID is not
     * both the top app and foregrounded nor does the process ID and userID match the IDs that made
     * both the top app and foregrounded, verify that the calling process is in the foreground and
     * the device state request, then check if this process holds the CONTROL_DEVICE_STATE
     * that it matches the process ID and user ID that made the device state request. If neither are
     * permission.
     * true, then check if this process holds the CONTROL_DEVICE_STATE permission.
     *
     *
     * @param callingPid Process ID that is requesting this state change
     * @param callingPid Process ID that is requesting this state change
     * @param callingUid UID that is requesting this state change
     * @param callingUid UID that is requesting this state change
@@ -1018,8 +1018,8 @@ public final class DeviceStateManagerService extends SystemService {
        if (Flags.deviceStateRequesterCancelState()) {
        if (Flags.deviceStateRequesterCancelState()) {
            synchronized (mLock) {
            synchronized (mLock) {
                isAllowedToControlState =
                isAllowedToControlState =
                        isAllowedToControlState || doCallingIdsMatchOverrideRequestIdsLocked(
                        isTopApp || (isForegroundApp && doCallingIdsMatchOverrideRequestIdsLocked(
                                callingPid, callingUid);
                                callingPid, callingUid));
            }
            }
        }
        }