From ac16eb2d73e27fe7d8d10aee112207ccdeffe0c2 Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Tue, 29 Apr 2025 15:38:05 -0700 Subject: [PATCH] Revert^2 "Store bubble bar state in sysui proxy" This reverts commit fbfec0d3e185004c2a3a6b0711656de572754ecb. Reason for revert: Per the comment in the bug, this test was still failing after the rollback: https://b.corp.google.com/issues/413593389#comment7. The real culprit was a flag which was rolled back here: https://b.corp.google.com/issues/413593389#comment10. Change-Id: Idd516b7c8576a3668f6248d8440da89867823df2 --- .../com/android/quickstep/SystemUiProxy.kt | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.kt b/quickstep/src/com/android/quickstep/SystemUiProxy.kt index a7b9d41828..04da731c39 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.kt +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.kt @@ -143,6 +143,10 @@ class SystemUiProxy @Inject constructor(@ApplicationContext private val context: private var desktopTaskListener: IDesktopTaskListener? = null private val remoteTransitions = LinkedHashMap() + // Save bubble bar state in case service is not bound yet when it is updated. SysUI relies on + // this to suppress the floating bubbles UI. + private var hasBubbleBar = false + private val stateChangeCallbacks: MutableList = ArrayList() private var originalTransactionToken: IBinder? = null @@ -264,6 +268,7 @@ class SystemUiProxy @Inject constructor(@ApplicationContext private val context: this.unfoldAnimation = if (Flags.enableUnfoldStateAnimation()) null else unfoldAnimation this.dragAndDrop = dragAndDrop linkToDeath() + setHasBubbleBar(hasBubbleBar) // re-attach the listeners once missing due to setProxy has not been initialized yet. setPipAnimationListener(pipAnimationListener) setBubblesListener(bubblesListener) @@ -559,6 +564,14 @@ class SystemUiProxy @Inject constructor(@ApplicationContext private val context: // // Bubbles // + /** Tells SysUI whether bubble bar is used or not. */ + fun setHasBubbleBar(hasBubbleBar: Boolean) { + executeWithErrorLog({ "Failed call setHasBubbleBar" }) { + bubbles?.setHasBubbleBar(hasBubbleBar) + } + this.hasBubbleBar = hasBubbleBar + } + /** Sets the listener to be notified of bubble state changes. */ fun setBubblesListener(listener: IBubblesListener?) { executeWithErrorLog({ "Failed call registerBubblesListener" }) { @@ -698,13 +711,6 @@ class SystemUiProxy @Inject constructor(@ApplicationContext private val context: } } - /** Tells SysUI whether bubble bar is used or not. */ - fun setHasBubbleBar(hasBubbleBar: Boolean) { - executeWithErrorLog({ "Failed call setHasBubbleBar" }) { - bubbles?.setHasBubbleBar(hasBubbleBar) - } - } - // // Splitscreen //