Loading core/res/res/values/config.xml +6 −0 Original line number Diff line number Diff line Loading @@ -7237,4 +7237,10 @@ <!-- The name of the system package that will hold the dependency installer role. --> <string name="config_systemDependencyInstaller" translatable="false" /> <!-- Whether allow normal brightness when doze policy can be requested. When this is false, brightness follows the display state i.e. ON means bright, DOZE means dim. If true, POLICY_DOZE can also dim the screen unless parameter useNormalBrightnessForDoze of DreamService#setDozeScreenState requests an exception. --> <bool name="config_allowNormalBrightnessForDozePolicy">false</bool> </resources> core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -5799,4 +5799,6 @@ <!-- Style for Wear Material3 Button. Will only be used for sdk 36 or above. --> <java-symbol type="style" name="Widget.DeviceDefault.Button.WearMaterial3" /> <java-symbol type="bool" name="config_allowNormalBrightnessForDozePolicy" /> </resources> services/core/java/com/android/server/display/AutomaticBrightnessController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1280,7 +1280,7 @@ public class AutomaticBrightnessController { private boolean shouldApplyDozeScaleFactor() { // We don't apply the doze scale factor if we have a designated brightness curve for doze. return (mDisplayManagerFlags.isNormalBrightnessForDozeParameterEnabled() return (mDisplayManagerFlags.isNormalBrightnessForDozeParameterEnabled(mContext) ? (!mUseNormalBrightnessForDoze && mDisplayPolicy == POLICY_DOZE) || Display.isDozeState(mDisplayState) : Display.isDozeState(mDisplayState)) && getMode() != AUTO_BRIGHTNESS_MODE_DOZE; Loading services/core/java/com/android/server/display/DisplayPowerController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1399,7 +1399,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call // Use doze brightness if one of following is true: // 1. The target `state` isDozeState. // 2. Doze power request(POLICY_DOZE) if there's no exception(useNormalBrightnessForDoze). final boolean useDozeBrightness = mFlags.isNormalBrightnessForDozeParameterEnabled() final boolean useDozeBrightness = mFlags.isNormalBrightnessForDozeParameterEnabled(mContext) ? (!mPowerRequest.useNormalBrightnessForDoze && mPowerRequest.policy == POLICY_DOZE) || Display.isDozeState(state) : Display.isDozeState(state); DisplayBrightnessState displayBrightnessState = Loading services/core/java/com/android/server/display/brightness/DisplayBrightnessStrategySelector.java +4 −1 Original line number Diff line number Diff line Loading @@ -109,6 +109,8 @@ public class DisplayBrightnessStrategySelector { private final int mDisplayId; private final Context mContext; /** * The constructor of DozeBrightnessStrategy. */ Loading @@ -117,6 +119,7 @@ public class DisplayBrightnessStrategySelector { if (injector == null) { injector = new Injector(); } mContext = context; mDisplayManagerFlags = flags; mDisplayId = displayId; mDozeBrightnessStrategy = injector.getDozeBrightnessStrategy(); Loading Loading @@ -348,7 +351,7 @@ public class DisplayBrightnessStrategySelector { // a user can define a different display state(displayPowerRequest.dozeScreenState) too // in the request with the Doze policy and user might request an override to force certain // brightness. return (!mDisplayManagerFlags.isNormalBrightnessForDozeParameterEnabled() return (!mDisplayManagerFlags.isNormalBrightnessForDozeParameterEnabled(mContext) || !displayPowerRequest.useNormalBrightnessForDoze) && displayPowerRequest.policy == DisplayPowerRequest.POLICY_DOZE && !mAllowAutoBrightnessWhileDozing Loading Loading
core/res/res/values/config.xml +6 −0 Original line number Diff line number Diff line Loading @@ -7237,4 +7237,10 @@ <!-- The name of the system package that will hold the dependency installer role. --> <string name="config_systemDependencyInstaller" translatable="false" /> <!-- Whether allow normal brightness when doze policy can be requested. When this is false, brightness follows the display state i.e. ON means bright, DOZE means dim. If true, POLICY_DOZE can also dim the screen unless parameter useNormalBrightnessForDoze of DreamService#setDozeScreenState requests an exception. --> <bool name="config_allowNormalBrightnessForDozePolicy">false</bool> </resources>
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -5799,4 +5799,6 @@ <!-- Style for Wear Material3 Button. Will only be used for sdk 36 or above. --> <java-symbol type="style" name="Widget.DeviceDefault.Button.WearMaterial3" /> <java-symbol type="bool" name="config_allowNormalBrightnessForDozePolicy" /> </resources>
services/core/java/com/android/server/display/AutomaticBrightnessController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1280,7 +1280,7 @@ public class AutomaticBrightnessController { private boolean shouldApplyDozeScaleFactor() { // We don't apply the doze scale factor if we have a designated brightness curve for doze. return (mDisplayManagerFlags.isNormalBrightnessForDozeParameterEnabled() return (mDisplayManagerFlags.isNormalBrightnessForDozeParameterEnabled(mContext) ? (!mUseNormalBrightnessForDoze && mDisplayPolicy == POLICY_DOZE) || Display.isDozeState(mDisplayState) : Display.isDozeState(mDisplayState)) && getMode() != AUTO_BRIGHTNESS_MODE_DOZE; Loading
services/core/java/com/android/server/display/DisplayPowerController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1399,7 +1399,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call // Use doze brightness if one of following is true: // 1. The target `state` isDozeState. // 2. Doze power request(POLICY_DOZE) if there's no exception(useNormalBrightnessForDoze). final boolean useDozeBrightness = mFlags.isNormalBrightnessForDozeParameterEnabled() final boolean useDozeBrightness = mFlags.isNormalBrightnessForDozeParameterEnabled(mContext) ? (!mPowerRequest.useNormalBrightnessForDoze && mPowerRequest.policy == POLICY_DOZE) || Display.isDozeState(state) : Display.isDozeState(state); DisplayBrightnessState displayBrightnessState = Loading
services/core/java/com/android/server/display/brightness/DisplayBrightnessStrategySelector.java +4 −1 Original line number Diff line number Diff line Loading @@ -109,6 +109,8 @@ public class DisplayBrightnessStrategySelector { private final int mDisplayId; private final Context mContext; /** * The constructor of DozeBrightnessStrategy. */ Loading @@ -117,6 +119,7 @@ public class DisplayBrightnessStrategySelector { if (injector == null) { injector = new Injector(); } mContext = context; mDisplayManagerFlags = flags; mDisplayId = displayId; mDozeBrightnessStrategy = injector.getDozeBrightnessStrategy(); Loading Loading @@ -348,7 +351,7 @@ public class DisplayBrightnessStrategySelector { // a user can define a different display state(displayPowerRequest.dozeScreenState) too // in the request with the Doze policy and user might request an override to force certain // brightness. return (!mDisplayManagerFlags.isNormalBrightnessForDozeParameterEnabled() return (!mDisplayManagerFlags.isNormalBrightnessForDozeParameterEnabled(mContext) || !displayPowerRequest.useNormalBrightnessForDoze) && displayPowerRequest.policy == DisplayPowerRequest.POLICY_DOZE && !mAllowAutoBrightnessWhileDozing Loading