summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Bryce Lee <brycelee@google.com> 2025-03-12 15:02:32 -0700
committer Bryce Lee <brycelee@google.com> 2025-03-12 22:10:04 +0000
commite295561e2c7f68dec2e1abbd5831cd716b57280c (patch)
tree7f4c7d406fcdccbb3cfbf0ba22ffc8e021e901a9
parent277d34d54e511997628ced63a3e158edc37cb080 (diff)
Remove ambient status bar from Glanceable Hub.
This changelist removes the ambient status bar from Glanceable Hub in favor of using the standard keyguard status bar. Test: KeyguardStatusBarViewControllerTest Fixes: 399687381 Flag: com.android.systemui.glanceable_hub_v2 Change-Id: I10ff51838b58b84c50093b947eaafd8f2bfbd00b
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContainer.kt9
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt7
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java17
4 files changed, 24 insertions, 11 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContainer.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContainer.kt
index 3150e94908cd..2b8fe39c4870 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContainer.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContainer.kt
@@ -47,6 +47,7 @@ import com.android.compose.animation.scene.observableTransitionState
import com.android.compose.animation.scene.rememberMutableSceneTransitionLayoutState
import com.android.compose.animation.scene.transitions
import com.android.compose.modifiers.thenIf
+import com.android.systemui.Flags
import com.android.systemui.communal.shared.model.CommunalBackgroundType
import com.android.systemui.communal.shared.model.CommunalScenes
import com.android.systemui.communal.shared.model.CommunalTransitionKeys
@@ -104,7 +105,9 @@ val sceneTransitionsV2 = transitions {
fade(Communal.Elements.Grid)
fade(Communal.Elements.IndicationArea)
fade(Communal.Elements.LockIcon)
- fade(Communal.Elements.StatusBar)
+ if (!Flags.glanceableHubV2()) {
+ fade(Communal.Elements.StatusBar)
+ }
}
timestampRange(startMillis = 167, endMillis = 334) { fade(Communal.Elements.Scrim) }
}
@@ -131,7 +134,9 @@ val sceneTransitions = transitions {
fade(Communal.Elements.Grid)
fade(Communal.Elements.IndicationArea)
fade(Communal.Elements.LockIcon)
- fade(Communal.Elements.StatusBar)
+ if (!Flags.glanceableHubV2()) {
+ fade(Communal.Elements.StatusBar)
+ }
}
timestampRange(startMillis = 167, endMillis = 334) { fade(Communal.Elements.Scrim) }
}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt
index 2d03e2bcdd19..0181928317e1 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt
@@ -29,6 +29,7 @@ import androidx.compose.ui.unit.IntRect
import androidx.compose.ui.unit.dp
import androidx.compose.ui.zIndex
import com.android.compose.animation.scene.ContentScope
+import com.android.systemui.Flags
import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor
import com.android.systemui.communal.smartspace.SmartspaceInteractionHandler
import com.android.systemui.communal.ui.compose.section.AmbientStatusBarSection
@@ -70,8 +71,10 @@ constructor(
content = {
Box(modifier = Modifier.fillMaxSize()) {
with(communalPopupSection) { Popup() }
- with(ambientStatusBarSection) {
- AmbientStatusBar(modifier = Modifier.fillMaxWidth().zIndex(1f))
+ if (!Flags.glanceableHubV2()) {
+ with(ambientStatusBarSection) {
+ AmbientStatusBar(modifier = Modifier.fillMaxWidth().zIndex(1f))
+ }
}
CommunalHub(
viewModel = viewModel,
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.kt
index 46430afecbb1..1f37291efbab 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.kt
@@ -790,6 +790,7 @@ class KeyguardStatusBarViewControllerTest : SysuiTestCase() {
}
@Test
+ @DisableFlags(Flags.FLAG_GLANCEABLE_HUB_V2)
fun animateToGlanceableHub_affectsAlpha() =
testScope.runTest {
try {
@@ -809,6 +810,7 @@ class KeyguardStatusBarViewControllerTest : SysuiTestCase() {
}
@Test
+ @DisableFlags(Flags.FLAG_GLANCEABLE_HUB_V2)
fun animateToGlanceableHub_alphaResetOnCommunalNotShowing() =
testScope.runTest {
try {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java
index 36193bd87ce2..3c144625b685 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java
@@ -49,6 +49,7 @@ import com.android.keyguard.CarrierTextController;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.keyguard.logging.KeyguardLogger;
+import com.android.systemui.Flags;
import com.android.systemui.battery.BatteryMeterViewController;
import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor;
import com.android.systemui.dagger.qualifiers.Background;
@@ -475,12 +476,14 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
UserHandle.USER_ALL);
updateUserSwitcher();
onThemeChanged();
- collectFlow(mView, mCommunalSceneInteractor.isCommunalVisible(), mCommunalConsumer,
- mCoroutineDispatcher);
- collectFlow(mView, mLockscreenToHubTransitionViewModel.getStatusBarAlpha(),
- mToGlanceableHubStatusBarAlphaConsumer, mCoroutineDispatcher);
- collectFlow(mView, mHubToLockscreenTransitionViewModel.getStatusBarAlpha(),
- mFromGlanceableHubStatusBarAlphaConsumer, mCoroutineDispatcher);
+ if (!Flags.glanceableHubV2()) {
+ collectFlow(mView, mCommunalSceneInteractor.isCommunalVisible(), mCommunalConsumer,
+ mCoroutineDispatcher);
+ collectFlow(mView, mLockscreenToHubTransitionViewModel.getStatusBarAlpha(),
+ mToGlanceableHubStatusBarAlphaConsumer, mCoroutineDispatcher);
+ collectFlow(mView, mHubToLockscreenTransitionViewModel.getStatusBarAlpha(),
+ mFromGlanceableHubStatusBarAlphaConsumer, mCoroutineDispatcher);
+ }
if (NewStatusBarIcons.isEnabled()) {
ComposeView batteryComposeView = new ComposeView(mContext);
UnifiedBatteryViewBinder.bind(
@@ -645,7 +648,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
&& !mDozing
&& !hideForBypass
&& !mDisableStateTracker.isDisabled()
- && (!mCommunalShowing || mExplicitAlpha != -1)
+ && (Flags.glanceableHubV2() || (!mCommunalShowing || mExplicitAlpha != -1))
? View.VISIBLE : View.INVISIBLE;
updateViewState(newAlpha, newVisibility);