Loading services/core/java/com/android/server/display/AutomaticBrightnessController.java +0 −2 Original line number Diff line number Diff line Loading @@ -402,7 +402,6 @@ class AutomaticBrightnessController { boolean userChangedAutoBrightnessAdjustment, int displayPolicy, boolean shouldResetShortTermModel) { mState = state; mHbmController.setAutoBrightnessEnabled(mState); // While dozing, the application processor may be suspended which will prevent us from // receiving new information from the light sensor. On some devices, we may be able to // switch to a wake-up light sensor instead but for now we will simply disable the sensor Loading Loading @@ -466,7 +465,6 @@ class AutomaticBrightnessController { mHandler.sendEmptyMessage(MSG_RUN_UPDATE); } @VisibleForTesting float getAmbientLux() { return mAmbientLux; } Loading services/core/java/com/android/server/display/DisplayPowerController.java +11 −3 Original line number Diff line number Diff line Loading @@ -719,7 +719,8 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call } @Override public void setBrightnessToFollow(float leadDisplayBrightness, float nits) { public void setBrightnessToFollow(float leadDisplayBrightness, float nits, float ambientLux) { mHbmController.onAmbientLuxChange(ambientLux); if (mAutomaticBrightnessController == null || nits < 0) { mBrightnessToFollow = leadDisplayBrightness; } else { Loading Loading @@ -751,7 +752,8 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call } for (int i = 0; i < followers.size(); i++) { DisplayPowerControllerInterface follower = followers.valueAt(i); follower.setBrightnessToFollow(PowerManager.BRIGHTNESS_INVALID_FLOAT, /* nits= */ -1); follower.setBrightnessToFollow(PowerManager.BRIGHTNESS_INVALID_FLOAT, /* nits= */ -1, /* ambientLux= */ 0); } } Loading Loading @@ -1523,6 +1525,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call mShouldResetShortTermModel); mShouldResetShortTermModel = false; } mHbmController.setAutoBrightnessEnabled(mUseAutoBrightness ? AutomaticBrightnessController.AUTO_BRIGHTNESS_ENABLED : AutomaticBrightnessController.AUTO_BRIGHTNESS_DISABLED); if (mBrightnessTracker != null) { mBrightnessTracker.setBrightnessConfiguration(mBrightnessConfiguration); Loading Loading @@ -1634,9 +1639,12 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call mAppliedThrottling = false; } float ambientLux = mAutomaticBrightnessController == null ? 0 : mAutomaticBrightnessController.getAmbientLux(); for (int i = 0; i < displayBrightnessFollowers.size(); i++) { DisplayPowerControllerInterface follower = displayBrightnessFollowers.valueAt(i); follower.setBrightnessToFollow(rawBrightnessState, convertToNits(rawBrightnessState)); follower.setBrightnessToFollow(rawBrightnessState, convertToNits(rawBrightnessState), ambientLux); } if (updateScreenBrightnessSetting) { Loading services/core/java/com/android/server/display/DisplayPowerController2.java +11 −3 Original line number Diff line number Diff line Loading @@ -1236,6 +1236,9 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal mShouldResetShortTermModel); mShouldResetShortTermModel = false; } mHbmController.setAutoBrightnessEnabled(mUseAutoBrightness ? AutomaticBrightnessController.AUTO_BRIGHTNESS_ENABLED : AutomaticBrightnessController.AUTO_BRIGHTNESS_DISABLED); if (mBrightnessTracker != null) { mBrightnessTracker.setBrightnessConfiguration(mBrightnessConfiguration); Loading Loading @@ -1347,9 +1350,12 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal mAppliedThrottling = false; } float ambientLux = mAutomaticBrightnessController == null ? 0 : mAutomaticBrightnessController.getAmbientLux(); for (int i = 0; i < displayBrightnessFollowers.size(); i++) { DisplayPowerControllerInterface follower = displayBrightnessFollowers.valueAt(i); follower.setBrightnessToFollow(rawBrightnessState, convertToNits(rawBrightnessState)); follower.setBrightnessToFollow(rawBrightnessState, convertToNits(rawBrightnessState), ambientLux); } if (updateScreenBrightnessSetting) { Loading Loading @@ -2138,7 +2144,8 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal } @Override public void setBrightnessToFollow(float leadDisplayBrightness, float nits) { public void setBrightnessToFollow(float leadDisplayBrightness, float nits, float ambientLux) { mHbmController.onAmbientLuxChange(ambientLux); if (mAutomaticBrightnessController == null || nits < 0) { mDisplayBrightnessController.setBrightnessToFollow(leadDisplayBrightness); } else { Loading Loading @@ -2219,7 +2226,8 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal } for (int i = 0; i < followers.size(); i++) { DisplayPowerControllerInterface follower = followers.valueAt(i); follower.setBrightnessToFollow(PowerManager.BRIGHTNESS_INVALID_FLOAT, /* nits= */ -1); follower.setBrightnessToFollow(PowerManager.BRIGHTNESS_INVALID_FLOAT, /* nits= */ -1, /* ambientLux= */ 0); } } Loading services/core/java/com/android/server/display/DisplayPowerControllerInterface.java +4 −2 Original line number Diff line number Diff line Loading @@ -173,9 +173,11 @@ public interface DisplayPowerControllerInterface { * displays. * @param leadDisplayBrightness The brightness of the lead display in the set of concurrent * displays * @param nits The brightness value in nits if the device supports nits * @param nits The brightness value in nits if the device supports nits. Set to a negative * number otherwise. * @param ambientLux The lux value that will be passed to {@link HighBrightnessModeController} */ void setBrightnessToFollow(float leadDisplayBrightness, float nits); void setBrightnessToFollow(float leadDisplayBrightness, float nits, float ambientLux); /** * Add an additional display that will copy the brightness value from this display. This is used Loading Loading
services/core/java/com/android/server/display/AutomaticBrightnessController.java +0 −2 Original line number Diff line number Diff line Loading @@ -402,7 +402,6 @@ class AutomaticBrightnessController { boolean userChangedAutoBrightnessAdjustment, int displayPolicy, boolean shouldResetShortTermModel) { mState = state; mHbmController.setAutoBrightnessEnabled(mState); // While dozing, the application processor may be suspended which will prevent us from // receiving new information from the light sensor. On some devices, we may be able to // switch to a wake-up light sensor instead but for now we will simply disable the sensor Loading Loading @@ -466,7 +465,6 @@ class AutomaticBrightnessController { mHandler.sendEmptyMessage(MSG_RUN_UPDATE); } @VisibleForTesting float getAmbientLux() { return mAmbientLux; } Loading
services/core/java/com/android/server/display/DisplayPowerController.java +11 −3 Original line number Diff line number Diff line Loading @@ -719,7 +719,8 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call } @Override public void setBrightnessToFollow(float leadDisplayBrightness, float nits) { public void setBrightnessToFollow(float leadDisplayBrightness, float nits, float ambientLux) { mHbmController.onAmbientLuxChange(ambientLux); if (mAutomaticBrightnessController == null || nits < 0) { mBrightnessToFollow = leadDisplayBrightness; } else { Loading Loading @@ -751,7 +752,8 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call } for (int i = 0; i < followers.size(); i++) { DisplayPowerControllerInterface follower = followers.valueAt(i); follower.setBrightnessToFollow(PowerManager.BRIGHTNESS_INVALID_FLOAT, /* nits= */ -1); follower.setBrightnessToFollow(PowerManager.BRIGHTNESS_INVALID_FLOAT, /* nits= */ -1, /* ambientLux= */ 0); } } Loading Loading @@ -1523,6 +1525,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call mShouldResetShortTermModel); mShouldResetShortTermModel = false; } mHbmController.setAutoBrightnessEnabled(mUseAutoBrightness ? AutomaticBrightnessController.AUTO_BRIGHTNESS_ENABLED : AutomaticBrightnessController.AUTO_BRIGHTNESS_DISABLED); if (mBrightnessTracker != null) { mBrightnessTracker.setBrightnessConfiguration(mBrightnessConfiguration); Loading Loading @@ -1634,9 +1639,12 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call mAppliedThrottling = false; } float ambientLux = mAutomaticBrightnessController == null ? 0 : mAutomaticBrightnessController.getAmbientLux(); for (int i = 0; i < displayBrightnessFollowers.size(); i++) { DisplayPowerControllerInterface follower = displayBrightnessFollowers.valueAt(i); follower.setBrightnessToFollow(rawBrightnessState, convertToNits(rawBrightnessState)); follower.setBrightnessToFollow(rawBrightnessState, convertToNits(rawBrightnessState), ambientLux); } if (updateScreenBrightnessSetting) { Loading
services/core/java/com/android/server/display/DisplayPowerController2.java +11 −3 Original line number Diff line number Diff line Loading @@ -1236,6 +1236,9 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal mShouldResetShortTermModel); mShouldResetShortTermModel = false; } mHbmController.setAutoBrightnessEnabled(mUseAutoBrightness ? AutomaticBrightnessController.AUTO_BRIGHTNESS_ENABLED : AutomaticBrightnessController.AUTO_BRIGHTNESS_DISABLED); if (mBrightnessTracker != null) { mBrightnessTracker.setBrightnessConfiguration(mBrightnessConfiguration); Loading Loading @@ -1347,9 +1350,12 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal mAppliedThrottling = false; } float ambientLux = mAutomaticBrightnessController == null ? 0 : mAutomaticBrightnessController.getAmbientLux(); for (int i = 0; i < displayBrightnessFollowers.size(); i++) { DisplayPowerControllerInterface follower = displayBrightnessFollowers.valueAt(i); follower.setBrightnessToFollow(rawBrightnessState, convertToNits(rawBrightnessState)); follower.setBrightnessToFollow(rawBrightnessState, convertToNits(rawBrightnessState), ambientLux); } if (updateScreenBrightnessSetting) { Loading Loading @@ -2138,7 +2144,8 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal } @Override public void setBrightnessToFollow(float leadDisplayBrightness, float nits) { public void setBrightnessToFollow(float leadDisplayBrightness, float nits, float ambientLux) { mHbmController.onAmbientLuxChange(ambientLux); if (mAutomaticBrightnessController == null || nits < 0) { mDisplayBrightnessController.setBrightnessToFollow(leadDisplayBrightness); } else { Loading Loading @@ -2219,7 +2226,8 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal } for (int i = 0; i < followers.size(); i++) { DisplayPowerControllerInterface follower = followers.valueAt(i); follower.setBrightnessToFollow(PowerManager.BRIGHTNESS_INVALID_FLOAT, /* nits= */ -1); follower.setBrightnessToFollow(PowerManager.BRIGHTNESS_INVALID_FLOAT, /* nits= */ -1, /* ambientLux= */ 0); } } Loading
services/core/java/com/android/server/display/DisplayPowerControllerInterface.java +4 −2 Original line number Diff line number Diff line Loading @@ -173,9 +173,11 @@ public interface DisplayPowerControllerInterface { * displays. * @param leadDisplayBrightness The brightness of the lead display in the set of concurrent * displays * @param nits The brightness value in nits if the device supports nits * @param nits The brightness value in nits if the device supports nits. Set to a negative * number otherwise. * @param ambientLux The lux value that will be passed to {@link HighBrightnessModeController} */ void setBrightnessToFollow(float leadDisplayBrightness, float nits); void setBrightnessToFollow(float leadDisplayBrightness, float nits, float ambientLux); /** * Add an additional display that will copy the brightness value from this display. This is used Loading