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

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

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

Merge cherrypicks of ['googleplex-android-review.googlesource.com/23053887', 'googleplex-android-review.googlesource.com/23054378', 'googleplex-android-review.googlesource.com/22733606', 'googleplex-android-review.googlesource.com/22912038', 'googleplex-android-review.googlesource.com/22915981', 'googleplex-android-review.googlesource.com/23048037', 'googleplex-android-review.googlesource.com/23103421'] into sparse-10099262-L86600000960563267.
SPARSE_CHANGE: I98618477a828eb72b2173af6988e804471139e81
SPARSE_CHANGE: Ic7b1c4b40960fd04de9efbf4f6d7abee45c93025
SPARSE_CHANGE: I1c51c6f66cd6967651068de1ffc2e6e8566f5a46
SPARSE_CHANGE: I35ba4652a125c8c83e18138f0fb0a51f3ef65b73
SPARSE_CHANGE: I2bfdc7801cec1b3aaa44f841d8a821214c6cb801
SPARSE_CHANGE: I62e829555c43136080ee4909f7dcf8c388165e9f
SPARSE_CHANGE: Ib4eef40a0f59512c669b069532e55d36293f9e1c

Change-Id: If333e1f0e70f3ac79663474de4417017bca30310
parents a056e027 ad3fb95a
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -368,6 +368,14 @@ void VulkanSurface::releaseBuffers() {
    }
}

void VulkanSurface::invalidateBuffers() {
    for (uint32_t i = 0; i < mWindowInfo.bufferCount; i++) {
        VulkanSurface::NativeBufferInfo& bufferInfo = mNativeBuffers[i];
        bufferInfo.hasValidContents = false;
        bufferInfo.lastPresentedCount = 0;
    }
}

VulkanSurface::NativeBufferInfo* VulkanSurface::dequeueNativeBuffer() {
    // Set the mCurrentBufferInfo to invalid in case of error and only reset it to the correct
    // value at the end of the function if everything dequeued correctly.
@@ -400,6 +408,10 @@ VulkanSurface::NativeBufferInfo* VulkanSurface::dequeueNativeBuffer() {
            // new NativeBufferInfo storage will be populated lazily as we dequeue each new buffer.
            mWindowInfo.actualSize = actualSize;
            releaseBuffers();
        } else {
            // A change in transform means we need to repaint the entire buffer area as the damage
            // rects have just moved about.
            invalidateBuffers();
        }

        if (transformHint != mWindowInfo.transform) {
+1 −0
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ private:
                                           WindowInfo* outWindowInfo);
    static bool UpdateWindow(ANativeWindow* window, const WindowInfo& windowInfo);
    void releaseBuffers();
    void invalidateBuffers();

    // TODO: This number comes from ui/BufferQueueDefs. We're not pulling the
    // header in so that we don't need to depend on libui, but we should share
+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);
Loading