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

Commit 48782c07 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/22733606',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/22733606', 'googleplex-android-review.googlesource.com/22912038', 'googleplex-android-review.googlesource.com/22915981'] into sparse-10025418-L15100000960301099.
SPARSE_CHANGE: I1c51c6f66cd6967651068de1ffc2e6e8566f5a46
SPARSE_CHANGE: I35ba4652a125c8c83e18138f0fb0a51f3ef65b73
SPARSE_CHANGE: I2bfdc7801cec1b3aaa44f841d8a821214c6cb801

Change-Id: If4b2156fe647ff95b3b6be9757aab5f91e4eed89
parents d3b2aaf2 30107862
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2843,6 +2843,7 @@ public final class NotificationPanelViewController implements Dumpable {
    /** Set whether the bouncer is showing. */
    public void setBouncerShowing(boolean bouncerShowing) {
        mBouncerShowing = bouncerShowing;
        mNotificationStackScrollLayoutController.updateShowEmptyShadeView();
        updateVisibility();
    }

+2 −1
Original line number Diff line number Diff line
@@ -1240,7 +1240,8 @@ public class NotificationStackScrollLayoutController {
                // Hide empty shade view when in transition to Keyguard.
                // That avoids "No Notifications" to blink when transitioning to AOD.
                // For more details, see: b/228790482
                && !isInTransitionToKeyguard();
                && !isInTransitionToKeyguard()
                && !mCentralSurfaces.isBouncerShowing();

        mView.updateEmptyShadeView(shouldShow, mZenModeController.areNotificationsHiddenInShade());

+28 −0
Original line number Diff line number Diff line
@@ -294,6 +294,34 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase {
                /* notifVisibleInShade= */ false);
    }

    @Test
    public void testUpdateEmptyShadeView_bouncerShowing_hideEmptyView() {
        when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false);
        mController.attach(mNotificationStackScrollLayout);

        when(mCentralSurfaces.isBouncerShowing()).thenReturn(true);
        setupShowEmptyShadeViewState(true);
        reset(mNotificationStackScrollLayout);
        mController.updateShowEmptyShadeView();
        verify(mNotificationStackScrollLayout).updateEmptyShadeView(
                /* visible= */ false,
                /* areNotificationsHiddenInShade= */ false);
    }

    @Test
    public void testUpdateEmptyShadeView_bouncerNotShowing_showEmptyView() {
        when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false);
        mController.attach(mNotificationStackScrollLayout);

        when(mCentralSurfaces.isBouncerShowing()).thenReturn(false);
        setupShowEmptyShadeViewState(true);
        reset(mNotificationStackScrollLayout);
        mController.updateShowEmptyShadeView();
        verify(mNotificationStackScrollLayout).updateEmptyShadeView(
                /* visible= */ true,
                /* areNotificationsHiddenInShade= */ false);
    }

    @Test
    public void testOnUserChange_verifySensitiveProfile() {
        when(mNotificationLockscreenUserManager.isAnyProfilePublicMode()).thenReturn(true);
+4 −5
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.server.wm;

import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.view.Display.TYPE_INTERNAL;
import static android.view.InsetsState.ITYPE_BOTTOM_MANDATORY_GESTURES;
import static android.view.InsetsState.ITYPE_BOTTOM_TAPPABLE_ELEMENT;
@@ -2382,16 +2381,16 @@ public class DisplayPolicy {

    private int updateSystemBarsLw(WindowState win, int disableFlags) {
        final TaskDisplayArea defaultTaskDisplayArea = mDisplayContent.getDefaultTaskDisplayArea();
        final boolean multiWindowTaskVisible =
        final boolean adjacentTasksVisible =
                defaultTaskDisplayArea.getRootTask(task -> task.isVisible()
                        && task.getTopLeafTask().getWindowingMode() == WINDOWING_MODE_MULTI_WINDOW)
                        && task.getAdjacentTask() != null)
                        != null;
        final boolean freeformRootTaskVisible =
                defaultTaskDisplayArea.isRootTaskVisible(WINDOWING_MODE_FREEFORM);

        // We need to force showing system bars when the multi-window or freeform root task is
        // visible.
        mForceShowSystemBars = multiWindowTaskVisible || freeformRootTaskVisible;
        mForceShowSystemBars = adjacentTasksVisible || freeformRootTaskVisible;
        // We need to force the consumption of the system bars if they are force shown or if they
        // are controlled by a remote insets controller.
        mForceConsumeSystemBars = mForceShowSystemBars
@@ -2412,7 +2411,7 @@ public class DisplayPolicy {

        int appearance = APPEARANCE_OPAQUE_NAVIGATION_BARS | APPEARANCE_OPAQUE_STATUS_BARS;
        appearance = configureStatusBarOpacity(appearance);
        appearance = configureNavBarOpacity(appearance, multiWindowTaskVisible,
        appearance = configureNavBarOpacity(appearance, adjacentTasksVisible,
                freeformRootTaskVisible);

        final boolean requestHideNavBar = !win.getRequestedVisibility(ITYPE_NAVIGATION_BAR);
+16 −0
Original line number Diff line number Diff line
@@ -2385,6 +2385,22 @@ class Task extends TaskFragment {
        return parentTask == null ? null : parentTask.getCreatedByOrganizerTask();
    }

    /** @return the first adjacent task of this task or its parent. */
    @Nullable
    Task getAdjacentTask() {
        final TaskFragment adjacentTaskFragment = getAdjacentTaskFragment();
        if (adjacentTaskFragment != null && adjacentTaskFragment.asTask() != null) {
            return adjacentTaskFragment.asTask();
        }

        final WindowContainer parent = getParent();
        if (parent == null || parent.asTask() == null) {
            return null;
        }

        return parent.asTask().getAdjacentTask();
    }

    // TODO(task-merge): Figure out what's the right thing to do for places that used it.
    boolean isRootTask() {
        return getRootTask() == this;
Loading