From 91ffdc4194181f17e74c1faef4cb002274f04a75 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Fri, 4 Aug 2017 18:14:41 +0200 Subject: [PATCH] AOD: Fix launching notifications from occluded AOD 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. --- .../systemui/statusbar/phone/StatusBar.java | 37 ++++++++++++------- .../phone/StatusBarKeyguardViewManager.java | 4 +- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 68caab1a7a8d6..3d2213bf56e85 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -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); } 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 5baa7ff4a6333..ff01eb756b9dd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -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); }