Created
June 16, 2016 21:27
-
-
Save invisiblek/901c31c11e7f471c0c823be20fb192b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit e7d09206e57920ffa87a3fbb6cfced5fbdec318f | |
Author: Dan Pasanen <[email protected]> | |
Date: Wed Jun 15 15:40:58 2016 -0500 | |
SystemUI: detect rotation and resize mKeyguardBlur accordingly | |
Change-Id: Icfd1d2de9929f9620332e3367885bec972063681 | |
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 39ef494..d435f20 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..bdf8bcc 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 mOldOrientation; | |
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 | |
@@ -360,6 +362,15 @@ public class StatusBarWindowManager implements KeyguardMonitor.Callback { | |
setKeyguardOccluded(hasFocus); | |
} | |
+ public void onConfigurationChanged(Configuration newConfig) { | |
+ if (newConfig.orientation != mOldOrientation) { | |
+ Display display = mWindowManager.getDefaultDisplay(); | |
+ Point xy = new Point(); | |
+ display.getRealSize(xy); | |
+ mKeyguardBlur.setSize(xy.x, xy.y); | |
+ } | |
+ } | |
+ | |
/** | |
* @param state The {@link StatusBarState} of the status bar. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment