diff options
author | Steve Kondik <steve@cyngn.com> | 2015-12-08 04:24:52 -0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2015-12-09 21:02:31 -0800 |
commit | 958e4d050707b32529bd4f16dd840cd8ce3908b9 (patch) | |
tree | 62212c5a4980596741f1e7dd46a0b81c5c1c8d42 /services | |
parent | dbe722280e24de322b68e4645d22331ceed09616 (diff) | |
download | frameworks_base-958e4d050707b32529bd4f16dd840cd8ce3908b9.zip frameworks_base-958e4d050707b32529bd4f16dd840cd8ce3908b9.tar.gz frameworks_base-958e4d050707b32529bd4f16dd840cd8ce3908b9.tar.bz2 |
livedisplay: Handle self-managed SRE/SVI implementations
* Some backends such as Qualcomm SVI do their own ambient
lux sensing and all we need to do is provide a toggle.
Change-Id: I6fe87e2ce6397e5f9190c82d10c4df06d83a9747
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/display/LiveDisplayController.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/display/LiveDisplayController.java b/services/core/java/com/android/server/display/LiveDisplayController.java index be26c57..9e6da2d 100644 --- a/services/core/java/com/android/server/display/LiveDisplayController.java +++ b/services/core/java/com/android/server/display/LiveDisplayController.java @@ -87,6 +87,8 @@ public class LiveDisplayController { private boolean mUseColorEnhancement; private boolean mUseLowPower; + private boolean mOutdoorModeIsSelfManaged; + private final float[] mColorAdjustment = new float[] { 1.0f, 1.0f, 1.0f }; private final float[] mRGB = new float[] { 0.0f, 0.0f, 0.0f }; @@ -140,6 +142,8 @@ public class LiveDisplayController { mUseOutdoorMode = mHardware.isSupported(CMHardwareManager.FEATURE_SUNLIGHT_ENHANCEMENT); + mOutdoorModeIsSelfManaged = mUseOutdoorMode ? + mHardware.isSunlightEnhancementSelfManaged() : false; mUseLowPower = mHardware.isSupported(CMHardwareManager.FEATURE_ADAPTIVE_BACKLIGHT); @@ -359,11 +363,16 @@ public class LiveDisplayController { 1, UserHandle.USER_CURRENT) == 1; - boolean enabled = !mLowPerformance && + boolean enabled; + if (mOutdoorModeIsSelfManaged) { + enabled = value; + } else { + enabled = !mLowPerformance && ((mMode == MODE_OUTDOOR) || (value && mMode == MODE_AUTO && twilight != null && !twilight.isNight() && mCurrentLux > mDefaultOutdoorLux)); + } if (enabled == mOutdoorMode) { return; |