Loading core/java/android/window/DesktopModeFlags.java +2 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,8 @@ public enum DesktopModeFlags { ENABLE_DESKTOP_APP_LAUNCH_ALTTAB_TRANSITIONS( Flags::enableDesktopAppLaunchAlttabTransitions, false), ENABLE_DESKTOP_APP_LAUNCH_TRANSITIONS( Flags::enableDesktopAppLaunchTransitions, false); Flags::enableDesktopAppLaunchTransitions, false), ENABLE_DESKTOP_WINDOWING_PERSISTENCE(Flags::enableDesktopWindowingPersistence, false); private static final String TAG = "DesktopModeFlagsUtil"; // Function called to obtain aconfig flag value. Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopRepository.kt +5 −5 Original line number Diff line number Diff line Loading @@ -23,12 +23,12 @@ import android.util.ArrayMap import android.util.ArraySet import android.util.SparseArray import android.view.Display.INVALID_DISPLAY import android.window.DesktopModeFlags import android.window.WindowContainerToken import androidx.core.util.forEach import androidx.core.util.keyIterator import androidx.core.util.valueIterator import com.android.internal.protolog.ProtoLog import com.android.window.flags.Flags import com.android.wm.shell.desktopmode.persistence.DesktopPersistentRepository import com.android.wm.shell.desktopmode.persistence.DesktopRepositoryInitializer import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE Loading Loading @@ -294,7 +294,7 @@ class DesktopRepository ( taskId, isVisible, displayId) logD("VisibleTaskCount has changed from %d to %d", prevCount, newCount) notifyVisibleTaskListeners(displayId, newCount) if (Flags.enableDesktopWindowingPersistence()) { if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue()) { updatePersistentRepository(displayId) } } Loading Loading @@ -344,7 +344,7 @@ class DesktopRepository ( desktopTaskDataByDisplayId.getOrCreate(displayId).freeformTasksInZOrder.add(0, taskId) // Unminimize the task if it is minimized. unminimizeTask(displayId, taskId) if (Flags.enableDesktopWindowingPersistence()) { if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue()) { updatePersistentRepository(displayId) } } Loading @@ -362,7 +362,7 @@ class DesktopRepository ( desktopTaskDataByDisplayId.getOrCreate(displayId).minimizedTasks.add(taskId) } updateTask(displayId, taskId, isVisible = false) if (Flags.enableDesktopWindowingPersistence()) { if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue()) { updatePersistentRepository(displayId) } } Loading Loading @@ -410,7 +410,7 @@ class DesktopRepository ( unminimizeTask(displayId, taskId) removeActiveTask(taskId) removeVisibleTask(taskId) if (Flags.enableDesktopWindowingPersistence()) { if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue()) { updatePersistentRepository(displayId) } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +1 −1 Original line number Diff line number Diff line Loading @@ -1161,7 +1161,7 @@ class DesktopTasksController( if (runningTaskInfo != null) { // Task is already running, reorder it to the front wct.reorder(runningTaskInfo.token, /* onTop= */ true) } else if (Flags.enableDesktopWindowingPersistence()) { } else if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue()) { // Task is not running, start it wct.startTask( taskId, Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/persistence/DesktopRepositoryInitializerImpl.kt +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.wm.shell.desktopmode.persistence import android.content.Context import com.android.window.flags.Flags import android.window.DesktopModeFlags import com.android.wm.shell.desktopmode.DesktopRepository import com.android.wm.shell.shared.annotations.ShellMainThread import com.android.wm.shell.shared.desktopmode.DesktopModeStatus Loading @@ -36,7 +36,7 @@ class DesktopRepositoryInitializerImpl( @ShellMainThread private val mainCoroutineScope: CoroutineScope, ) : DesktopRepositoryInitializer { override fun initialize(repository: DesktopRepository) { if (!Flags.enableDesktopWindowingPersistence()) return if (!DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue()) return // TODO: b/365962554 - Handle the case that user moves to desktop before it's initialized mainCoroutineScope.launch { val desktop = persistentRepository.readDesktop() ?: return@launch Loading libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java +1 −2 Original line number Diff line number Diff line Loading @@ -47,7 +47,6 @@ import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import com.android.internal.protolog.ProtoLog; import com.android.window.flags.Flags; import com.android.wm.shell.common.ExternalInterfaceBinder; import com.android.wm.shell.common.RemoteCallable; import com.android.wm.shell.common.ShellExecutor; Loading Loading @@ -444,7 +443,7 @@ public class RecentTasksController implements TaskStackListenerCallback, // If task has their app bounds set to null which happens after reboot, set the // app bounds to persisted lastFullscreenBounds. Also set the position in parent // to the top left of the bounds. if (Flags.enableDesktopWindowingPersistence() if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue() && taskInfo.configuration.windowConfiguration.getAppBounds() == null) { taskInfo.configuration.windowConfiguration.setAppBounds( taskInfo.lastNonFullscreenBounds); Loading Loading
core/java/android/window/DesktopModeFlags.java +2 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,8 @@ public enum DesktopModeFlags { ENABLE_DESKTOP_APP_LAUNCH_ALTTAB_TRANSITIONS( Flags::enableDesktopAppLaunchAlttabTransitions, false), ENABLE_DESKTOP_APP_LAUNCH_TRANSITIONS( Flags::enableDesktopAppLaunchTransitions, false); Flags::enableDesktopAppLaunchTransitions, false), ENABLE_DESKTOP_WINDOWING_PERSISTENCE(Flags::enableDesktopWindowingPersistence, false); private static final String TAG = "DesktopModeFlagsUtil"; // Function called to obtain aconfig flag value. Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopRepository.kt +5 −5 Original line number Diff line number Diff line Loading @@ -23,12 +23,12 @@ import android.util.ArrayMap import android.util.ArraySet import android.util.SparseArray import android.view.Display.INVALID_DISPLAY import android.window.DesktopModeFlags import android.window.WindowContainerToken import androidx.core.util.forEach import androidx.core.util.keyIterator import androidx.core.util.valueIterator import com.android.internal.protolog.ProtoLog import com.android.window.flags.Flags import com.android.wm.shell.desktopmode.persistence.DesktopPersistentRepository import com.android.wm.shell.desktopmode.persistence.DesktopRepositoryInitializer import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE Loading Loading @@ -294,7 +294,7 @@ class DesktopRepository ( taskId, isVisible, displayId) logD("VisibleTaskCount has changed from %d to %d", prevCount, newCount) notifyVisibleTaskListeners(displayId, newCount) if (Flags.enableDesktopWindowingPersistence()) { if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue()) { updatePersistentRepository(displayId) } } Loading Loading @@ -344,7 +344,7 @@ class DesktopRepository ( desktopTaskDataByDisplayId.getOrCreate(displayId).freeformTasksInZOrder.add(0, taskId) // Unminimize the task if it is minimized. unminimizeTask(displayId, taskId) if (Flags.enableDesktopWindowingPersistence()) { if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue()) { updatePersistentRepository(displayId) } } Loading @@ -362,7 +362,7 @@ class DesktopRepository ( desktopTaskDataByDisplayId.getOrCreate(displayId).minimizedTasks.add(taskId) } updateTask(displayId, taskId, isVisible = false) if (Flags.enableDesktopWindowingPersistence()) { if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue()) { updatePersistentRepository(displayId) } } Loading Loading @@ -410,7 +410,7 @@ class DesktopRepository ( unminimizeTask(displayId, taskId) removeActiveTask(taskId) removeVisibleTask(taskId) if (Flags.enableDesktopWindowingPersistence()) { if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue()) { updatePersistentRepository(displayId) } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +1 −1 Original line number Diff line number Diff line Loading @@ -1161,7 +1161,7 @@ class DesktopTasksController( if (runningTaskInfo != null) { // Task is already running, reorder it to the front wct.reorder(runningTaskInfo.token, /* onTop= */ true) } else if (Flags.enableDesktopWindowingPersistence()) { } else if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue()) { // Task is not running, start it wct.startTask( taskId, Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/persistence/DesktopRepositoryInitializerImpl.kt +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ package com.android.wm.shell.desktopmode.persistence import android.content.Context import com.android.window.flags.Flags import android.window.DesktopModeFlags import com.android.wm.shell.desktopmode.DesktopRepository import com.android.wm.shell.shared.annotations.ShellMainThread import com.android.wm.shell.shared.desktopmode.DesktopModeStatus Loading @@ -36,7 +36,7 @@ class DesktopRepositoryInitializerImpl( @ShellMainThread private val mainCoroutineScope: CoroutineScope, ) : DesktopRepositoryInitializer { override fun initialize(repository: DesktopRepository) { if (!Flags.enableDesktopWindowingPersistence()) return if (!DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue()) return // TODO: b/365962554 - Handle the case that user moves to desktop before it's initialized mainCoroutineScope.launch { val desktop = persistentRepository.readDesktop() ?: return@launch Loading
libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java +1 −2 Original line number Diff line number Diff line Loading @@ -47,7 +47,6 @@ import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import com.android.internal.protolog.ProtoLog; import com.android.window.flags.Flags; import com.android.wm.shell.common.ExternalInterfaceBinder; import com.android.wm.shell.common.RemoteCallable; import com.android.wm.shell.common.ShellExecutor; Loading Loading @@ -444,7 +443,7 @@ public class RecentTasksController implements TaskStackListenerCallback, // If task has their app bounds set to null which happens after reboot, set the // app bounds to persisted lastFullscreenBounds. Also set the position in parent // to the top left of the bounds. if (Flags.enableDesktopWindowingPersistence() if (DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_PERSISTENCE.isTrue() && taskInfo.configuration.windowConfiguration.getAppBounds() == null) { taskInfo.configuration.windowConfiguration.setAppBounds( taskInfo.lastNonFullscreenBounds); Loading