Merge "Making sure QS are not closed when split shade is open" into tm-qpr-dev am: 99db8bd98e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21465169

Change-Id: I3cc085b817d3419e4521b42d05b06d519297e55b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Michał Brzeziński
2023-02-22 17:15:59 +00:00
committed by Automerger Merge Worker
3 changed files with 20 additions and 7 deletions

View File

@@ -1778,7 +1778,7 @@ public final class NotificationPanelViewController implements Dumpable {
if (animate && !isFullyCollapsed()) { if (animate && !isFullyCollapsed()) {
animateCloseQs(true); animateCloseQs(true);
} else { } else {
mQsController.closeQs(); closeQsIfPossible();
} }
mNotificationStackScrollLayoutController.setOverScrollAmount(0f, true /* onTop */, animate, mNotificationStackScrollLayoutController.setOverScrollAmount(0f, true /* onTop */, animate,
!animate /* cancelAnimators */); !animate /* cancelAnimators */);
@@ -4030,9 +4030,17 @@ public final class NotificationPanelViewController implements Dumpable {
return mExpandingFromHeadsUp; return mExpandingFromHeadsUp;
} }
/** TODO: remove need for this delegate (b/254870148) */ /**
public void closeQs() { * We don't always want to close QS when requested as shade might be in a different state
mQsController.closeQs(); * already e.g. when going from collapse to expand very quickly. In that case StatusBar
* window might send signal to collapse QS but we might be already expanding and in split
* shade QS are always expanded
*/
private void closeQsIfPossible() {
boolean openOrOpening = isShadeFullyOpen() || isExpanding();
if (!(mSplitShadeEnabled && openOrOpening)) {
mQsController.closeQs();
}
} }
/** TODO: remove need for this delegate (b/254870148) */ /** TODO: remove need for this delegate (b/254870148) */

View File

@@ -663,8 +663,15 @@ public class QuickSettingsController {
mDozing = dozing; mDozing = dozing;
} }
/** set QS state to closed */ /**
* This method closes QS but in split shade it should be used only in special cases: to make
* sure QS closes when shade is closed as well. Otherwise it will result in QS disappearing
* from split shade
*/
public void closeQs() { public void closeQs() {
if (mSplitShadeEnabled) {
mShadeLog.d("Closing QS while in split shade");
}
cancelExpansionAnimation(); cancelExpansionAnimation();
setExpansionHeight(getMinExpansionHeight()); setExpansionHeight(getMinExpansionHeight());
// qsExpandImmediate is a safety latch in case we're calling closeQS while we're in the // qsExpandImmediate is a safety latch in case we're calling closeQS while we're in the

View File

@@ -270,8 +270,6 @@ public final class ShadeControllerImpl implements ShadeController {
// Ensure the panel is fully collapsed (just in case; bug 6765842, 7260868) // Ensure the panel is fully collapsed (just in case; bug 6765842, 7260868)
mNotificationPanelViewController.collapsePanel(false, false, 1.0f); mNotificationPanelViewController.collapsePanel(false, false, 1.0f);
mNotificationPanelViewController.closeQs();
mExpandedVisible = false; mExpandedVisible = false;
notifyVisibilityChanged(false); notifyVisibilityChanged(false);