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

Commit cd1dced9 authored by Ivan Tkachenko's avatar Ivan Tkachenko
Browse files

Desktop windowing wallpaper

* Remove Launcher state manipulation from `DesktopVisibilityController`
* Remove Taskbar state updates for desktop mode in
  `LauncherTaskbarUIController`
* Update app widget animation for Home transision
* Update `RemoteTargetGluer` remote targets setup for Dekstop mode

Bug: 309014605
Flag: ACONFIG com.android.window.flags.enable_desktop_windowing_wallpaper_activity DEVELOPMENT
Test: manual
Change-Id: Ie2a7ad214a4d4e7e642d1236f2375ba6d17f3781
parent 1db15a0e
Loading
Loading
Loading
Loading
+37 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import static android.view.View.VISIBLE;

import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.window.flags.Flags.enableDesktopWindowingWallpaperActivity;

import android.os.Debug;
import android.os.SystemProperties;
@@ -141,7 +142,8 @@ public class DesktopVisibilityController {
            final boolean isVisible = visibleTasksCount > 0;
            mVisibleDesktopTasksCount = visibleTasksCount;

            if (wasVisible != isVisible) {
            if (!enableDesktopWindowingWallpaperActivity() && wasVisible != isVisible) {
                // TODO: b/333533253 - Remove after flag rollout
                if (mVisibleDesktopTasksCount > 0) {
                    setLauncherViewsVisibility(View.INVISIBLE);
                    if (!mInOverviewState) {
@@ -178,6 +180,10 @@ public class DesktopVisibilityController {
        }
        if (overviewStateEnabled != mInOverviewState) {
            mInOverviewState = overviewStateEnabled;
            if (enableDesktopWindowingWallpaperActivity()) {
                return;
            }
            // TODO: b/333533253 - Clean up after flag rollout
            if (mInOverviewState) {
                setLauncherViewsVisibility(View.VISIBLE);
                markLauncherResumed();
@@ -190,6 +196,9 @@ public class DesktopVisibilityController {
        }
    }

    /**
     * TODO: b/333533253 - Remove after flag rollout
     */
    private void setBackgroundStateEnabled(boolean backgroundStateEnabled) {
        if (DEBUG) {
            Log.d(TAG, "setBackgroundStateEnabled: enabled=" + backgroundStateEnabled
@@ -210,6 +219,8 @@ public class DesktopVisibilityController {

    /**
     * Whether recents gesture is currently in progress.
     *
     * TODO: b/333533253 - Remove after flag rollout
     */
    public boolean isRecentsGestureInProgress() {
        return mGestureInProgress;
@@ -217,6 +228,8 @@ public class DesktopVisibilityController {

    /**
     * Notify controller that recents gesture has started.
     *
     * TODO: b/333533253 - Remove after flag rollout
     */
    public void setRecentsGestureStart() {
        if (DEBUG) {
@@ -228,6 +241,8 @@ public class DesktopVisibilityController {
    /**
     * Notify controller that recents gesture finished with the given
     * {@link com.android.quickstep.GestureState.GestureEndTarget}
     *
     * TODO: b/333533253 - Remove after flag rollout
     */
    public void setRecentsGestureEnd(@Nullable GestureState.GestureEndTarget endTarget) {
        if (DEBUG) {
@@ -241,6 +256,9 @@ public class DesktopVisibilityController {
        }
    }

    /**
     * TODO: b/333533253 - Remove after flag rollout
     */
    private void setRecentsGestureInProgress(boolean gestureInProgress) {
        if (gestureInProgress != mGestureInProgress) {
            mGestureInProgress = gestureInProgress;
@@ -256,7 +274,13 @@ public class DesktopVisibilityController {
        }
    }

    /**
     * TODO: b/333533253 - Remove after flag rollout
     */
    private void setLauncherViewsVisibility(int visibility) {
        if (enableDesktopWindowingWallpaperActivity()) {
            return;
        }
        if (DEBUG) {
            Log.d(TAG, "setLauncherViewsVisibility: visibility=" + visibility + " "
                    + Debug.getCaller());
@@ -275,7 +299,13 @@ public class DesktopVisibilityController {
        }
    }

    /**
     * TODO: b/333533253 - Remove after flag rollout
     */
    private void markLauncherPaused() {
        if (enableDesktopWindowingWallpaperActivity()) {
            return;
        }
        if (DEBUG) {
            Log.d(TAG, "markLauncherPaused " + Debug.getCaller());
        }
@@ -286,7 +316,13 @@ public class DesktopVisibilityController {
        }
    }

    /**
     * TODO: b/333533253 - Remove after flag rollout
     */
    private void markLauncherResumed() {
        if (enableDesktopWindowingWallpaperActivity()) {
            return;
        }
        if (DEBUG) {
            Log.d(TAG, "markLauncherResumed " + Debug.getCaller());
        }
+5 −3
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static com.android.launcher3.statemanager.BaseState.FLAG_NON_INTERACTIVE;
import static com.android.launcher3.taskbar.TaskbarEduTooltipControllerKt.TOOLTIP_STEP_FEATURES;
import static com.android.launcher3.taskbar.TaskbarLauncherStateController.FLAG_VISIBLE;
import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS;
import static com.android.window.flags.Flags.enableDesktopWindowingWallpaperActivity;

import android.animation.Animator;
import android.animation.AnimatorSet;
@@ -218,9 +219,10 @@ public class LauncherTaskbarUIController extends TaskbarUIController {

        DesktopVisibilityController desktopController =
                LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
        final boolean onDesktop =
                desktopController != null && desktopController.areDesktopTasksVisible();
        if (onDesktop) {
        if (!enableDesktopWindowingWallpaperActivity()
                && desktopController != null
                && desktopController.areDesktopTasksVisible()) {
            // TODO: b/333533253 - Remove after flag rollout
            isVisible = false;
        }

+1 −0
Original line number Diff line number Diff line
@@ -837,6 +837,7 @@ public class TaskbarLauncherStateController {
        appendFlag(result, flags, FLAG_LAUNCHER_WAS_ACTIVE_WHILE_AWAKE,
                "was_active_while_awake");
        appendFlag(result, flags, FLAG_DEVICE_LOCKED, "device_locked");
        appendFlag(result, flags, FLAG_TASKBAR_HIDDEN, "taskbar_hidden");
        return result.toString();
    }

+1 −0
Original line number Diff line number Diff line
@@ -1165,6 +1165,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
        appendFlag(sj, flags, FLAG_STASHED_IN_APP_AUTO, "FLAG_STASHED_IN_APP_AUTO");
        appendFlag(sj, flags, FLAG_STASHED_SYSUI, "FLAG_STASHED_SYSUI");
        appendFlag(sj, flags, FLAG_STASHED_DEVICE_LOCKED, "FLAG_STASHED_DEVICE_LOCKED");
        appendFlag(sj, flags, FLAG_IN_OVERVIEW, "FLAG_IN_OVERVIEW");
        return sj.toString();
    }

+4 −3
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ import static com.android.quickstep.util.AnimUtils.completeRunnableListCallback;
import static com.android.quickstep.util.SplitAnimationTimings.TABLET_HOME_TO_SPLIT;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;
import static com.android.window.flags.Flags.enableDesktopWindowingMode;
import static com.android.window.flags.Flags.enableDesktopWindowingWallpaperActivity;
import static com.android.wm.shell.common.split.SplitScreenConstants.SNAP_TO_50_50;

import android.animation.Animator;
@@ -942,12 +943,12 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer

    @Override
    public void setResumed() {
        if (mDesktopVisibilityController != null
        if (!enableDesktopWindowingWallpaperActivity()
                && mDesktopVisibilityController != null
                && mDesktopVisibilityController.areDesktopTasksVisible()
                && !mDesktopVisibilityController.isRecentsGestureInProgress()) {
            // Return early to skip setting activity to appear as resumed
            // TODO(b/255649902): shouldn't be needed when we have a separate launcher state
            //  for desktop that we can use to control other parts of launcher
            // TODO: b/333533253 - Remove after flag rollout
            return;
        }
        super.setResumed();
Loading