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

Commit 55e204f1 authored by Vladimir Komsiyski's avatar Vladimir Komsiyski Committed by Android (Google) Code Review
Browse files

Merge "Remove VDM flag display_power_manager_apis" into main

parents e30d9ffa da35e8cb
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -65,14 +65,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
@@ -1464,13 +1464,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.
@@ -1928,11 +1923,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();
        }
@@ -1995,11 +1986,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
@@ -6432,8 +6432,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
@@ -1542,9 +1542,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;