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

Commit 17c308a8 authored by Liran Binyamin's avatar Liran Binyamin
Browse files

Hide bubbles when the status bar window is hidden

This fixes a regression that was introduced sometime between ag/16631031 and ag/16631031.
Bubbles visibility at some point stopped accounting for the state of the status bar window.

Fixes: 299744258
Test: atest CentralSurfacesImpl
Test: - Take a screen record
     - Create a bubble
     - Launch Photos and and play the video
       - If the video doesn't play in full screen, go to full screen
     - Observe that bubbles disappear
     - Exit full screen
     - Observe that bubble re-appear
Change-Id: I68d7c391dcbb9606a98452e82d86d6a8f3e5028d
parent f1013e66
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -310,8 +310,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
            };

    void onStatusBarWindowStateChanged(@WindowVisibleState int state) {
        updateBubblesVisibility();
        mStatusBarWindowState = state;
        updateBubblesVisibility();
    }

    @Override
@@ -1723,7 +1723,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
        StatusBarMode mode = mStatusBarModeRepository.getStatusBarMode().getValue();
        mBubblesOptional.ifPresent(bubbles -> bubbles.onStatusBarVisibilityChanged(
                mode != StatusBarMode.LIGHTS_OUT
                        && mode != StatusBarMode.LIGHTS_OUT_TRANSPARENT));
                        && mode != StatusBarMode.LIGHTS_OUT_TRANSPARENT
                        && mStatusBarWindowState != WINDOW_STATE_HIDDEN));
    }

    void checkBarMode(
+12 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.systemui.statusbar.phone;

import static android.app.NotificationManager.IMPORTANCE_HIGH;
import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_PEEK;
import static android.app.StatusBarManager.WINDOW_STATE_HIDDEN;
import static android.app.StatusBarManager.WINDOW_STATE_SHOWING;

import static com.android.systemui.statusbar.StatusBarState.KEYGUARD;
import static com.android.systemui.statusbar.StatusBarState.SHADE;
@@ -1110,6 +1112,16 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
        // THEN no NPE when fingerprintManager is null
    }

    @Test
    public void bubbleBarVisibility() {
        createCentralSurfaces();
        mCentralSurfaces.onStatusBarWindowStateChanged(WINDOW_STATE_HIDDEN);
        verify(mBubbles).onStatusBarVisibilityChanged(false);

        mCentralSurfaces.onStatusBarWindowStateChanged(WINDOW_STATE_SHOWING);
        verify(mBubbles).onStatusBarVisibilityChanged(true);
    }

    /**
     * Configures the appropriate mocks and then calls {@link CentralSurfacesImpl#updateIsKeyguard}
     * to reconfigure the keyguard to reflect the requested showing/occluded states.