Do not change scene when launching edit mode in STF

When scene container is disabled, the communal scene is rendered in
notifications shade over everything so needs to be hidden when edit mode
is launched. With scene container, hidding the scene container is
handled by STF so we do not need to manually do it.

Test: verified that edit mode is started correctly
Test: verified that upon dismissing edit mode, the screen goes back to
      GH. The device is however not locked which is tracked at b/365596274
Bug: 356141092
Flag: com.android.systemui.scene_container
Change-Id: I1bb8fdf7bcaa49f58f9c1296941396801e9e20f7
diff --git a/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt b/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt
index d84dc20..13b4aa9 100644
--- a/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt
+++ b/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt
@@ -50,6 +50,7 @@
 import com.android.systemui.log.LogBuffer
 import com.android.systemui.log.core.Logger
 import com.android.systemui.log.dagger.CommunalLog
+import com.android.systemui.scene.shared.flag.SceneContainerFlag
 import javax.inject.Inject
 import kotlinx.coroutines.flow.first
 import kotlinx.coroutines.launch
@@ -244,15 +245,18 @@
     private fun listenForTransitionAndChangeScene() {
         lifecycleScope.launch {
             communalViewModel.canShowEditMode.collect {
-                communalViewModel.changeScene(
-                    scene = CommunalScenes.Blank,
-                    loggingReason = "edit mode opening",
-                    transitionKey = CommunalTransitionKeys.ToEditMode,
-                    keyguardState = KeyguardState.GONE,
-                )
-                // wait till transitioned to Blank scene, then animate in communal content in
-                // edit mode
-                communalViewModel.currentScene.first { it == CommunalScenes.Blank }
+                if (!SceneContainerFlag.isEnabled) {
+                    communalViewModel.changeScene(
+                        scene = CommunalScenes.Blank,
+                        loggingReason = "edit mode opening",
+                        transitionKey = CommunalTransitionKeys.ToEditMode,
+                        keyguardState = KeyguardState.GONE,
+                    )
+                    // wait till transitioned to Blank scene, then animate in communal content in
+                    // edit mode
+                    communalViewModel.currentScene.first { it == CommunalScenes.Blank }
+                }
+
                 communalViewModel.setEditModeState(EditModeState.SHOWING)
 
                 // Inform the ActivityController that we are now fully visible.