This commit is contained in:
zb
2023-12-11 20:34:19 -05:00
parent f51ef42f95
commit 07c100e2e2
3 changed files with 60 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,60 @@
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
index 1224902aa7be..68855ebf06b9 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
@@ -70,6 +70,10 @@ import com.android.server.display.whitebalance.DisplayWhiteBalanceFactory;
import com.android.server.display.whitebalance.DisplayWhiteBalanceSettings;
import com.android.server.policy.WindowManagerPolicy;
+// Button backlights
+import com.android.server.lights.LightsManager;
+import com.android.server.lights.LogicalLight;
+
import java.io.PrintWriter;
/**
@@ -276,6 +280,10 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
// Must only be accessed on the handler thread.
private DisplayPowerState mPowerState;
+ // Buttons backlight
+ private LightsManager mLightsManager;
+ private LogicalLight mButtonsLight;
+
// True if the device should wait for negative proximity sensor before
// waking up the screen. This is set to false as soon as a negative
// proximity sensor measurement is observed or when the device is forced to
@@ -817,6 +825,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
mPowerState = new DisplayPowerState(mBlanker,
mColorFadeEnabled ? new ColorFade(mDisplayId) : null, mDisplayId, displayState);
+ mLightsManager = LocalServices.getService(LightsManager.class);
+ mButtonsLight = mLightsManager.getLight(LightsManager.LIGHT_ID_BUTTONS);
+
if (mColorFadeEnabled) {
mColorFadeOnAnimator = ObjectAnimator.ofFloat(
mPowerState, DisplayPowerState.COLOR_FADE_LEVEL, 0.0f, 1.0f);
@@ -1452,6 +1463,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
&& mReportedScreenStateToPolicy == REPORTED_TO_POLICY_SCREEN_TURNING_ON) {
setReportedScreenState(REPORTED_TO_POLICY_SCREEN_ON);
mWindowManagerPolicy.screenTurnedOn(mDisplayId);
+ mButtonsLight.setBrightness(PowerManager.BRIGHTNESS_MAX);
}
// Grab a wake lock if we have unfinished business.
@@ -1652,6 +1664,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
setReportedScreenState(REPORTED_TO_POLICY_SCREEN_OFF);
unblockScreenOn();
mWindowManagerPolicy.screenTurnedOff(mDisplayId);
+ mButtonsLight.setBrightness(PowerManager.BRIGHTNESS_OFF_FLOAT);
} else if (!isOff
&& mReportedScreenStateToPolicy == REPORTED_TO_POLICY_SCREEN_TURNING_OFF) {
@@ -1659,6 +1672,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
// Complete the full state transition on -> turningOff -> off.
unblockScreenOff();
mWindowManagerPolicy.screenTurnedOff(mDisplayId);
+ mButtonsLight.setBrightness(PowerManager.BRIGHTNESS_OFF_FLOAT);
setReportedScreenState(REPORTED_TO_POLICY_SCREEN_OFF);
}
if (!isOff

View File

@@ -0,0 +1,11 @@
diff --git a/src_build_config/com/android/launcher3/BuildConfig.java b/src_build_config/com/android/launcher3/BuildConfig.java
index 9a81d3f54c..8c83bcc372 100644
--- a/src_build_config/com/android/launcher3/BuildConfig.java
+++ b/src_build_config/com/android/launcher3/BuildConfig.java
@@ -23,5 +23,5 @@ public final class BuildConfig {
* Flag to state if the QSB is on the first screen and placed on the top,
* this can be overwritten in other launchers with a different value, if needed.
*/
- public static final boolean QSB_ON_FIRST_SCREEN = true;
+ public static final boolean QSB_ON_FIRST_SCREEN = false;
}