OSDN Git Service

AOD: Fix launching notifications from occluded AOD
authorAdrian Roos <roosa@google.com>
Fri, 4 Aug 2017 16:14:41 +0000 (18:14 +0200)
committerAdrian Roos <roosa@google.com>
Fri, 4 Aug 2017 16:25:50 +0000 (18:25 +0200)
Fixes an issue where launching notifications from AOD when a SHOW_WHEN_LOCKED
activity was showing did not work because the bouncer got dismissed.

After that was fixed and the bouncer showed, the launch transition did not
work because the panel was not collapsible. Instead of waiting for the panel
to collapse, just start keyguardDone directly if not collapsible.

Change-Id: I8813f91c741da372c9cb559797f4dc0fe8578d8c
Fixes: 63686192
Test: Disable TrustAgent if enabled, launch maps navigation, get notification, double tap on notification and/or actions. Verify Bouncer shows and unlock works.

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

index 68caab1..3d2213b 100644 (file)
@@ -5786,15 +5786,18 @@ public class StatusBar extends SystemUI implements DemoMode,
                         boolean handled = superOnClickHandler(view, pendingIntent, fillInIntent);
 
                         // close the shade if it was open
-                        if (handled) {
+                        if (handled && !mNotificationPanel.isFullyCollapsed()) {
                             animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL,
                                     true /* force */);
                             visibilityChanged(false);
                             mAssistManager.hideAssist();
+
+                            // Wait for activity start.
+                            return true;
+                        } else {
+                            return false;
                         }
 
-                        // Wait for activity start.
-                        return handled;
                     }
                 }, afterKeyguardGone);
                 return true;
@@ -6844,12 +6847,16 @@ public class StatusBar extends SystemUI implements DemoMode,
                     }
                 }.start();
 
-                // close the shade if it was open
-                animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL,
-                        true /* force */, true /* delayed */);
-                visibilityChanged(false);
+                if (!mNotificationPanel.isFullyCollapsed()) {
+                    // close the shade if it was open
+                    animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL,
+                            true /* force */, true /* delayed */);
+                    visibilityChanged(false);
 
-                return true;
+                    return true;
+                } else {
+                    return false;
+                }
             }
         }, afterKeyguardGone);
     }
@@ -7001,12 +7008,16 @@ public class StatusBar extends SystemUI implements DemoMode,
                         new Thread(runnable).start();
                     }
 
-                    // close the shade if it was open
-                    animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL,
-                            true /* force */, true /* delayed */);
-                    visibilityChanged(false);
+                    if (!mNotificationPanel.isFullyCollapsed()) {
+                        // close the shade if it was open
+                        animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL,
+                                true /* force */, true /* delayed */);
+                        visibilityChanged(false);
 
-                    return true;
+                        return true;
+                    } else {
+                        return false;
+                    }
                 }
             }, afterKeyguardGone);
         }
index 5baa7ff..ff01eb7 100644 (file)
@@ -226,7 +226,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
             if (mOccluded) {
                 mStatusBar.hideKeyguard();
                 mStatusBar.stopWaitingForKeyguardExit();
-                hideBouncer(false /* destroyView */);
+                if (hideBouncerWhenShowing || mBouncer.needsFullscreenBouncer()) {
+                    hideBouncer(false /* destroyView */);
+                }
             } else {
                 showBouncerOrKeyguard(hideBouncerWhenShowing);
             }