Loading core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -6092,4 +6092,8 @@ <!-- Whether to show weather on the lock screen by default. --> <bool name="config_lockscreenWeatherEnabledByDefault">false</bool> <!-- Whether we should persist the brightness value in nits for the default display even if the underlying display device changes. --> <bool name="config_persistBrightnessNitsForDefaultDisplay">false</bool> </resources> core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2282,6 +2282,7 @@ <java-symbol type="bool" name="config_preventImeStartupUnlessTextEditor" /> <java-symbol type="array" name="config_nonPreemptibleInputMethods" /> <java-symbol type="bool" name="config_enhancedConfirmationModeEnabled" /> <java-symbol type="bool" name="config_persistBrightnessNitsForDefaultDisplay" /> <java-symbol type="layout" name="resolver_list" /> <java-symbol type="id" name="resolver_list" /> Loading services/core/java/com/android/server/display/AutomaticBrightnessController.java +8 −0 Original line number Diff line number Diff line Loading @@ -1127,6 +1127,14 @@ class AutomaticBrightnessController { } } public float convertToFloatScale(float nits) { if (mCurrentBrightnessMapper != null) { return mCurrentBrightnessMapper.convertToFloatScale(nits); } else { return PowerManager.BRIGHTNESS_INVALID_FLOAT; } } public void recalculateSplines(boolean applyAdjustment, float[] adjustment) { mCurrentBrightnessMapper.recalculateSplines(applyAdjustment, adjustment); Loading services/core/java/com/android/server/display/BrightnessMappingStrategy.java +18 −0 Original line number Diff line number Diff line Loading @@ -321,6 +321,14 @@ public abstract class BrightnessMappingStrategy { */ public abstract float convertToNits(float brightness); /** * Converts the provided nit value to a float scale value if possible. * * Returns {@link PowerManager.BRIGHTNESS_INVALID_FLOAT} if there's no available mapping for * the nits to float scale. */ public abstract float convertToFloatScale(float nits); /** * Adds a user interaction data point to the brightness mapping. * Loading Loading @@ -670,6 +678,11 @@ public abstract class BrightnessMappingStrategy { return -1.0f; } @Override public float convertToFloatScale(float nits) { return PowerManager.BRIGHTNESS_INVALID_FLOAT; } @Override public void addUserDataPoint(float lux, float brightness) { float unadjustedBrightness = getUnadjustedBrightness(lux); Loading Loading @@ -912,6 +925,11 @@ public abstract class BrightnessMappingStrategy { return mBrightnessToNitsSpline.interpolate(brightness); } @Override public float convertToFloatScale(float nits) { return mNitsToBrightnessSpline.interpolate(nits); } @Override public void addUserDataPoint(float lux, float brightness) { float unadjustedBrightness = getUnadjustedBrightness(lux); Loading services/core/java/com/android/server/display/BrightnessSetting.java +17 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,23 @@ public class BrightnessSetting { } } /** * @return The brightness for the default display in nits. Used when the underlying display * device has changed but we want to persist the nit value. */ float getBrightnessNitsForDefaultDisplay() { return mPersistentDataStore.getBrightnessNitsForDefaultDisplay(); } /** * Set brightness in nits for the default display. Used when we want to persist the nit value * even if the underlying display device changes. * @param nits The brightness value in nits */ void setBrightnessNitsForDefaultDisplay(float nits) { mPersistentDataStore.setBrightnessNitsForDefaultDisplay(nits); } private void notifyListeners(float brightness) { for (BrightnessSettingListener l : mListeners) { l.onBrightnessChanged(brightness); Loading Loading
core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -6092,4 +6092,8 @@ <!-- Whether to show weather on the lock screen by default. --> <bool name="config_lockscreenWeatherEnabledByDefault">false</bool> <!-- Whether we should persist the brightness value in nits for the default display even if the underlying display device changes. --> <bool name="config_persistBrightnessNitsForDefaultDisplay">false</bool> </resources>
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2282,6 +2282,7 @@ <java-symbol type="bool" name="config_preventImeStartupUnlessTextEditor" /> <java-symbol type="array" name="config_nonPreemptibleInputMethods" /> <java-symbol type="bool" name="config_enhancedConfirmationModeEnabled" /> <java-symbol type="bool" name="config_persistBrightnessNitsForDefaultDisplay" /> <java-symbol type="layout" name="resolver_list" /> <java-symbol type="id" name="resolver_list" /> Loading
services/core/java/com/android/server/display/AutomaticBrightnessController.java +8 −0 Original line number Diff line number Diff line Loading @@ -1127,6 +1127,14 @@ class AutomaticBrightnessController { } } public float convertToFloatScale(float nits) { if (mCurrentBrightnessMapper != null) { return mCurrentBrightnessMapper.convertToFloatScale(nits); } else { return PowerManager.BRIGHTNESS_INVALID_FLOAT; } } public void recalculateSplines(boolean applyAdjustment, float[] adjustment) { mCurrentBrightnessMapper.recalculateSplines(applyAdjustment, adjustment); Loading
services/core/java/com/android/server/display/BrightnessMappingStrategy.java +18 −0 Original line number Diff line number Diff line Loading @@ -321,6 +321,14 @@ public abstract class BrightnessMappingStrategy { */ public abstract float convertToNits(float brightness); /** * Converts the provided nit value to a float scale value if possible. * * Returns {@link PowerManager.BRIGHTNESS_INVALID_FLOAT} if there's no available mapping for * the nits to float scale. */ public abstract float convertToFloatScale(float nits); /** * Adds a user interaction data point to the brightness mapping. * Loading Loading @@ -670,6 +678,11 @@ public abstract class BrightnessMappingStrategy { return -1.0f; } @Override public float convertToFloatScale(float nits) { return PowerManager.BRIGHTNESS_INVALID_FLOAT; } @Override public void addUserDataPoint(float lux, float brightness) { float unadjustedBrightness = getUnadjustedBrightness(lux); Loading Loading @@ -912,6 +925,11 @@ public abstract class BrightnessMappingStrategy { return mBrightnessToNitsSpline.interpolate(brightness); } @Override public float convertToFloatScale(float nits) { return mNitsToBrightnessSpline.interpolate(nits); } @Override public void addUserDataPoint(float lux, float brightness) { float unadjustedBrightness = getUnadjustedBrightness(lux); Loading
services/core/java/com/android/server/display/BrightnessSetting.java +17 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,23 @@ public class BrightnessSetting { } } /** * @return The brightness for the default display in nits. Used when the underlying display * device has changed but we want to persist the nit value. */ float getBrightnessNitsForDefaultDisplay() { return mPersistentDataStore.getBrightnessNitsForDefaultDisplay(); } /** * Set brightness in nits for the default display. Used when we want to persist the nit value * even if the underlying display device changes. * @param nits The brightness value in nits */ void setBrightnessNitsForDefaultDisplay(float nits) { mPersistentDataStore.setBrightnessNitsForDefaultDisplay(nits); } private void notifyListeners(float brightness) { for (BrightnessSettingListener l : mListeners) { l.onBrightnessChanged(brightness); Loading