Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5255398e authored by Ben Lin's avatar Ben Lin
Browse files

Flags.enablePerDisplayDesktopWallpaperActivity ... -> DesktopExperienceFlags

Bug: 407924380
Test: Build
Flag: EXEMPT Flag usage update
Change-Id: Ia37779db74ec4bb736fd99294a49ba3a2e364f29
parent d6941c1e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -24,8 +24,8 @@ import android.content.Context
import android.content.Intent
import android.os.UserHandle
import android.view.Display.DEFAULT_DISPLAY
import android.window.DesktopExperienceFlags.ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY
import android.window.WindowContainerTransaction
import com.android.window.flags.Flags

/** Creates home intent **/
class HomeIntentProvider(
@@ -48,7 +48,7 @@ class HomeIntentProvider(
            launchWindowingMode = WINDOWING_MODE_FULLSCREEN
            pendingIntentBackgroundActivityStartMode =
                ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
            if (Flags.enablePerDisplayDesktopWallpaperActivity()) {
            if (ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY.isTrue) {
                launchDisplayId = displayId
            }
        }
+11 −9
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ import android.view.WindowManager.TRANSIT_PIP
import android.view.WindowManager.TRANSIT_TO_FRONT
import android.widget.Toast
import android.window.DesktopExperienceFlags
import android.window.DesktopExperienceFlags.ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY
import android.window.DesktopModeFlags
import android.window.DesktopModeFlags.DISABLE_NON_RESIZABLE_APP_SNAP_RESIZE
import android.window.DesktopModeFlags.ENABLE_DESKTOP_WALLPAPER_ACTIVITY_FOR_SYSTEM_USER
@@ -849,7 +850,7 @@ class DesktopTasksController(
        if (!DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_BACKEND.isTrue) {
            // |moveHomeTask| is also called in |bringDesktopAppsToFrontBeforeShowingNewTask|, so
            // this shouldn't be necessary at all.
            if (Flags.enablePerDisplayDesktopWallpaperActivity()) {
            if (ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY.isTrue) {
                moveHomeTask(taskInfo.displayId, wct)
            } else {
                moveHomeTask(context.displayId, wct)
@@ -1509,7 +1510,7 @@ class DesktopTasksController(
        val sourceDisplayId = task.displayId
        val sourceDeskId = taskRepository.getDeskIdForTask(task.taskId)
        val shouldExitDesktopIfNeeded =
            Flags.enablePerDisplayDesktopWallpaperActivity() ||
            ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY.isTrue ||
                DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_BACKEND.isTrue
        val deactivationRunnable =
            if (shouldExitDesktopIfNeeded) {
@@ -1936,11 +1937,12 @@ class DesktopTasksController(
        // Move home to front, ensures that we go back home when all desktop windows are closed
        val useParamDisplayId =
            DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_BACKEND.isTrue ||
                Flags.enablePerDisplayDesktopWallpaperActivity()
                ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY.isTrue
        moveHomeTask(displayId = if (useParamDisplayId) displayId else context.displayId, wct = wct)
        // Currently, we only handle the desktop on the default display really.
        if (
            (displayId == DEFAULT_DISPLAY || Flags.enablePerDisplayDesktopWallpaperActivity()) &&
            (displayId == DEFAULT_DISPLAY ||
                ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY.isTrue) &&
                ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY.isTrue() &&
                !desktopState.shouldShowHomeBehindDesktop
        ) {
@@ -2018,7 +2020,7 @@ class DesktopTasksController(
            }

            val intent = Intent(context, DesktopWallpaperActivity::class.java)
            if (Flags.enablePerDisplayDesktopWallpaperActivity()) {
            if (ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY.isTrue) {
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
            }
@@ -2027,7 +2029,7 @@ class DesktopTasksController(
                    launchWindowingMode = WINDOWING_MODE_FULLSCREEN
                    pendingIntentBackgroundActivityStartMode =
                        ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
                    if (Flags.enablePerDisplayDesktopWallpaperActivity()) {
                    if (ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY.isTrue) {
                        launchDisplayId = displayId
                    }
                }
@@ -2045,7 +2047,7 @@ class DesktopTasksController(
            val intent = Intent(userContext, DesktopWallpaperActivity::class.java)
            if (
                desktopWallpaperActivityTokenProvider.getToken(displayId) == null &&
                    Flags.enablePerDisplayDesktopWallpaperActivity()
                    ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY.isTrue
            ) {
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
@@ -2056,7 +2058,7 @@ class DesktopTasksController(
                    launchWindowingMode = WINDOWING_MODE_FULLSCREEN
                    pendingIntentBackgroundActivityStartMode =
                        ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
                    if (Flags.enablePerDisplayDesktopWallpaperActivity()) {
                    if (ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY.isTrue) {
                        launchDisplayId = displayId
                    }
                }
@@ -2094,7 +2096,7 @@ class DesktopTasksController(
            // explicitly going fullscreen, so there's no point in checking the desktop state.
            return true
        }
        if (Flags.enablePerDisplayDesktopWallpaperActivity()) {
        if (ENABLE_PER_DISPLAY_DESKTOP_WALLPAPER_ACTIVITY.isTrue) {
            if (!taskRepository.isOnlyVisibleNonClosingTask(triggerTaskId, displayId)) {
                return false
            }