Loading packages/SystemUI/src/com/android/systemui/scene/shared/flag/SceneContainerFlags.kt +3 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.systemui.keyguard.KeyguardWmStateRefactor import com.android.systemui.keyguard.MigrateClocksToBlueprint import com.android.systemui.keyguard.shared.ComposeLockscreen import com.android.systemui.media.controls.util.MediaInSceneContainerFlag import com.android.systemui.statusbar.phone.PredictiveBackSysUiFlag import dagger.Module import dagger.Provides Loading @@ -44,7 +45,8 @@ object SceneContainerFlag { MigrateClocksToBlueprint.isEnabled && ComposeLockscreen.isEnabled && MediaInSceneContainerFlag.isEnabled && KeyguardWmStateRefactor.isEnabled KeyguardWmStateRefactor.isEnabled && PredictiveBackSysUiFlag.isEnabled // NOTE: Changes should also be made in getSecondaryFlags and @EnableSceneContainer /** The main aconfig flag. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +2 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import static androidx.lifecycle.Lifecycle.State.RESUMED; import static com.android.systemui.Dependency.TIME_TICK_HANDLER_NAME; import static com.android.systemui.Flags.lightRevealMigration; import static com.android.systemui.Flags.newAodTransition; import static com.android.systemui.Flags.predictiveBackSysui; import static com.android.systemui.Flags.truncatedStatusBarIconsFix; import static com.android.systemui.charging.WirelessChargingAnimation.UNKNOWN_BATTERY_LEVEL; import static com.android.systemui.statusbar.NotificationLockscreenUserManager.PERMISSION_SELF; Loading Loading @@ -837,7 +836,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mLightRevealScrimViewModelLazy = lightRevealScrimViewModelLazy; mLightRevealScrim = lightRevealScrim; if (predictiveBackSysui()) { if (PredictiveBackSysUiFlag.isEnabled()) { mContext.getApplicationInfo().setEnableOnBackInvokedCallback(true); } } Loading Loading @@ -3061,7 +3060,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { public void onConfigChanged(Configuration newConfig) { updateResources(); updateDisplaySize(); // populates mDisplayMetrics if (predictiveBackSysui()) { if (PredictiveBackSysUiFlag.isEnabled()) { mContext.getApplicationInfo().setEnableOnBackInvokedCallback(true); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PredictiveBackSysUiFlag.kt 0 → 100644 +53 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar.phone import com.android.systemui.Flags import com.android.systemui.flags.FlagToken import com.android.systemui.flags.RefactorFlagUtils /** Helper for reading or using the predictive back flag state. */ @Suppress("NOTHING_TO_INLINE") object PredictiveBackSysUiFlag { /** The aconfig flag name */ const val FLAG_NAME = Flags.FLAG_PREDICTIVE_BACK_SYSUI /** A token used for dependency declaration */ val token: FlagToken get() = FlagToken(FLAG_NAME, isEnabled) /** Is the refactor enabled */ @JvmStatic inline val isEnabled get() = Flags.predictiveBackSysui() /** * Called to ensure code is only run when the flag is enabled. This protects users from the * unintended behaviors caused by accidentally running new logic, while also crashing on an eng * build to ensure that the refactor author catches issues in testing. */ @JvmStatic inline fun isUnexpectedlyInLegacyMode() = RefactorFlagUtils.isUnexpectedlyInLegacyMode(isEnabled, FLAG_NAME) /** * Called to ensure code is only run when the flag is disabled. This will throw an exception if * the flag is enabled to ensure that the refactor author catches issues in testing. */ @JvmStatic inline fun assertInLegacyMode() = RefactorFlagUtils.assertInLegacyMode(isEnabled, FLAG_NAME) } packages/SystemUI/tests/utils/src/com/android/systemui/flags/EnableSceneContainer.kt +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.systemui.Flags.FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR import com.android.systemui.Flags.FLAG_KEYGUARD_WM_STATE_REFACTOR import com.android.systemui.Flags.FLAG_MEDIA_IN_SCENE_CONTAINER import com.android.systemui.Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT import com.android.systemui.Flags.FLAG_PREDICTIVE_BACK_SYSUI import com.android.systemui.Flags.FLAG_SCENE_CONTAINER /** Loading @@ -35,6 +36,7 @@ import com.android.systemui.Flags.FLAG_SCENE_CONTAINER FLAG_COMPOSE_LOCKSCREEN, FLAG_MEDIA_IN_SCENE_CONTAINER, FLAG_KEYGUARD_WM_STATE_REFACTOR, FLAG_PREDICTIVE_BACK_SYSUI, ) @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.FUNCTION, AnnotationTarget.CLASS) Loading Loading
packages/SystemUI/src/com/android/systemui/scene/shared/flag/SceneContainerFlags.kt +3 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.systemui.keyguard.KeyguardWmStateRefactor import com.android.systemui.keyguard.MigrateClocksToBlueprint import com.android.systemui.keyguard.shared.ComposeLockscreen import com.android.systemui.media.controls.util.MediaInSceneContainerFlag import com.android.systemui.statusbar.phone.PredictiveBackSysUiFlag import dagger.Module import dagger.Provides Loading @@ -44,7 +45,8 @@ object SceneContainerFlag { MigrateClocksToBlueprint.isEnabled && ComposeLockscreen.isEnabled && MediaInSceneContainerFlag.isEnabled && KeyguardWmStateRefactor.isEnabled KeyguardWmStateRefactor.isEnabled && PredictiveBackSysUiFlag.isEnabled // NOTE: Changes should also be made in getSecondaryFlags and @EnableSceneContainer /** The main aconfig flag. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +2 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import static androidx.lifecycle.Lifecycle.State.RESUMED; import static com.android.systemui.Dependency.TIME_TICK_HANDLER_NAME; import static com.android.systemui.Flags.lightRevealMigration; import static com.android.systemui.Flags.newAodTransition; import static com.android.systemui.Flags.predictiveBackSysui; import static com.android.systemui.Flags.truncatedStatusBarIconsFix; import static com.android.systemui.charging.WirelessChargingAnimation.UNKNOWN_BATTERY_LEVEL; import static com.android.systemui.statusbar.NotificationLockscreenUserManager.PERMISSION_SELF; Loading Loading @@ -837,7 +836,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mLightRevealScrimViewModelLazy = lightRevealScrimViewModelLazy; mLightRevealScrim = lightRevealScrim; if (predictiveBackSysui()) { if (PredictiveBackSysUiFlag.isEnabled()) { mContext.getApplicationInfo().setEnableOnBackInvokedCallback(true); } } Loading Loading @@ -3061,7 +3060,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { public void onConfigChanged(Configuration newConfig) { updateResources(); updateDisplaySize(); // populates mDisplayMetrics if (predictiveBackSysui()) { if (PredictiveBackSysUiFlag.isEnabled()) { mContext.getApplicationInfo().setEnableOnBackInvokedCallback(true); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PredictiveBackSysUiFlag.kt 0 → 100644 +53 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar.phone import com.android.systemui.Flags import com.android.systemui.flags.FlagToken import com.android.systemui.flags.RefactorFlagUtils /** Helper for reading or using the predictive back flag state. */ @Suppress("NOTHING_TO_INLINE") object PredictiveBackSysUiFlag { /** The aconfig flag name */ const val FLAG_NAME = Flags.FLAG_PREDICTIVE_BACK_SYSUI /** A token used for dependency declaration */ val token: FlagToken get() = FlagToken(FLAG_NAME, isEnabled) /** Is the refactor enabled */ @JvmStatic inline val isEnabled get() = Flags.predictiveBackSysui() /** * Called to ensure code is only run when the flag is enabled. This protects users from the * unintended behaviors caused by accidentally running new logic, while also crashing on an eng * build to ensure that the refactor author catches issues in testing. */ @JvmStatic inline fun isUnexpectedlyInLegacyMode() = RefactorFlagUtils.isUnexpectedlyInLegacyMode(isEnabled, FLAG_NAME) /** * Called to ensure code is only run when the flag is disabled. This will throw an exception if * the flag is enabled to ensure that the refactor author catches issues in testing. */ @JvmStatic inline fun assertInLegacyMode() = RefactorFlagUtils.assertInLegacyMode(isEnabled, FLAG_NAME) }
packages/SystemUI/tests/utils/src/com/android/systemui/flags/EnableSceneContainer.kt +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.systemui.Flags.FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR import com.android.systemui.Flags.FLAG_KEYGUARD_WM_STATE_REFACTOR import com.android.systemui.Flags.FLAG_MEDIA_IN_SCENE_CONTAINER import com.android.systemui.Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT import com.android.systemui.Flags.FLAG_PREDICTIVE_BACK_SYSUI import com.android.systemui.Flags.FLAG_SCENE_CONTAINER /** Loading @@ -35,6 +36,7 @@ import com.android.systemui.Flags.FLAG_SCENE_CONTAINER FLAG_COMPOSE_LOCKSCREEN, FLAG_MEDIA_IN_SCENE_CONTAINER, FLAG_KEYGUARD_WM_STATE_REFACTOR, FLAG_PREDICTIVE_BACK_SYSUI, ) @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.FUNCTION, AnnotationTarget.CLASS) Loading