Merge "Remove Windowing Prototype 1 from Codebase" into main

This commit is contained in:
Sukesh Ram
2023-08-30 18:43:37 +00:00
committed by Android (Google) Code Review
9 changed files with 19 additions and 32 deletions

View File

@@ -106,8 +106,7 @@ public class DesktopVisibilityController {
* Whether desktop mode is supported.
*/
private boolean isDesktopModeSupported() {
return SystemProperties.getBoolean("persist.wm.debug.desktop_mode", false)
|| SystemProperties.getBoolean("persist.wm.debug.desktop_mode_2", false);
return SystemProperties.getBoolean("persist.wm.debug.desktop_mode_2", false);
}
/**

View File

@@ -109,7 +109,7 @@ public final class KeyboardQuickSwitchController implements
DesktopVisibilityController desktopController =
LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
final boolean onDesktop =
DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED
DesktopTaskView.DESKTOP_MODE_SUPPORTED
&& desktopController != null
&& desktopController.areFreeformTasksVisible();
@@ -136,7 +136,7 @@ public final class KeyboardQuickSwitchController implements
// Hide all desktop tasks and show them on the hidden tile
int hiddenDesktopTasks = 0;
if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) {
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
DesktopTask desktopTask = findDesktopTask(tasks);
if (desktopTask != null) {
hiddenDesktopTasks = desktopTask.tasks.size();

View File

@@ -272,7 +272,7 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
private void navigateHome() {
TaskUtils.closeSystemWindowsAsync(CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY);
if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) {
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
DesktopVisibilityController desktopVisibilityController =
LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
if (desktopVisibilityController != null) {

View File

@@ -1161,7 +1161,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
mStateCallback.setState(STATE_SCALED_CONTROLLER_HOME | STATE_CAPTURE_SCREENSHOT);
// Notify the SysUI to use fade-in animation when entering PiP
SystemUiProxy.INSTANCE.get(mContext).setPipAnimationTypeToAlpha();
if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) {
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
// Notify the SysUI to stash desktop apps if they are visible
DesktopVisibilityController desktopVisibilityController =
mActivityInterface.getDesktopVisibilityController();

View File

@@ -17,7 +17,7 @@
package com.android.quickstep;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.quickstep.views.DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED;
import static com.android.quickstep.views.DesktopTaskView.DESKTOP_MODE_SUPPORTED;
import static com.android.wm.shell.util.GroupedRecentTaskInfo.TYPE_FREEFORM;
import android.annotation.TargetApi;
@@ -270,7 +270,7 @@ public class RecentTasksList {
TaskLoadResult allTasks = new TaskLoadResult(requestId, loadKeysOnly, rawTasks.size());
for (GroupedRecentTaskInfo rawTask : rawTasks) {
if (DESKTOP_IS_PROTO2_ENABLED && rawTask.getType() == TYPE_FREEFORM) {
if (DESKTOP_MODE_SUPPORTED && rawTask.getType() == TYPE_FREEFORM) {
GroupTask desktopTask = createDesktopTask(rawTask);
allTasks.add(desktopTask);
continue;

View File

@@ -346,7 +346,6 @@ public interface TaskShortcutFactory {
private boolean isAvailable(BaseDraggingActivity activity, int displayId) {
return ActivityManagerWrapper.getInstance().supportsFreeformMultiWindow(activity)
&& !SystemProperties.getBoolean("persist.wm.debug.desktop_mode", false)
&& !SystemProperties.getBoolean("persist.wm.debug.desktop_mode_2", false);
}
};

View File

@@ -68,18 +68,10 @@ import java.util.function.Consumer;
// TODO(b/249371338): TaskView needs to be refactored to have better support for N tasks.
public class DesktopTaskView extends TaskView {
/** Flag to indicate whether desktop windowing proto 1 is enabled */
private static final boolean DESKTOP_IS_PROTO1_ENABLED = SystemProperties.getBoolean(
"persist.wm.debug.desktop_mode", false);
/** Flag to indicate whether desktop windowing proto 2 is enabled */
public static final boolean DESKTOP_IS_PROTO2_ENABLED = SystemProperties.getBoolean(
public static final boolean DESKTOP_MODE_SUPPORTED = SystemProperties.getBoolean(
"persist.wm.debug.desktop_mode_2", false);
/** Flags to indicate whether desktop mode is available on the device */
public static final boolean DESKTOP_MODE_SUPPORTED =
DESKTOP_IS_PROTO1_ENABLED || DESKTOP_IS_PROTO2_ENABLED;
private static final String TAG = DesktopTaskView.class.getSimpleName();
private static final boolean DEBUG = false;

View File

@@ -1615,7 +1615,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mMovingTaskView = null;
runningTaskView.resetPersistentViewTransforms();
int frontTaskIndex = 0;
if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED && mDesktopTaskView != null
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED && mDesktopTaskView != null
&& !runningTaskView.isDesktopTask()) {
// If desktop mode is enabled, desktop task view is pinned at first position if present.
// Move running task to position 1.
@@ -1755,7 +1755,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
if (!taskGroups.isEmpty()) {
addView(mClearAllButton);
if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) {
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
// Check if we have apps on the desktop
if (desktopTask != null && !desktopTask.tasks.isEmpty()) {
// If we are actively choosing apps for split, skip the desktop tile
@@ -2060,7 +2060,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mLastComputedGridSize);
mSizeStrategy.calculateGridTaskSize(mActivity, mActivity.getDeviceProfile(),
mLastComputedGridTaskSize, mOrientationHandler);
if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) {
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
mSizeStrategy.calculateDesktopTaskSize(mActivity, mActivity.getDeviceProfile(),
mLastComputedDesktopTaskSize);
}
@@ -2739,7 +2739,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
}
private boolean hasDesktopTask(Task[] runningTasks) {
if (!DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) {
if (!DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
return false;
}
for (Task task : runningTasks) {
@@ -4633,7 +4633,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mSplitSelectStateController.setAnimateCurrentTaskDismissal(
true /*animateCurrentTaskDismissal*/);
mSplitHiddenTaskViewIndex = indexOfChild(taskView);
if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) {
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
updateDesktopTaskVisibility(false /* visible */);
}
}
@@ -4657,7 +4657,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mSplitSelectStateController.setInitialTaskSelect(splitSelectSource.intent,
splitSelectSource.position.stagePosition, splitSelectSource.itemInfo,
splitSelectSource.splitEvent, splitSelectSource.alreadyRunningTaskId);
if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) {
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
updateDesktopTaskVisibility(false /* visible */);
}
}
@@ -4863,7 +4863,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mSplitHiddenTaskView.setThumbnailVisibility(VISIBLE, INVALID_TASK_ID);
mSplitHiddenTaskView = null;
}
if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED) {
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
updateDesktopTaskVisibility(true /* visible */);
}
}
@@ -5412,7 +5412,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
}
private int getFirstViewIndex() {
if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED && mDesktopTaskView != null) {
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED && mDesktopTaskView != null) {
// Desktop task is at position 0, that is the first view
return 0;
}

View File

@@ -198,8 +198,8 @@ import com.android.launcher3.touch.ItemLongClickListener;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
import com.android.launcher3.util.ActivityResultInfo;
import com.android.launcher3.util.ActivityTracker;
import com.android.launcher3.util.CannedAnimationCoordinator;
import com.android.launcher3.util.BackPressHandler;
import com.android.launcher3.util.CannedAnimationCoordinator;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.IntArray;
import com.android.launcher3.util.IntSet;
@@ -330,10 +330,7 @@ public class Launcher extends StatefulActivity<LauncherState>
private static final FloatProperty<Hotseat> HOTSEAT_WIDGET_SCALE =
HOTSEAT_SCALE_PROPERTY_FACTORY.get(SCALE_INDEX_WIDGET_TRANSITION);
private static final boolean DESKTOP_MODE_1_SUPPORTED =
"1".equals(Utilities.getSystemProperty("persist.wm.debug.desktop_mode", "0"));
private static final boolean DESKTOP_MODE_2_SUPPORTED =
private static final boolean DESKTOP_MODE_SUPPORTED =
"1".equals(Utilities.getSystemProperty("persist.wm.debug.desktop_mode_2", "0"));
@Thunk
@@ -3301,7 +3298,7 @@ public class Launcher extends StatefulActivity<LauncherState>
}
private void updateDisallowBack() {
if (DESKTOP_MODE_1_SUPPORTED || DESKTOP_MODE_2_SUPPORTED) {
if (DESKTOP_MODE_SUPPORTED) {
// Do not disable back in launcher when prototype behavior is enabled
return;
}