Make StatusBarWindowController aware of assist session in progress.
Separate "assist is rendering something" from "assist session is in progress". If an assist session is in progress, the status bar should be focusable and back gestures should cause the session to be canceled. This also intercepts touches outside of the status bar when a session is in progress, but those touches will cancel (separate CL), so this shouldn't be a problem. Bug: 123413054 Test: Ensure in-progress assist sesion is canceled on back, ensure back is not affected outside of a session. Change-Id: Ife24b58a7851c5865ff75e66e00e32ae3293a0e8
This commit is contained in:
@@ -3294,6 +3294,11 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (mStatusBarWindowController.hasAssistActiveSession()) {
|
||||
// Back pressed during an assist session, cancel it.
|
||||
mAssistManager.hideAssist();
|
||||
return true;
|
||||
}
|
||||
if (mState != StatusBarState.KEYGUARD && mState != StatusBarState.SHADE_LOCKED) {
|
||||
if (mNotificationPanel.canPanelBeCollapsed()) {
|
||||
animateCollapsePanels();
|
||||
|
||||
@@ -208,7 +208,8 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
|
||||
|| state.bubbleExpanded) {
|
||||
mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
|
||||
} else if (state.isKeyguardShowingAndNotOccluded() || panelFocusable) {
|
||||
} else if (state.isKeyguardShowingAndNotOccluded() || panelFocusable
|
||||
|| state.assistActiveSession) {
|
||||
mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
mLpChanged.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
|
||||
} else {
|
||||
@@ -501,9 +502,13 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
|
||||
|
||||
/**
|
||||
* Sets whether assist UI is showing on the screen.
|
||||
*
|
||||
* @param assistShowing whether any assist UI is being shown.
|
||||
* @param activeSession whether AssistManager has an active assist session in progress.
|
||||
*/
|
||||
public void setAssistShowing(boolean assistShowing) {
|
||||
public void setAssistState(boolean assistShowing, boolean activeSession) {
|
||||
mCurrentState.assistShowing = assistShowing;
|
||||
mCurrentState.assistActiveSession = activeSession;
|
||||
apply(mCurrentState);
|
||||
}
|
||||
|
||||
@@ -514,6 +519,13 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
|
||||
return mCurrentState.assistShowing;
|
||||
}
|
||||
|
||||
/**
|
||||
* The AssistManager is handling an active assist session.
|
||||
*/
|
||||
public boolean hasAssistActiveSession() {
|
||||
return mCurrentState.assistActiveSession;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets if there is a bubble being expanded on the screen.
|
||||
*/
|
||||
@@ -590,7 +602,10 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
|
||||
boolean notTouchable;
|
||||
boolean bubblesShowing;
|
||||
boolean bubbleExpanded;
|
||||
// Assist manager is rendering any UI.
|
||||
boolean assistShowing;
|
||||
// Assist manager is handling an active assist session.
|
||||
boolean assistActiveSession;
|
||||
|
||||
/**
|
||||
* The {@link StatusBar} state from the status bar.
|
||||
|
||||
Reference in New Issue
Block a user