Loading packages/SystemUI/aconfig/systemui.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -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" Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/StatusBarTouchableRegionManagerTest.kt +19 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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() } } packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarTouchableRegionManager.java +14 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading @@ -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(); Loading Loading @@ -145,6 +148,9 @@ public final class StatusBarTouchableRegionManager implements Dumpable { javaAdapter.alwaysCollectFlow( shadeInteractor.isAnyExpanded(), this::onShadeOrQsExpanded); javaAdapter.alwaysCollectFlow( communalSceneInteractor.isCommunalVisible(), this::onCommunalVisible); } mPrimaryBouncerInteractor = primaryBouncerInteractor; Loading Loading @@ -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) Loading Loading @@ -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(); } Loading packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/StatusBarTouchableRegionManagerKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -43,5 +44,6 @@ var Kosmos.statusBarTouchableRegionManager by mock<UnlockedScreenOffAnimationController>(), primaryBouncerInteractor, alternateBouncerInteractor, communalSceneInteractor, ) } Loading
packages/SystemUI/aconfig/systemui.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -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" Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/StatusBarTouchableRegionManagerTest.kt +19 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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() } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarTouchableRegionManager.java +14 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading @@ -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(); Loading Loading @@ -145,6 +148,9 @@ public final class StatusBarTouchableRegionManager implements Dumpable { javaAdapter.alwaysCollectFlow( shadeInteractor.isAnyExpanded(), this::onShadeOrQsExpanded); javaAdapter.alwaysCollectFlow( communalSceneInteractor.isCommunalVisible(), this::onCommunalVisible); } mPrimaryBouncerInteractor = primaryBouncerInteractor; Loading Loading @@ -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) Loading Loading @@ -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(); } Loading
packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/StatusBarTouchableRegionManagerKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -43,5 +44,6 @@ var Kosmos.statusBarTouchableRegionManager by mock<UnlockedScreenOffAnimationController>(), primaryBouncerInteractor, alternateBouncerInteractor, communalSceneInteractor, ) }