Loading core/java/android/hardware/display/DisplayManagerInternal.java +8 −2 Original line number Diff line number Diff line Loading @@ -211,6 +211,9 @@ public abstract class DisplayManagerInternal { public int dozeScreenBrightness; public int dozeScreenState; // If true, use twilight to affect the brightness. public boolean useTwilight; public DisplayPowerRequest() { policy = POLICY_BRIGHT; useProximitySensor = false; Loading Loading @@ -242,6 +245,7 @@ public abstract class DisplayManagerInternal { boostScreenBrightness = other.boostScreenBrightness; dozeScreenBrightness = other.dozeScreenBrightness; dozeScreenState = other.dozeScreenState; useTwilight = other.useTwilight; } @Override Loading @@ -262,7 +266,8 @@ public abstract class DisplayManagerInternal { && lowPowerMode == other.lowPowerMode && boostScreenBrightness == other.boostScreenBrightness && dozeScreenBrightness == other.dozeScreenBrightness && dozeScreenState == other.dozeScreenState; && dozeScreenState == other.dozeScreenState && useTwilight == other.useTwilight; } @Override Loading @@ -282,7 +287,8 @@ public abstract class DisplayManagerInternal { + ", lowPowerMode=" + lowPowerMode + ", boostScreenBrightness=" + boostScreenBrightness + ", dozeScreenBrightness=" + dozeScreenBrightness + ", dozeScreenState=" + Display.stateToString(dozeScreenState); + ", dozeScreenState=" + Display.stateToString(dozeScreenState) + ", useTwilight=" + useTwilight; } public static String policyToString(int policy) { Loading core/java/android/provider/Settings.java +46 −0 Original line number Diff line number Diff line Loading @@ -5923,6 +5923,52 @@ public final class Settings { public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED = "camera_double_tap_power_gesture_disabled"; /** /** * Behavior of twilight on the device. * One of {@link #TWILIGHT_MODE_LOCKED_OFF}, {@link #TWILIGHT_MODE_LOCKED_ON} * or {@link #TWILIGHT_MODE_AUTO}. * @hide */ public static final String TWILIGHT_MODE = "twilight_mode"; /** * Twilight mode always off. * @hide */ public static final int TWILIGHT_MODE_LOCKED_OFF = 0; /** * Twilight mode always on. * @hide */ public static final int TWILIGHT_MODE_LOCKED_ON = 1; /** * Twilight mode auto. * @hide */ public static final int TWILIGHT_MODE_AUTO = 2; /** * Twilight mode auto, temporarily overriden to on. * @hide */ public static final int TWILIGHT_MODE_AUTO_OVERRIDE_OFF = 3; /** * Twilight mode auto, temporarily overriden to off. * @hide */ public static final int TWILIGHT_MODE_AUTO_OVERRIDE_ON = 4; /** * Whether brightness should automatically adjust based on twilight state. * @hide */ public static final String BRIGHTNESS_USE_TWILIGHT = "brightness_use_twilight"; /** * This are the settings to be backed up. * Loading core/res/AndroidManifest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -452,6 +452,8 @@ <protected-broadcast android:name="android.bluetooth.input.profile.action.HANDSHAKE" /> <protected-broadcast android:name="android.bluetooth.input.profile.action.REPORT" /> <protected-broadcast android:name="android.intent.action.TWILIGHT_CHANGED" /> <!-- ====================================================================== --> <!-- RUNTIME PERMISSIONS --> <!-- ====================================================================== --> Loading packages/SystemUI/res/drawable/ic_colorize.xml→packages/SystemUI/res/drawable/ic_night_mode.xml +1 −1 Original line number Diff line number Diff line <!-- Copyright (C) 2015 The Android Open Source Project Copyright (C) 2016 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. Loading packages/SystemUI/res/drawable/ic_night_mode_disabled.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <!-- Copyright (C) 2016 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24.0dp" android:height="24.0dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:fillColor="#4DFFFFFF" android:pathData="M20.71,5.63l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0.0l-3.12,3.12 -1.93,-1.91 -1.41,1.41 1.42,1.42L3.0,16.25L3.0,21.0l4.75,0.0l8.92,-8.92 1.42,1.42 1.41,-1.41 -1.92,-1.92 3.12,-3.12c0.4,0.0 0.4,-1.0 0.01,-1.42zM6.92,19.0L5.0,17.08l8.06,-8.06 1.92,1.92L6.92,19.0z"/> </vector> Loading
core/java/android/hardware/display/DisplayManagerInternal.java +8 −2 Original line number Diff line number Diff line Loading @@ -211,6 +211,9 @@ public abstract class DisplayManagerInternal { public int dozeScreenBrightness; public int dozeScreenState; // If true, use twilight to affect the brightness. public boolean useTwilight; public DisplayPowerRequest() { policy = POLICY_BRIGHT; useProximitySensor = false; Loading Loading @@ -242,6 +245,7 @@ public abstract class DisplayManagerInternal { boostScreenBrightness = other.boostScreenBrightness; dozeScreenBrightness = other.dozeScreenBrightness; dozeScreenState = other.dozeScreenState; useTwilight = other.useTwilight; } @Override Loading @@ -262,7 +266,8 @@ public abstract class DisplayManagerInternal { && lowPowerMode == other.lowPowerMode && boostScreenBrightness == other.boostScreenBrightness && dozeScreenBrightness == other.dozeScreenBrightness && dozeScreenState == other.dozeScreenState; && dozeScreenState == other.dozeScreenState && useTwilight == other.useTwilight; } @Override Loading @@ -282,7 +287,8 @@ public abstract class DisplayManagerInternal { + ", lowPowerMode=" + lowPowerMode + ", boostScreenBrightness=" + boostScreenBrightness + ", dozeScreenBrightness=" + dozeScreenBrightness + ", dozeScreenState=" + Display.stateToString(dozeScreenState); + ", dozeScreenState=" + Display.stateToString(dozeScreenState) + ", useTwilight=" + useTwilight; } public static String policyToString(int policy) { Loading
core/java/android/provider/Settings.java +46 −0 Original line number Diff line number Diff line Loading @@ -5923,6 +5923,52 @@ public final class Settings { public static final String CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED = "camera_double_tap_power_gesture_disabled"; /** /** * Behavior of twilight on the device. * One of {@link #TWILIGHT_MODE_LOCKED_OFF}, {@link #TWILIGHT_MODE_LOCKED_ON} * or {@link #TWILIGHT_MODE_AUTO}. * @hide */ public static final String TWILIGHT_MODE = "twilight_mode"; /** * Twilight mode always off. * @hide */ public static final int TWILIGHT_MODE_LOCKED_OFF = 0; /** * Twilight mode always on. * @hide */ public static final int TWILIGHT_MODE_LOCKED_ON = 1; /** * Twilight mode auto. * @hide */ public static final int TWILIGHT_MODE_AUTO = 2; /** * Twilight mode auto, temporarily overriden to on. * @hide */ public static final int TWILIGHT_MODE_AUTO_OVERRIDE_OFF = 3; /** * Twilight mode auto, temporarily overriden to off. * @hide */ public static final int TWILIGHT_MODE_AUTO_OVERRIDE_ON = 4; /** * Whether brightness should automatically adjust based on twilight state. * @hide */ public static final String BRIGHTNESS_USE_TWILIGHT = "brightness_use_twilight"; /** * This are the settings to be backed up. * Loading
core/res/AndroidManifest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -452,6 +452,8 @@ <protected-broadcast android:name="android.bluetooth.input.profile.action.HANDSHAKE" /> <protected-broadcast android:name="android.bluetooth.input.profile.action.REPORT" /> <protected-broadcast android:name="android.intent.action.TWILIGHT_CHANGED" /> <!-- ====================================================================== --> <!-- RUNTIME PERMISSIONS --> <!-- ====================================================================== --> Loading
packages/SystemUI/res/drawable/ic_colorize.xml→packages/SystemUI/res/drawable/ic_night_mode.xml +1 −1 Original line number Diff line number Diff line <!-- Copyright (C) 2015 The Android Open Source Project Copyright (C) 2016 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. Loading
packages/SystemUI/res/drawable/ic_night_mode_disabled.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <!-- Copyright (C) 2016 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24.0dp" android:height="24.0dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:fillColor="#4DFFFFFF" android:pathData="M20.71,5.63l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0.0l-3.12,3.12 -1.93,-1.91 -1.41,1.41 1.42,1.42L3.0,16.25L3.0,21.0l4.75,0.0l8.92,-8.92 1.42,1.42 1.41,-1.41 -1.92,-1.92 3.12,-3.12c0.4,0.0 0.4,-1.0 0.01,-1.42zM6.92,19.0L5.0,17.08l8.06,-8.06 1.92,1.92L6.92,19.0z"/> </vector>