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

Commit da35e8cb authored by [D's avatar [D[1;5D
Browse files

Remove VDM flag display_power_manager_apis

Fix: 423947720
Test: presubmit
Flag: EXEMPT cleanup
Change-Id: I0cb33a35b63bbef093f81fc99a5e68096c736817
parent b606b4ce
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -72,14 +72,6 @@ flag {
    is_exported: true
}

flag {
    namespace: "virtual_devices"
    name: "display_power_manager_apis"
    description: "Make relevant PowerManager APIs display aware by default"
    bug: "365042486"
    is_fixed_read_only: true
}

flag {
    name: "status_bar_and_insets"
    namespace: "virtual_devices"
+3 −15
Original line number Diff line number Diff line
@@ -1455,13 +1455,8 @@ public final class PowerManager {
     * @see #ON_AFTER_RELEASE
     */
    public WakeLock newWakeLock(int levelAndFlags, String tag) {
        if (android.companion.virtualdevice.flags.Flags.displayPowerManagerApis()) {
        return newWakeLock(levelAndFlags, tag, mContext.getDisplayId());
    }
        validateWakeLockParameters(levelAndFlags, tag);
        return new WakeLock(levelAndFlags, tag, mContext.getOpPackageName(),
                Display.INVALID_DISPLAY);
    }

    /**
     * Creates a new wake lock with the specified level and flags.
@@ -1919,11 +1914,7 @@ public final class PowerManager {
     */
    public boolean isWakeLockLevelSupported(int level) {
        try {
            if (android.companion.virtualdevice.flags.Flags.displayPowerManagerApis()) {
                return mService.isWakeLockLevelSupportedWithDisplayId(
                        level, mContext.getDisplayId());
            }
            return mService.isWakeLockLevelSupported(level);
            return mService.isWakeLockLevelSupportedWithDisplayId(level, mContext.getDisplayId());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -1986,11 +1977,8 @@ public final class PowerManager {
     * @see android.content.Intent#ACTION_SCREEN_OFF
     */
    public boolean isInteractive() {
        if (android.companion.virtualdevice.flags.Flags.displayPowerManagerApis()) {
        return isInteractive(mContext.getDisplayId());
    }
        return mInteractiveCache.query(null);
    }

    /**
     * Returns true if the specified display is in an interactive state. This may not be the
+1 −2
Original line number Diff line number Diff line
@@ -6375,8 +6375,7 @@ public final class PowerManagerService extends SystemService
        public float getBrightnessConstraint(
                int displayId, @PowerManager.BrightnessConstraint int constraint) {
            DisplayInfo info = null;
            if (android.companion.virtualdevice.flags.Flags.displayPowerManagerApis()
                    && mDisplayManagerInternal != null) {
            if (mDisplayManagerInternal != null) {
                info = mDisplayManagerInternal.getDisplayInfo(displayId);
            }
            switch (constraint) {
+1 −3
Original line number Diff line number Diff line
@@ -1401,9 +1401,7 @@ public class PowerManagerServiceTest {
                .isEqualTo(expectedNonDefaultGroupWakefullness);
    }

    @EnableFlags({
            android.companion.virtualdevice.flags.Flags.FLAG_DEVICE_AWARE_DISPLAY_POWER,
            android.companion.virtualdevice.flags.Flags.FLAG_DISPLAY_POWER_MANAGER_APIS})
    @EnableFlags(android.companion.virtualdevice.flags.Flags.FLAG_DEVICE_AWARE_DISPLAY_POWER)
    @Test
    public void getBrightnessConstraint_valuesMatchDisplayInfo() {
        final int displayId = 7;