diff options
author | Steve Kondik <steve@cyngn.com> | 2016-07-28 05:51:11 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-07-28 13:18:15 -0700 |
commit | 52d7572cc25383b79041e285bc34a9e1a884b062 (patch) | |
tree | 5e67f921751458b8a6b3d1adcddb864bb66ebc83 /services | |
parent | 99710c194a433eef9d912d2d59ad162e6e803ec3 (diff) | |
download | frameworks_base-52d7572cc25383b79041e285bc34a9e1a884b062.zip frameworks_base-52d7572cc25383b79041e285bc34a9e1a884b062.tar.gz frameworks_base-52d7572cc25383b79041e285bc34a9e1a884b062.tar.bz2 |
lights: Make sure the lights are out
* Annoying situation where the battery charging LED comes on in
the crypto startup screen, but never gets turned off because
of caching.
* Explicitly turn off LEDs after the bootanimation completes, and
always set the full state to the hardware on the first call
regardless if it's all zeros.
Change-Id: I8cd2325ec5d8924391e4fc62249f6dd737d52f3e
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/lights/LightsService.java | 4 | ||||
-rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 13 |
2 files changed, 16 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java index 16dde26..d4762bd 100644 --- a/services/core/java/com/android/server/lights/LightsService.java +++ b/services/core/java/com/android/server/lights/LightsService.java @@ -113,9 +113,10 @@ public class LightsService extends SystemService { private void setLightLocked(int color, int mode, int onMS, int offMS, int brightnessMode) { if (mModesUpdate || color != mColor || mode != mMode || onMS != mOnMS || - offMS != mOffMS) { + offMS != mOffMS || mReset) { if (DEBUG) Slog.v(TAG, "setLight #" + mId + ": color=#" + Integer.toHexString(color)); + mReset = false; mColor = color; mMode = mode; mOnMS = onMS; @@ -141,6 +142,7 @@ public class LightsService extends SystemService { private boolean mFlashing; private boolean mModesUpdate; private boolean mMultipleLeds; + private boolean mReset = true; } public LightsService(Context context) { diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 6f44911..c519120 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -128,6 +128,8 @@ import com.android.server.UiThread; import com.android.server.Watchdog; import com.android.server.am.BatteryStatsService; import com.android.server.input.InputManagerService; +import com.android.server.lights.Light; +import com.android.server.lights.LightsManager; import com.android.server.policy.PhoneWindowManager; import com.android.server.power.ShutdownThread; @@ -5928,6 +5930,17 @@ public class WindowManagerService extends IWindowManager.Stub mPolicy.enableScreenAfterBoot(); + // clear any intrusive lighting which may still be on from the + // crypto landing ui + LightsManager lm = LocalServices.getService(LightsManager.class); + Light batteryLight = lm.getLight(LightsManager.LIGHT_ID_BATTERY); + Light notifLight = lm.getLight(LightsManager.LIGHT_ID_NOTIFICATIONS); + if (batteryLight != null) { + batteryLight.turnOff(); + } + if (notifLight != null) { + notifLight.turnOff(); + } // Make sure the last requested orientation has been applied. updateRotationUnchecked(false, false); } |