diff options
author | Michael Bestas <mikeioannina@cyanogenmod.org> | 2016-05-31 00:23:23 +0300 |
---|---|---|
committer | Michael Bestas <mikeioannina@cyanogenmod.org> | 2016-06-03 14:05:03 -0700 |
commit | 981a59d29fe56fe3c8a9ccb04e64284bc6b7ad49 (patch) | |
tree | 09aa941ba4684f088b4728023e9b95d114b727d3 | |
parent | e49ebe6e54e965e4dcb7f0eee180a4fee97417a8 (diff) | |
download | frameworks_base-981a59d29fe56fe3c8a9ccb04e64284bc6b7ad49.zip frameworks_base-981a59d29fe56fe3c8a9ccb04e64284bc6b7ad49.tar.gz frameworks_base-981a59d29fe56fe3c8a9ccb04e64284bc6b7ad49.tar.bz2 |
SystemUI: Do not enable KeyguardBlur by default
* The observer has been moved outside of blurSupported check
so we can't initalize mKeyguardBlurEnabled to 1 by default
* Default mKeyguardBlurEnabled to R.bool.config_ui_blur_enabled
Change-Id: I32ed01ee3d75359abfbb6c7acfe315b9f154ce6f
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java index bbb56fe..96a4960 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java @@ -57,6 +57,7 @@ public class StatusBarWindowManager implements KeyguardMonitor.Callback { private int mBarHeight; private boolean mKeyguardScreenRotation; private final float mScreenBrightnessDoze; + private final boolean mBlurSupported; private boolean mKeyguardBlurEnabled; private boolean mShowingMedia; @@ -79,6 +80,8 @@ public class StatusBarWindowManager implements KeyguardMonitor.Callback { mKeyguardScreenRotation = shouldEnableKeyguardScreenRotation(); mScreenBrightnessDoze = mContext.getResources().getInteger( com.android.internal.R.integer.config_screenBrightnessDoze) / 255f; + mBlurSupported = mContext.getResources().getBoolean( + com.android.internal.R.bool.config_ui_blur_enabled); mKeyguardMonitor = kgm; mKeyguardMonitor.addCallback(this); @@ -127,11 +130,10 @@ public class StatusBarWindowManager implements KeyguardMonitor.Callback { mLpChanged = new WindowManager.LayoutParams(); mLpChanged.copyFrom(mLp); - boolean blurSupported = mContext.getResources().getBoolean( - com.android.internal.R.bool.config_ui_blur_enabled); - if (blurSupported) { - mKeyguardBlurEnabled = CMSettings.Secure.getInt(mContext.getContentResolver(), - CMSettings.Secure.LOCK_SCREEN_BLUR_ENABLED, blurSupported ? 1 : 0) == 1; + mKeyguardBlurEnabled = mBlurSupported ? + CMSettings.Secure.getInt(mContext.getContentResolver(), + CMSettings.Secure.LOCK_SCREEN_BLUR_ENABLED, 1) == 1 : false; + if (mBlurSupported) { Display display = mWindowManager.getDefaultDisplay(); Point xy = new Point(); display.getRealSize(xy); @@ -490,9 +492,9 @@ public class StatusBarWindowManager implements KeyguardMonitor.Callback { @Override public void onChange(boolean selfChange) { - // default to being enabled since we are here because the blur config was set to true - mKeyguardBlurEnabled = CMSettings.Secure.getInt(mContext.getContentResolver(), - CMSettings.Secure.LOCK_SCREEN_BLUR_ENABLED, 1) == 1; + mKeyguardBlurEnabled = mBlurSupported ? + CMSettings.Secure.getInt(mContext.getContentResolver(), + CMSettings.Secure.LOCK_SCREEN_BLUR_ENABLED, 1) == 1 : false; mKeyguardScreenRotation = shouldEnableKeyguardScreenRotation(); // update the state apply(mCurrentState); |