diff options
author | Dan Pasanen <invisiblek@cyanogenmod.org> | 2016-06-15 15:40:58 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-06-17 10:37:20 -0700 |
commit | 26079d3a0f83470910f88ac563d2ab37222e2906 (patch) | |
tree | 03d22b021edaac3d038e52d1c48f6cbf5c628d45 | |
parent | e843aafde27bff303ffb7ebab4595f1ec7a06909 (diff) | |
download | frameworks_base-26079d3a0f83470910f88ac563d2ab37222e2906.zip frameworks_base-26079d3a0f83470910f88ac563d2ab37222e2906.tar.gz frameworks_base-26079d3a0f83470910f88ac563d2ab37222e2906.tar.bz2 |
SystemUI: detect rotation and resize mKeyguardBlur accordingly
Change-Id: Icfd1d2de9929f9620332e3367885bec972063681
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 1 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 8234dcd..e79453e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -3698,6 +3698,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mIconController.updateResources(); mScreenPinningRequest.onConfigurationChanged(); mNetworkController.onConfigurationChanged(); + mStatusBarWindowManager.onConfigurationChanged(newConfig); } @Override 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 96a4960..d0d56c7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java @@ -18,6 +18,7 @@ package com.android.systemui.statusbar.phone; import android.content.Context; import android.content.pm.ActivityInfo; +import android.content.res.Configuration; import android.content.res.Resources; import android.database.ContentObserver; import android.graphics.Point; @@ -65,6 +66,7 @@ public class StatusBarWindowManager implements KeyguardMonitor.Callback { private final SurfaceSession mFxSession; private final KeyguardMonitor mKeyguardMonitor; + private int mCurrentOrientation; private static final int TYPE_LAYER_MULTIPLIER = 10000; // refer to WindowManagerService.TYPE_LAYER_MULTIPLIER private static final int TYPE_LAYER_OFFSET = 1000; // refer to WindowManagerService.TYPE_LAYER_OFFSET @@ -137,6 +139,7 @@ public class StatusBarWindowManager implements KeyguardMonitor.Callback { Display display = mWindowManager.getDefaultDisplay(); Point xy = new Point(); display.getRealSize(xy); + mCurrentOrientation = mContext.getResources().getConfiguration().orientation; mKeyguardBlur = new BlurLayer(mFxSession, xy.x, xy.y, "KeyGuard"); if (mKeyguardBlur != null) { mKeyguardBlur.setLayer(STATUS_BAR_LAYER - 2); @@ -360,6 +363,16 @@ public class StatusBarWindowManager implements KeyguardMonitor.Callback { setKeyguardOccluded(hasFocus); } + public void onConfigurationChanged(Configuration newConfig) { + if (mKeyguardBlur != null && newConfig.orientation != mCurrentOrientation) { + Display display = mWindowManager.getDefaultDisplay(); + Point xy = new Point(); + display.getRealSize(xy); + mKeyguardBlur.setSize(xy.x, xy.y); + mCurrentOrientation = newConfig.orientation; + } + } + /** * @param state The {@link StatusBarState} of the status bar. */ |