summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2014-05-14 15:52:53 +0200
committerAdrian Roos <roosa@google.com>2014-05-14 16:51:18 +0200
commitb601162a60663329355720083bfa199909dbf6ef (patch)
treed416da09f17e2c1d7d5b2c069a2be6c7a909cc04 /packages/SystemUI/src
parent54b6fd0cbe48fc0980da0617352785c973c60c86 (diff)
downloadframeworks_base-b601162a60663329355720083bfa199909dbf6ef.zip
frameworks_base-b601162a60663329355720083bfa199909dbf6ef.tar.gz
frameworks_base-b601162a60663329355720083bfa199909dbf6ef.tar.bz2
Fix visibility and add bouncer event in KeyguardUpdateMonitor
Bug: 14087751 Change-Id: I45bc2213dfcce751180762d18ead0382f68cac74
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java58
2 files changed, 46 insertions, 13 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index f812e8c..e73e904 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -807,7 +807,6 @@ public class KeyguardViewMediator extends SystemUI {
*/
public void setOccluded(boolean isOccluded) {
if (DEBUG) Log.d(TAG, "setOccluded " + isOccluded);
- mUpdateMonitor.sendKeyguardVisibilityChanged(!isOccluded);
mHandler.removeMessages(SET_OCCLUDED);
Message msg = mHandler.obtainMessage(SET_OCCLUDED, (isOccluded ? 1 : 0), 0);
mHandler.sendMessage(msg);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index 2ae21ac..77b760e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -26,6 +26,7 @@ import android.view.ViewGroup;
import com.android.internal.policy.IKeyguardShowCallback;
import com.android.internal.widget.LockPatternUtils;
+import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.ViewMediatorCallback;
/**
@@ -51,6 +52,12 @@ public class StatusBarKeyguardViewManager {
private boolean mShowing;
private boolean mOccluded;
+ private boolean mFirstUpdate = true;
+ private boolean mLastShowing;
+ private boolean mLastOccluded;
+ private boolean mLastBouncerShowing;
+ private boolean mLastBouncerDismissible;
+
public StatusBarKeyguardViewManager(Context context, ViewMediatorCallback callback,
LockPatternUtils lockPatternUtils) {
mContext = context;
@@ -208,21 +215,48 @@ public class StatusBarKeyguardViewManager {
private void updateStates() {
int vis = mContainer.getSystemUiVisibility();
- boolean bouncerDismissable = mBouncer.isShowing() && !mBouncer.needsFullscreenBouncer();
- if (bouncerDismissable || !mShowing) {
- mContainer.setSystemUiVisibility(vis & ~View.STATUS_BAR_DISABLE_BACK);
- } else {
- mContainer.setSystemUiVisibility(vis | View.STATUS_BAR_DISABLE_BACK);
- }
- if (mPhoneStatusBar.getNavigationBarView() != null) {
- if (!(mShowing && !mOccluded) || mBouncer.isShowing()) {
- mPhoneStatusBar.getNavigationBarView().setVisibility(View.VISIBLE);
+ boolean showing = mShowing;
+ boolean occluded = mOccluded;
+ boolean bouncerShowing = mBouncer.isShowing();
+ boolean bouncerDismissible = bouncerShowing && !mBouncer.needsFullscreenBouncer();
+
+ if ((bouncerDismissible || !showing) != (mLastBouncerDismissible || !mLastShowing)
+ || mFirstUpdate) {
+ if (bouncerDismissible || !showing) {
+ mContainer.setSystemUiVisibility(vis & ~View.STATUS_BAR_DISABLE_BACK);
} else {
- mPhoneStatusBar.getNavigationBarView().setVisibility(View.GONE);
+ mContainer.setSystemUiVisibility(vis | View.STATUS_BAR_DISABLE_BACK);
+ }
+ }
+ if ((!(showing && !occluded) || bouncerShowing)
+ != (!(mLastShowing && !mLastOccluded) || mLastBouncerShowing) || mFirstUpdate) {
+ if (mPhoneStatusBar.getNavigationBarView() != null) {
+ if (!(showing && !occluded) || bouncerShowing) {
+ mPhoneStatusBar.getNavigationBarView().setVisibility(View.VISIBLE);
+ } else {
+ mPhoneStatusBar.getNavigationBarView().setVisibility(View.GONE);
+ }
}
}
- mStatusBarWindowManager.setBouncerShowing(mBouncer.isShowing());
- mPhoneStatusBar.setBouncerShowing(mBouncer.isShowing());
+
+ if (bouncerShowing != mLastBouncerShowing || mFirstUpdate) {
+ mStatusBarWindowManager.setBouncerShowing(bouncerShowing);
+ mPhoneStatusBar.setBouncerShowing(bouncerShowing);
+ }
+
+ KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
+ if ((showing && !occluded) != (mLastShowing && !mLastOccluded) || mFirstUpdate) {
+ updateMonitor.sendKeyguardVisibilityChanged(showing && !occluded);
+ }
+ if (bouncerShowing != mLastBouncerShowing || mFirstUpdate) {
+ updateMonitor.sendKeyguardBouncerChanged(bouncerShowing);
+ }
+
+ mFirstUpdate = false;
+ mLastShowing = showing;
+ mLastOccluded = occluded;
+ mLastBouncerShowing = bouncerShowing;
+ mLastBouncerDismissible = bouncerDismissible;
}
public boolean onMenuPressed() {