OSDN Git Service

Animate shade expansion when bouncer
authorLucas Dupin <dupin@google.com>
Mon, 9 Apr 2018 06:17:40 +0000 (23:17 -0700)
committerLucas Dupin <dupin@google.com>
Mon, 9 Apr 2018 16:18:17 +0000 (09:18 -0700)
Change-Id: Ia1b303766379cb9d917c8b60ed70730fe3c4f5b4
Fixes: 76228574
Test: Swipe up, hit back
Test: Double tap on notification, hit back
Test: Launch camera, request bouncer, hit back
Test: Repeat for PIN and password

packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java

index 7987bfd..9c5cf30 100644 (file)
@@ -3899,7 +3899,11 @@ public class StatusBar extends SystemUI implements DemoMode,
     }
 
     public boolean onBackPressed() {
-        if (mStatusBarKeyguardViewManager.onBackPressed()) {
+        boolean isScrimmedBouncer = mScrimController.getState() == ScrimState.BOUNCER_SCRIMMED;
+        if (mStatusBarKeyguardViewManager.onBackPressed(isScrimmedBouncer /* hideImmediately */)) {
+            if (!isScrimmedBouncer) {
+                mNotificationPanel.expandWithoutQs();
+            }
             return true;
         }
         if (mNotificationPanel.isQsExpanded()) {
index 2727b30..670c68f 100644 (file)
@@ -512,12 +512,15 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
     /**
      * Notifies this manager that the back button has been pressed.
      *
+     * @param hideImmediately Hide bouncer when {@code true}, keep it around otherwise.
+     *                        Non-scrimmed bouncers have a special animation tied to the expansion
+     *                        of the notification panel.
      * @return whether the back press has been handled
      */
-    public boolean onBackPressed() {
+    public boolean onBackPressed(boolean hideImmediately) {
         if (mBouncer.isShowing()) {
             mStatusBar.endAffordanceLaunch();
-            reset(true /* hideBouncerWhenShowing */);
+            reset(hideImmediately);
             return true;
         }
         return false;