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

Commit 966045d0 authored by Selim Cinek's avatar Selim Cinek Committed by Ian Pedowitz
Browse files

DO NOT MERGE Revert "Add Brightness setting for VR Mode."

This reverts commit 84980c7a.

Bug: 33895226
Bug: 30984614
Change-Id: I2652e77512bc870190e2172a629abac9341b2c4f
parent 84980c7a
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -167,8 +167,6 @@ public abstract class DisplayManagerInternal {
        public static final int POLICY_DIM = 2;
        // Policy: Make the screen bright as usual.
        public static final int POLICY_BRIGHT = 3;
        // Policy: Keep the screen and display optimized for VR mode.
        public static final int POLICY_VR = 4;

        // The basic overall policy to apply: off, doze, dim or bright.
        public int policy;
@@ -235,10 +233,6 @@ public abstract class DisplayManagerInternal {
            return policy == POLICY_BRIGHT || policy == POLICY_DIM;
        }

        public boolean isVr() {
            return policy == POLICY_VR;
        }

        public void copyFrom(DisplayPowerRequest other) {
            policy = other.policy;
            useProximitySensor = other.useProximitySensor;
@@ -307,8 +301,6 @@ public abstract class DisplayManagerInternal {
                    return "DIM";
                case POLICY_BRIGHT:
                    return "BRIGHT";
                case POLICY_VR:
                    return "VR";
                default:
                    return Integer.toString(policy);
            }
+11 −40
Original line number Diff line number Diff line
@@ -472,35 +472,6 @@ public final class PowerManager {
                com.android.internal.R.integer.config_screenBrightnessSettingDefault);
    }

    /**
     * Gets the minimum supported screen brightness setting for VR Mode.
     * @hide
     */
    public int getMinimumScreenBrightnessForVrSetting() {
        return mContext.getResources().getInteger(
                com.android.internal.R.integer.config_screenBrightnessForVrSettingMinimum);
    }

    /**
     * Gets the maximum supported screen brightness setting for VR Mode.
     * The screen may be allowed to become dimmer than this value but
     * this is the maximum value that can be set by the user.
     * @hide
     */
    public int getMaximumScreenBrightnessForVrSetting() {
        return mContext.getResources().getInteger(
                com.android.internal.R.integer.config_screenBrightnessForVrSettingMaximum);
    }

    /**
     * Gets the default screen brightness for VR setting.
     * @hide
     */
    public int getDefaultScreenBrightnessForVrSetting() {
        return mContext.getResources().getInteger(
                com.android.internal.R.integer.config_screenBrightnessForVrSettingDefault);
    }

    /**
     * Returns true if the twilight service should be used to adjust screen brightness
     * policy.  This setting is experimental and disabled by default.
+0 −10
Original line number Diff line number Diff line
@@ -2756,15 +2756,6 @@ public final class Settings {
        private static final Validator SCREEN_BRIGHTNESS_VALIDATOR =
                new InclusiveIntegerRangeValidator(0, 255);

        /**
         * The screen backlight brightness between 0 and 255.
         * @hide
         */
        public static final String SCREEN_BRIGHTNESS_FOR_VR = "screen_brightness_for_vr";

        private static final Validator SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR =
                new InclusiveIntegerRangeValidator(0, 255);

        /**
         * Control whether to enable automatic brightness mode.
         */
@@ -3759,7 +3750,6 @@ public final class Settings {
            VALIDATORS.put(DIM_SCREEN, DIM_SCREEN_VALIDATOR);
            VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
            VALIDATORS.put(SCREEN_BRIGHTNESS, SCREEN_BRIGHTNESS_VALIDATOR);
            VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR);
            VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
            VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
            VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
+1 −13
Original line number Diff line number Diff line
@@ -284,15 +284,6 @@ public final class Display {
     */
    public static final int STATE_DOZE_SUSPEND = 4;

    /**
     * Display state: The display is on and optimized for VR mode.
     *
     * @see #getState
     * @see android.os.PowerManager#isInteractive
     * @hide
     */
    public static final int STATE_VR = 5;

    /* The color mode constants defined below must be kept in sync with the ones in
     * system/graphics.h */

@@ -877,8 +868,7 @@ public final class Display {
     * Gets the state of the display, such as whether it is on or off.
     *
     * @return The state of the display: one of {@link #STATE_OFF}, {@link #STATE_ON},
     * {@link #STATE_DOZE}, {@link #STATE_DOZE_SUSPEND}, or
     * {@link #STATE_UNKNOWN}.
     * {@link #STATE_DOZE}, {@link #STATE_DOZE_SUSPEND}, or {@link #STATE_UNKNOWN}.
     */
    public int getState() {
        synchronized (this) {
@@ -994,8 +984,6 @@ public final class Display {
                return "DOZE";
            case STATE_DOZE_SUSPEND:
                return "DOZE_SUSPEND";
            case STATE_VR:
                return "VR";
            default:
                return Integer.toString(state);
        }
+0 −10
Original line number Diff line number Diff line
@@ -1043,16 +1043,6 @@
         Must be in the range specified by minimum and maximum. -->
    <integer name="config_screenBrightnessSettingDefault">102</integer>

    <!-- Default screen brightness for VR setting. -->
    <integer name="config_screenBrightnessForVrSettingDefault">86</integer>

    <!-- Minimum screen brightness setting allowed for VR. Device panels start increasing pulse
         width as brightness decreases below this theshold. -->
    <integer name="config_screenBrightnessForVrSettingMinimum">79</integer>

    <!-- Maximum screen brightness setting allowed for VR. -->
    <integer name="config_screenBrightnessForVrSettingMaximum">255</integer>

    <!-- Screen brightness used to dim the screen while dozing in a very low power state.
         May be less than the minimum allowed brightness setting
         that can be set by the user. -->
Loading