am 35cfe4c1: Merge "Go back to keyguard when in SHADE_LOCKED with single tap." into lmp-preview-dev
* commit '35cfe4c1f216f477d2c024d53a6f2c1a0d817f53':
Go back to keyguard when in SHADE_LOCKED with single tap.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index f43f348..142517c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -637,10 +637,12 @@
if (mHintAnimationRunning) {
return true;
}
- if (x < mEdgeTapAreaWidth) {
+ if (x < mEdgeTapAreaWidth
+ && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
onEdgeClicked(false /* right */);
return true;
- } else if (x > getWidth() - mEdgeTapAreaWidth) {
+ } else if (x > getWidth() - mEdgeTapAreaWidth
+ && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
onEdgeClicked(true /* right */);
return true;
} else {
@@ -654,7 +656,7 @@
startUnlockHintAnimation();
return true;
case StatusBarState.SHADE_LOCKED:
- // TODO: Go to Keyguard again.
+ mStatusBar.goToKeyguard();
return true;
case StatusBarState.SHADE:
collapse();
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 082fe3a..5548bfe 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -3055,6 +3055,16 @@
}
/**
+ * Goes back to the keyguard after hanging around in {@link StatusBarState#SHADE_LOCKED}.
+ */
+ public void goToKeyguard() {
+ if (mState == StatusBarState.SHADE_LOCKED) {
+ setBarState(StatusBarState.KEYGUARD);
+ updateKeyguardState();
+ }
+ }
+
+ /**
* @return a ViewGroup that spans the entire panel which contains the quick settings
*/
public ViewGroup getQuickSettingsOverlayParent() {