Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cd7cbd0 authored by mpodolian's avatar mpodolian
Browse files

Moved onStackExpandChanged() out of the onImeHidden Runnable.

This is an attempt to fix b/435098356 where shell does not properly
notify system of bubble bar is collapsed.

Moved onStackExpandChanged() out of the onImeHidden Runnable in
BubbleStackView.

Also call onStackExpandChanged(false) on BubbleController.setSysuiProxy
to handle case if shell has crashed while bubbles stack was expanded.

Fixes: 435098356
Flag: com.android.wm.shell.fix_bubbles_expanded_sysui_flag
Test: Manual. Checked that b/391909607, b/379474417 & b/432344114 not
reproducing with this change.

Change-Id: Iac0f251b638fcf27c676b4ae3ad2c5cac1249267
parent 00fdb75c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1452,6 +1452,10 @@ public class BubbleController implements ConfigurationChangeListener,

    private void setSysuiProxy(Bubbles.SysuiProxy proxy) {
        mSysuiProxy = proxy;
        if (Flags.fixBubblesExpandedSysuiFlag()) {
            // In case we crashed inform system that bubble bar is collapsed.
            mSysuiProxy.onStackExpandChanged(/* shouldExpand = */ false);
        }
    }

    @VisibleForTesting
+6 −2
Original line number Diff line number Diff line
@@ -2430,6 +2430,9 @@ public class BubbleStackView extends FrameLayout
            // case the IME gets hidden after we already were detached from the window.
            stopMonitoringSwipeUpGesture();
        }
        if (Flags.fixBubblesExpandedSysuiFlag()) {
            mSysuiProxyProvider.getSysuiProxy().onStackExpandChanged(shouldExpand);
        }

        // Do the actual expansion/collapse after the IME is hidden if it's currently visible in
        // order to avoid flickers
@@ -2438,8 +2441,9 @@ public class BubbleStackView extends FrameLayout
            if (!isAttachedToWindow()) {
                Log.w(TAG, "onImeHidden runnable running but we're not attached.");
            }
            if (!Flags.fixBubblesExpandedSysuiFlag()) {
                mSysuiProxyProvider.getSysuiProxy().onStackExpandChanged(shouldExpand);

            }
            if (wasExpanded) {
                animateCollapse();
                showManageMenu(false);
+3 −1
Original line number Diff line number Diff line
@@ -62,7 +62,6 @@ import com.android.systemui.shade.ShadeController;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.topui.TopUiController;
import com.android.systemui.statusbar.notification.NotifPipelineFlags;
import com.android.systemui.statusbar.notification.NotificationChannelHelper;
import com.android.systemui.statusbar.notification.collection.EntryAdapter;
@@ -79,6 +78,7 @@ import com.android.systemui.statusbar.phone.StatusBarWindowCallback;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.SensitiveNotificationProtectionController;
import com.android.systemui.statusbar.policy.ZenModeController;
import com.android.systemui.topui.TopUiController;
import com.android.wm.shell.bubbles.Bubble;
import com.android.wm.shell.bubbles.BubbleEntry;
import com.android.wm.shell.bubbles.Bubbles;
@@ -388,6 +388,8 @@ public class BubblesManager {

            @Override
            public void onStackExpandChanged(boolean shouldExpand) {
                ProtoLog.d(WM_SHELL_BUBBLES, "Updating bubbles_expanded sys flag to %b",
                        shouldExpand);
                sysuiMainExecutor.execute(() -> {
                    sysUiState.setFlag(QuickStepContract.SYSUI_STATE_BUBBLES_EXPANDED, shouldExpand)
                            .commitUpdate(mContext.getDisplayId());