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

Commit 91dae88c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add enableDesktopWallpaperActivityForSystemUser flag to DesktopModeFlags." into main

parents 5163f2ff 9de46bc5
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -35,10 +35,6 @@ import java.util.function.BooleanSupplier;
 * windowing features which are aiming for developer preview before their release. It allows
 * developer option to override the default behavior of these flags.
 *
 * <p> The flags here will be controlled by either {@link
 * Settings.Global#DEVELOPMENT_OVERRIDE_DESKTOP_MODE_FEATURES} or the {@code
 * persyst.wm.debug.desktop_experience_devopts} system property.
 *
 * <p>NOTE: Flags should only be added to this enum when they have received Product and UX
 * alignment that the feature is ready for developer preview, otherwise just do a flag check.
 *
@@ -96,7 +92,9 @@ public enum DesktopModeFlags {
            Flags::includeTopTransparentFullscreenTaskInDesktopHeuristic, true),
    ENABLE_MINIMIZE_BUTTON(Flags::enableMinimizeButton, true),
    ENABLE_RESIZING_METRICS(Flags::enableResizingMetrics, true),
    ENABLE_TASK_RESIZING_KEYBOARD_SHORTCUTS(Flags::enableTaskResizingKeyboardShortcuts, true);
    ENABLE_TASK_RESIZING_KEYBOARD_SHORTCUTS(Flags::enableTaskResizingKeyboardShortcuts, true),
    ENABLE_DESKTOP_WALLPAPER_ACTIVITY_FOR_SYSTEM_USER(
        Flags::enableDesktopWallpaperActivityForSystemUser, true);

    /**
     * Flag class, to be used in case the enum cannot be used because the flag is not accessible.
@@ -116,7 +114,7 @@ public enum DesktopModeFlags {

        /**
         * Determines state of flag based on the actual flag and desktop mode developer option
         * or desktop experience developer option overrides.
         * overrides.
         */
        public boolean isTrue() {
            return isFlagTrue(mFlagFunction, mShouldOverrideByDevOption);
+3 −2
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ import android.view.WindowManager.TRANSIT_TO_FRONT
import android.widget.Toast
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
import android.window.DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY
import android.window.DesktopModeFlags.ENABLE_WINDOWING_DYNAMIC_INITIAL_BOUNDS
import android.window.RemoteTransition
@@ -1515,7 +1516,7 @@ class DesktopTasksController(

    private fun addWallpaperActivity(displayId: Int, wct: WindowContainerTransaction) {
        logV("addWallpaperActivity")
        if (Flags.enableDesktopWallpaperActivityForSystemUser()) {
        if (ENABLE_DESKTOP_WALLPAPER_ACTIVITY_FOR_SYSTEM_USER.isTrue()) {
            val intent = Intent(context, DesktopWallpaperActivity::class.java)
            if (
                desktopWallpaperActivityTokenProvider.getToken(displayId) == null &&
@@ -1578,7 +1579,7 @@ class DesktopTasksController(
    private fun removeWallpaperActivity(wct: WindowContainerTransaction, displayId: Int) {
        desktopWallpaperActivityTokenProvider.getToken(displayId)?.let { token ->
            logV("removeWallpaperActivity")
            if (Flags.enableDesktopWallpaperActivityForSystemUser()) {
            if (ENABLE_DESKTOP_WALLPAPER_ACTIVITY_FOR_SYSTEM_USER.isTrue()) {
                wct.reorder(token, /* onTop= */ false)
            } else {
                wct.removeTask(token)
+2 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.view.WindowManager.TRANSIT_PIP
import android.view.WindowManager.TRANSIT_TO_BACK
import android.view.WindowManager.TRANSIT_TO_FRONT
import android.window.DesktopModeFlags
import android.window.DesktopModeFlags.ENABLE_DESKTOP_WALLPAPER_ACTIVITY_FOR_SYSTEM_USER
import android.window.DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY
import android.window.TransitionInfo
import android.window.WindowContainerTransaction
@@ -275,7 +276,7 @@ class DesktopTasksTransitionObserver(
            desktopWallpaperActivityTokenProvider
                .getToken(lastSeenTransitionToCloseWallpaper.displayId)
                ?.let { wallpaperActivityToken ->
                    if (Flags.enableDesktopWallpaperActivityForSystemUser()) {
                    if (ENABLE_DESKTOP_WALLPAPER_ACTIVITY_FOR_SYSTEM_USER.isTrue()) {
                        transitions.startTransition(
                            TRANSIT_TO_BACK,
                            WindowContainerTransaction()