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

Commit 86558a1e authored by William Xiao's avatar William Xiao Committed by Android (Google) Code Review
Browse files

Merge changes I16b73ae5,I142fe605 into main

* changes:
  Set touchable region to full screen when glanceable hub is visible
  Add glanceable hub on mobile flag
parents c8157f66 b16a870a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1153,6 +1153,13 @@ flag {
  bug: "352301247"
}

flag {
  name: "communal_hub_on_mobile"
  namespace: "systemui"
  description: "Brings the glanceable hub experience to mobile phones"
  bug: "375689917"
}

flag {
    name: "dream_overlay_updated_font"
    namespace: "systemui"
+19 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.compose.animation.scene.ObservableTransitionState
import com.android.systemui.SysuiTestCase
import com.android.systemui.communal.data.repository.fakeCommunalSceneRepository
import com.android.systemui.communal.shared.model.CommunalScenes
import com.android.systemui.flags.DisableSceneContainer
import com.android.systemui.flags.EnableSceneContainer
import com.android.systemui.kosmos.testScope
@@ -111,6 +113,23 @@ class StatusBarTouchableRegionManagerTest : SysuiTestCase() {
            )
            runCurrent()

            assertThat(underTest.shouldMakeEntireScreenTouchable()).isFalse()
        }

    @Test
    @DisableSceneContainer
    fun entireScreenTouchable_communalVisible() =
        testScope.runTest {
            assertThat(underTest.shouldMakeEntireScreenTouchable()).isFalse()

            kosmos.fakeCommunalSceneRepository.snapToScene(CommunalScenes.Communal)
            runCurrent()

            assertThat(underTest.shouldMakeEntireScreenTouchable()).isTrue()

            kosmos.fakeCommunalSceneRepository.snapToScene(CommunalScenes.Blank)
            runCurrent()

            assertThat(underTest.shouldMakeEntireScreenTouchable()).isFalse()
        }
}
+14 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import com.android.systemui.Dumpable;
import com.android.systemui.ScreenDecorations;
import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor;
import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor;
import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.res.R;
import com.android.systemui.scene.domain.interactor.SceneInteractor;
@@ -78,6 +79,7 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
    private View mNotificationShadeWindowView;
    private View mNotificationPanelView;
    private boolean mForceCollapsedUntilLayout = false;
    private Boolean mCommunalVisible = false;

    private Region mTouchableRegion = new Region();
    private int mDisplayCutoutTouchableRegionSize;
@@ -98,7 +100,8 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
            JavaAdapter javaAdapter,
            UnlockedScreenOffAnimationController unlockedScreenOffAnimationController,
            PrimaryBouncerInteractor primaryBouncerInteractor,
            AlternateBouncerInteractor alternateBouncerInteractor
            AlternateBouncerInteractor alternateBouncerInteractor,
            CommunalSceneInteractor communalSceneInteractor
    ) {
        mContext = context;
        initResources();
@@ -145,6 +148,9 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
            javaAdapter.alwaysCollectFlow(
                    shadeInteractor.isAnyExpanded(),
                    this::onShadeOrQsExpanded);
            javaAdapter.alwaysCollectFlow(
                    communalSceneInteractor.isCommunalVisible(),
                    this::onCommunalVisible);
        }

        mPrimaryBouncerInteractor = primaryBouncerInteractor;
@@ -196,6 +202,10 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
        }
    }

    private void onCommunalVisible(Boolean visible) {
        mCommunalVisible = visible;
    }

    /**
     * Calculates the touch region needed for heads up notifications, taking into consideration
     * any existing display cutouts (notch)
@@ -304,6 +314,9 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
                && (!mIsSceneContainerUiEmpty || mIsRemoteUserInteractionOngoing))
                || mPrimaryBouncerInteractor.isShowing().getValue()
                || mAlternateBouncerInteractor.isVisibleState()
                // The glanceable hub is a full-screen UI within the notification shade window. When
                // it's visible, the touchable region should be the full screen.
                || mCommunalVisible
                || mUnlockedScreenOffAnimationController.isAnimationPlaying();
    }

+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.statusbar.phone
import android.content.applicationContext
import com.android.systemui.bouncer.domain.interactor.alternateBouncerInteractor
import com.android.systemui.bouncer.domain.interactor.primaryBouncerInteractor
import com.android.systemui.communal.domain.interactor.communalSceneInteractor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.testScope
import com.android.systemui.scene.domain.interactor.sceneInteractor
@@ -43,5 +44,6 @@ var Kosmos.statusBarTouchableRegionManager by
            mock<UnlockedScreenOffAnimationController>(),
            primaryBouncerInteractor,
            alternateBouncerInteractor,
            communalSceneInteractor,
        )
    }