Merge "Fix issue that widgets with config activity jump" into main
diff --git a/quickstep/src/com/android/launcher3/desktop/DesktopRecentsTransitionController.kt b/quickstep/src/com/android/launcher3/desktop/DesktopRecentsTransitionController.kt
index 64fe30c..3ef8e54 100644
--- a/quickstep/src/com/android/launcher3/desktop/DesktopRecentsTransitionController.kt
+++ b/quickstep/src/com/android/launcher3/desktop/DesktopRecentsTransitionController.kt
@@ -20,9 +20,9 @@
import android.os.RemoteException
import android.util.Log
import android.view.SurfaceControl
-import android.window.IRemoteTransition
import android.window.IRemoteTransitionFinishedCallback
import android.window.RemoteTransition
+import android.window.RemoteTransitionStub
import android.window.TransitionInfo
import com.android.launcher3.statehandlers.DepthController
import com.android.launcher3.statemanager.StateManager
@@ -66,7 +66,7 @@
private val stateManager: StateManager<*>,
private val depthController: DepthController?,
private val successCallback: Consumer<Boolean>?
- ) : IRemoteTransition.Stub() {
+ ) : RemoteTransitionStub() {
override fun startAnimation(
token: IBinder,
@@ -95,16 +95,6 @@
}
}
}
-
- override fun mergeAnimation(
- transition: IBinder,
- info: TransitionInfo,
- t: SurfaceControl.Transaction,
- mergeTarget: IBinder,
- finishCallback: IRemoteTransitionFinishedCallback
- ) {}
-
- override fun onTransitionConsumed(transition: IBinder?, aborted: Boolean) {}
}
companion object {
diff --git a/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java b/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java
index 176091a..c0dacf1 100644
--- a/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java
+++ b/quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java
@@ -48,7 +48,7 @@
"persist.wm.debug.desktop_stashing", false);
private final Launcher mLauncher;
- private int mVisibleFreeformTasksCount;
+ private int mVisibleDesktopTasksCount;
private boolean mInOverviewState;
private boolean mBackgroundStateEnabled;
private boolean mGestureInProgress;
@@ -73,7 +73,7 @@
if (DEBUG) {
Log.d(TAG, "desktop visible tasks count changed=" + visibleTasksCount);
}
- setVisibleFreeformTasksCount(visibleTasksCount);
+ setVisibleDesktopTasksCount(visibleTasksCount);
}
});
}
@@ -108,51 +108,51 @@
}
/**
- * Whether freeform windows are visible in desktop mode.
+ * Whether desktop tasks are visible in desktop mode.
*/
- public boolean areFreeformTasksVisible() {
- boolean freeformTasksVisible = mVisibleFreeformTasksCount > 0;
+ public boolean areDesktopTasksVisible() {
+ boolean desktopTasksVisible = mVisibleDesktopTasksCount > 0;
if (DEBUG) {
- Log.d(TAG, "areFreeformTasksVisible: freeformVisible=" + freeformTasksVisible
+ Log.d(TAG, "areDesktopTasksVisible: desktopVisible=" + desktopTasksVisible
+ " overview=" + mInOverviewState);
}
- return freeformTasksVisible && !mInOverviewState;
+ return desktopTasksVisible && !mInOverviewState;
}
/**
- * Number of visible freeform windows in desktop mode.
+ * Number of visible desktop windows in desktop mode.
*/
- public int getVisibleFreeformTasksCount() {
- return mVisibleFreeformTasksCount;
+ public int getVisibleDesktopTasksCount() {
+ return mVisibleDesktopTasksCount;
}
/**
- * Sets the number of freeform windows that are visible and updates launcher visibility based on
+ * Sets the number of desktop windows that are visible and updates launcher visibility based on
* it.
*/
- public void setVisibleFreeformTasksCount(int visibleTasksCount) {
+ public void setVisibleDesktopTasksCount(int visibleTasksCount) {
if (DEBUG) {
- Log.d(TAG, "setVisibleFreeformTasksCount: visibleTasksCount=" + visibleTasksCount
- + " currentValue=" + mVisibleFreeformTasksCount);
+ Log.d(TAG, "setVisibleDesktopTasksCount: visibleTasksCount=" + visibleTasksCount
+ + " currentValue=" + mVisibleDesktopTasksCount);
}
- if (visibleTasksCount != mVisibleFreeformTasksCount) {
- final boolean wasVisible = mVisibleFreeformTasksCount > 0;
+ if (visibleTasksCount != mVisibleDesktopTasksCount) {
+ final boolean wasVisible = mVisibleDesktopTasksCount > 0;
final boolean isVisible = visibleTasksCount > 0;
- mVisibleFreeformTasksCount = visibleTasksCount;
+ mVisibleDesktopTasksCount = visibleTasksCount;
if (wasVisible != isVisible) {
- if (mVisibleFreeformTasksCount > 0) {
+ if (mVisibleDesktopTasksCount > 0) {
setLauncherViewsVisibility(View.INVISIBLE);
if (!mInOverviewState) {
- // When freeform is visible & we're not in overview, we want launcher to
- // appear paused, this ensures that taskbar displays.
+ // When desktop tasks are visible & we're not in overview, we want launcher
+ // to appear paused, this ensures that taskbar displays.
markLauncherPaused();
}
} else {
setLauncherViewsVisibility(View.VISIBLE);
- // If freeform isn't visible ensure that launcher appears resumed to behave
- // normally.
+ // If desktop tasks aren't visible, ensure that launcher appears resumed to
+ // behave normally.
markLauncherResumed();
}
}
@@ -181,9 +181,9 @@
if (mInOverviewState) {
setLauncherViewsVisibility(View.VISIBLE);
markLauncherResumed();
- } else if (areFreeformTasksVisible() && !mGestureInProgress) {
+ } else if (areDesktopTasksVisible() && !mGestureInProgress) {
// Switching out of overview state and gesture finished.
- // If freeform tasks are still visible, hide launcher again.
+ // If desktop tasks are still visible, hide launcher again.
setLauncherViewsVisibility(View.INVISIBLE);
markLauncherPaused();
}
@@ -200,8 +200,8 @@
if (mBackgroundStateEnabled) {
setLauncherViewsVisibility(View.VISIBLE);
markLauncherResumed();
- } else if (areFreeformTasksVisible() && !mGestureInProgress) {
- // Switching out of background state. If freeform tasks are visible, pause launcher.
+ } else if (areDesktopTasksVisible() && !mGestureInProgress) {
+ // Switching out of background state. If desktop tasks are visible, pause launcher.
setLauncherViewsVisibility(View.INVISIBLE);
markLauncherPaused();
}
@@ -251,7 +251,7 @@
* Handle launcher moving to home due to home gesture or home button press.
*/
public void onHomeActionTriggered() {
- if (IS_STASHING_ENABLED && areFreeformTasksVisible()) {
+ if (IS_STASHING_ENABLED && areDesktopTasksVisible()) {
SystemUiProxy.INSTANCE.get(mLauncher).stashDesktopApps(mLauncher.getDisplayId());
}
}
@@ -270,7 +270,7 @@
dragLayer.setVisibility(visibility);
}
if (mLauncher instanceof QuickstepLauncher ql && ql.getTaskbarUIController() != null
- && mVisibleFreeformTasksCount != 0) {
+ && mVisibleDesktopTasksCount != 0) {
ql.getTaskbarUIController().onLauncherVisibilityChanged(visibility == VISIBLE);
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchController.java b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchController.java
index d89f49b..584106b 100644
--- a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchController.java
@@ -115,7 +115,7 @@
DesktopVisibilityController desktopController =
LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
final boolean onDesktop =
- desktopController != null && desktopController.areFreeformTasksVisible();
+ desktopController != null && desktopController.areDesktopTasksVisible();
if (mModel.isTaskListValid(mTaskListChangeId)) {
// When we are opening the KQS with no focus override, check if the first task is
diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
index 23380d6..81f2c0f 100644
--- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
@@ -219,17 +219,13 @@
DesktopVisibilityController desktopController =
LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
final boolean onDesktop =
- desktopController != null && desktopController.areFreeformTasksVisible();
+ desktopController != null && desktopController.areDesktopTasksVisible();
if (onDesktop) {
isVisible = false;
}
mTaskbarLauncherStateController.updateStateForFlag(FLAG_VISIBLE, isVisible);
- // TODO(b/308851855): Skip animation for launching split from home, will refine later
- boolean skipAnimForSplit = enableSplitContextually() &&
- mLauncher.areBothSplitAppsConfirmed() &&
- mLauncher.getStateManager().getState() == LauncherState.NORMAL;
- if (skipAnimForSplit || fromInit) {
+ if (fromInit) {
duration = 0;
}
return mTaskbarLauncherStateController.applyState(duration, startAnimation);
@@ -425,15 +421,15 @@
}
@Override
- protected boolean isInOverview() {
- return mTaskbarLauncherStateController.isInOverview();
+ protected boolean isInOverviewUi() {
+ return mTaskbarLauncherStateController.isInOverviewUi();
}
@Override
protected boolean canToggleHomeAllApps() {
return mLauncher.isResumed()
- && !mTaskbarLauncherStateController.isInOverview()
- && !mLauncher.areFreeformTasksVisible();
+ && !mTaskbarLauncherStateController.isInOverviewUi()
+ && !mLauncher.areDesktopTasksVisible();
}
@Override
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index 98ce2ed..49d4afe 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -665,7 +665,7 @@
LauncherAtom.TaskBarContainer.Builder taskbarBuilder =
LauncherAtom.TaskBarContainer.newBuilder();
- if (mControllers.uiController.isInOverview()) {
+ if (mControllers.uiController.isInOverviewUi()) {
taskbarBuilder.setTaskSwitcherContainer(
LauncherAtom.TaskSwitcherContainer.newBuilder());
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
index 8dc81cf..6163dad 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
@@ -375,7 +375,7 @@
) {
// Taskbar has some touchable elements, take over the full taskbar area
if (
- controllers.uiController.isInOverview &&
+ controllers.uiController.isInOverviewUi &&
DisplayController.isTransientTaskbar(context)
) {
val region =
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
index b0abbe9..17dcace 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
@@ -666,8 +666,8 @@
&& !mLauncher.getWorkspace().isOverlayShown();
}
- boolean isInOverview() {
- return mLauncherState == LauncherState.OVERVIEW;
+ boolean isInOverviewUi() {
+ return mLauncherState.overviewUi;
}
private void playStateTransitionAnim(AnimatorSet animatorSet, long duration,
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
index 5d418fa..e47640b 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java
@@ -58,6 +58,7 @@
import androidx.annotation.VisibleForTesting;
import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.statemanager.StatefulActivity;
@@ -339,12 +340,12 @@
/**
* Toggles All Apps for Taskbar or Launcher depending on the current state.
- *
- * @param homeAllAppsIntent Intent used if Taskbar is not enabled or Launcher is resumed.
*/
- public void toggleAllApps(Intent homeAllAppsIntent) {
+ public void toggleAllApps() {
if (mTaskbarActivityContext == null || mTaskbarActivityContext.canToggleHomeAllApps()) {
- mContext.startActivity(homeAllAppsIntent);
+ // Home All Apps should be toggled from this class, because the controllers are not
+ // initialized when Taskbar is disabled (i.e. TaskbarActivityContext is null).
+ if (mActivity instanceof Launcher l) l.toggleAllAppsSearch();
} else {
mTaskbarActivityContext.toggleAllAppsSearch();
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index 7e74c27..15be8e7 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -985,7 +985,7 @@
DesktopVisibilityController visibilityController =
LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
if (visibilityController != null && mActivity.isHardwareKeyboard()
- && mActivity.isThreeButtonNav() && visibilityController.areFreeformTasksVisible()) {
+ && mActivity.isThreeButtonNav() && visibilityController.areDesktopTasksVisible()) {
return false;
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java
index cb0fa40..2e78489 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java
@@ -193,7 +193,7 @@
}
/** Returns {@code true} if Taskbar is currently within overview. */
- protected boolean isInOverview() {
+ protected boolean isInOverviewUi() {
return false;
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
index c5c0092..6013797 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java
@@ -937,7 +937,7 @@
@Override
public void setResumed() {
if (mDesktopVisibilityController != null
- && mDesktopVisibilityController.areFreeformTasksVisible()
+ && 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
@@ -1284,9 +1284,9 @@
}
@Override
- public boolean areFreeformTasksVisible() {
+ public boolean areDesktopTasksVisible() {
if (mDesktopVisibilityController != null) {
- return mDesktopVisibilityController.areFreeformTasksVisible();
+ return mDesktopVisibilityController.areDesktopTasksVisible();
}
return false;
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/flags/DebugFlag.java b/quickstep/src/com/android/launcher3/uioverrides/flags/DebugFlag.java
deleted file mode 100644
index 630ef39..0000000
--- a/quickstep/src/com/android/launcher3/uioverrides/flags/DebugFlag.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.launcher3.uioverrides.flags;
-
-import static com.android.launcher3.uioverrides.flags.FlagsFactory.TEAMFOOD_FLAG;
-
-import androidx.annotation.NonNull;
-
-import com.android.launcher3.config.FeatureFlags.BooleanFlag;
-import com.android.launcher3.config.FeatureFlags.FlagState;
-
-class DebugFlag extends BooleanFlag {
-
- public final String key;
- public final String description;
-
- @NonNull
- public final FlagState defaultValue;
-
- DebugFlag(String key, String description, FlagState defaultValue, boolean currentValue) {
- super(currentValue);
- this.key = key;
- this.defaultValue = defaultValue;
- this.description = description;
- }
-
- /**
- * Returns {@code true} if this flag's value has been modified from its default.
- * <p>
- * This helps to identify which flags have been toggled in log dumps and bug reports to
- * further help triaging and debugging.
- */
- boolean currentValueModified() {
- switch (defaultValue) {
- case ENABLED: return !get();
- case TEAMFOOD: return TEAMFOOD_FLAG.get() != get();
- case DISABLED: return get();
- default: return true;
- }
- }
-
- @Override
- public String toString() {
- return key + ": defaultValue=" + defaultValue + ", mCurrentValue=" + get();
- }
-}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/flags/DeveloperOptionsUI.java b/quickstep/src/com/android/launcher3/uioverrides/flags/DeveloperOptionsUI.java
index fd6bf4d..3f818ac 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/flags/DeveloperOptionsUI.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/flags/DeveloperOptionsUI.java
@@ -75,7 +75,6 @@
private static final String ACTION_PLUGIN_SETTINGS =
"com.android.systemui.action.PLUGIN_SETTINGS";
- private static final String TAG = "DeveloperOptionsUI";
private static final String PLUGIN_PERMISSION = "com.android.systemui.permission.PLUGIN";
private final PreferenceFragmentCompat mFragment;
@@ -86,6 +85,7 @@
public DeveloperOptionsUI(PreferenceFragmentCompat fragment, PreferenceCategory flags) {
mFragment = fragment;
mPreferenceScreen = fragment.getPreferenceScreen();
+ flags.getParent().removePreference(flags);
// Add search bar
View listView = mFragment.getListView();
@@ -95,8 +95,6 @@
parent.addView(topBar, parent.indexOfChild(listView));
initSearch(topBar.findViewById(R.id.filter_box));
- new FlagTogglerPrefUi(mFragment.requireActivity(), topBar.findViewById(R.id.flag_apply_btn))
- .applyTo(flags);
DevOptionsUiHelper uiHelper = new DevOptionsUiHelper();
uiHelper.inflateServerFlags(newCategory("Server flags"));
diff --git a/quickstep/src/com/android/launcher3/uioverrides/flags/DeviceFlag.java b/quickstep/src/com/android/launcher3/uioverrides/flags/DeviceFlag.java
deleted file mode 100644
index 915f4ae..0000000
--- a/quickstep/src/com/android/launcher3/uioverrides/flags/DeviceFlag.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.uioverrides.flags;
-
-import com.android.launcher3.config.FeatureFlags.FlagState;
-
-class DeviceFlag extends DebugFlag {
-
- private final boolean mDefaultValueInCode;
-
- DeviceFlag(String key, String description, FlagState defaultValue,
- boolean currentValue, boolean defaultValueInCode) {
- super(key, description, defaultValue, currentValue);
- mDefaultValueInCode = defaultValueInCode;
- }
-
- @Override
- boolean currentValueModified() {
- return super.currentValueModified() || mDefaultValueInCode != get();
- }
-
- @Override
- public String toString() {
- return super.toString() + ", mDefaultValueInCode=" + mDefaultValueInCode;
- }
-}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/flags/FlagTogglerPrefUi.java b/quickstep/src/com/android/launcher3/uioverrides/flags/FlagTogglerPrefUi.java
deleted file mode 100644
index fc39ce4..0000000
--- a/quickstep/src/com/android/launcher3/uioverrides/flags/FlagTogglerPrefUi.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.uioverrides.flags;
-
-import static com.android.launcher3.config.FeatureFlags.FlagState.TEAMFOOD;
-import static com.android.launcher3.uioverrides.flags.FlagsFactory.TEAMFOOD_FLAG;
-
-import android.app.Activity;
-import android.content.Context;
-import android.os.Handler;
-import android.os.Process;
-import android.text.Html;
-import android.text.TextUtils;
-import android.util.Log;
-import android.view.View;
-import android.widget.Toast;
-
-import androidx.preference.PreferenceDataStore;
-import androidx.preference.PreferenceGroup;
-import androidx.preference.PreferenceViewHolder;
-import androidx.preference.SwitchPreference;
-
-import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.util.ActivityLifecycleCallbacksAdapter;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * Dev-build only UI allowing developers to toggle flag settings. See {@link FeatureFlags}.
- */
-public final class FlagTogglerPrefUi implements ActivityLifecycleCallbacksAdapter {
-
- private static final String TAG = "FlagTogglerPrefFrag";
-
- private final View mFlagsApplyButton;
- private final Context mContext;
-
- private final PreferenceDataStore mDataStore = new PreferenceDataStore() {
-
- @Override
- public void putBoolean(String key, boolean value) {
- FlagsFactory.getSharedPreferences().edit().putBoolean(key, value).apply();
- updateMenu();
- }
-
- @Override
- public boolean getBoolean(String key, boolean defaultValue) {
- return FlagsFactory.getSharedPreferences().getBoolean(key, defaultValue);
- }
- };
-
- public FlagTogglerPrefUi(Activity activity, View flagsApplyButton) {
- mFlagsApplyButton = flagsApplyButton;
- mContext = mFlagsApplyButton.getContext();
- activity.registerActivityLifecycleCallbacks(this);
-
- mFlagsApplyButton.setOnClickListener(v -> {
- FlagsFactory.getSharedPreferences().edit().commit();
- Log.e(TAG,
- "Killing launcher process " + Process.myPid() + " to apply new flag values");
- System.exit(0);
- });
- }
-
- public void applyTo(PreferenceGroup parent) {
- Set<String> modifiedPrefs = FlagsFactory.getSharedPreferences().getAll().keySet();
- List<DebugFlag> flags = FlagsFactory.getDebugFlags();
- flags.sort((f1, f2) -> {
- // Sort first by any prefs that the user has changed, then alphabetically.
- int changeComparison = Boolean.compare(
- modifiedPrefs.contains(f2.key), modifiedPrefs.contains(f1.key));
- return changeComparison != 0
- ? changeComparison
- : f1.key.compareToIgnoreCase(f2.key);
- });
-
- // Ensure that teamfood flag comes on the top
- if (flags.remove(TEAMFOOD_FLAG)) {
- flags.add(0, (DebugFlag) TEAMFOOD_FLAG);
- }
-
- // For flag overrides we only want to store when the engineer chose to override the
- // flag with a different value than the default. That way, when we flip flags in
- // future, engineers will pick up the new value immediately. To accomplish this, we use a
- // custom preference data store.
- for (DebugFlag flag : flags) {
- SwitchPreference switchPreference = new SwitchPreference(mContext) {
- @Override
- public void onBindViewHolder(PreferenceViewHolder holder) {
- super.onBindViewHolder(holder);
- holder.itemView.setOnLongClickListener(v -> {
- FlagsFactory.getSharedPreferences().edit().remove(flag.key).apply();
- setChecked(getFlagStateFromSharedPrefs(flag));
- updateSummary(this, flag);
- updateMenu();
- return true;
- });
- }
- };
- switchPreference.setKey(flag.key);
- switchPreference.setDefaultValue(FlagsFactory.getEnabledValue(flag.defaultValue));
- switchPreference.setChecked(getFlagStateFromSharedPrefs(flag));
- switchPreference.setTitle(flag.key);
- updateSummary(switchPreference, flag);
- switchPreference.setPreferenceDataStore(mDataStore);
- switchPreference.setOnPreferenceChangeListener((p, v) -> {
- new Handler().post(() -> updateSummary(switchPreference, flag));
- return true;
- });
-
-
- parent.addPreference(switchPreference);
- }
- updateMenu();
- }
-
- /**
- * Updates the summary to show the description and whether the flag overrides the default value.
- */
- private void updateSummary(SwitchPreference switchPreference, DebugFlag flag) {
- String summary = flag.defaultValue == TEAMFOOD
- ? "<font color='blue'><b>[TEAMFOOD]</b> </font>" : "";
- if (FlagsFactory.getSharedPreferences().contains(flag.key)) {
- summary += "<font color='red'><b>[OVERRIDDEN]</b> </font>";
- }
- if (!TextUtils.isEmpty(summary)) {
- summary += "<br>";
- }
- switchPreference.setSummary(Html.fromHtml(summary + flag.description));
- }
-
- public void updateMenu() {
- mFlagsApplyButton.setVisibility(anyChanged() ? View.VISIBLE : View.INVISIBLE);
- }
-
- @Override
- public void onActivityStopped(Activity activity) {
- if (anyChanged()) {
- Toast.makeText(mContext, "Flag won't be applied until you restart launcher",
- Toast.LENGTH_LONG).show();
- }
- }
-
- private boolean getFlagStateFromSharedPrefs(DebugFlag flag) {
- boolean defaultValue = FlagsFactory.getEnabledValue(flag.defaultValue);
- return mDataStore.getBoolean(flag.key, defaultValue);
- }
-
- private boolean anyChanged() {
- for (DebugFlag flag : FlagsFactory.getDebugFlags()) {
- if (getFlagStateFromSharedPrefs(flag) != flag.get()) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/flags/FlagsFactory.java b/quickstep/src/com/android/launcher3/uioverrides/flags/FlagsFactory.java
deleted file mode 100644
index 7fd6344..0000000
--- a/quickstep/src/com/android/launcher3/uioverrides/flags/FlagsFactory.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.uioverrides.flags;
-
-import static android.app.ActivityThread.currentApplication;
-
-import static com.android.launcher3.BuildConfig.IS_DEBUG_DEVICE;
-import static com.android.launcher3.config.FeatureFlags.FlagState.DISABLED;
-import static com.android.launcher3.config.FeatureFlags.FlagState.ENABLED;
-import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.provider.DeviceConfig;
-import android.provider.DeviceConfig.Properties;
-import android.util.Log;
-
-import androidx.annotation.NonNull;
-
-import com.android.launcher3.config.FeatureFlags.BooleanFlag;
-import com.android.launcher3.config.FeatureFlags.FlagState;
-import com.android.launcher3.util.ScreenOnTracker;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Helper class to create various flags for system build
- */
-public class FlagsFactory {
-
- private static final String TAG = "FlagsFactory";
-
- private static final FlagsFactory INSTANCE = new FlagsFactory();
- private static final boolean FLAG_AUTO_APPLY_ENABLED = true;
-
- private static final String FLAGS_PREF_NAME = "featureFlags";
- public static final String NAMESPACE_LAUNCHER = "launcher";
-
- private static final List<DebugFlag> sDebugFlags = new ArrayList<>();
- private static SharedPreferences sSharedPreferences;
-
- static final BooleanFlag TEAMFOOD_FLAG = getReleaseFlag(
- 0, "LAUNCHER_TEAMFOOD", DISABLED, "Enable this flag to opt-in all team food flags");
-
- private final Set<String> mKeySet = new HashSet<>();
- private boolean mRestartRequested = false;
-
- private FlagsFactory() {
- if (!FLAG_AUTO_APPLY_ENABLED) {
- return;
- }
- DeviceConfig.addOnPropertiesChangedListener(
- NAMESPACE_LAUNCHER, UI_HELPER_EXECUTOR, this::onPropertiesChanged);
- }
-
- static boolean getEnabledValue(FlagState flagState) {
- if (IS_DEBUG_DEVICE) {
- switch (flagState) {
- case ENABLED:
- return true;
- case TEAMFOOD:
- return TEAMFOOD_FLAG.get();
- default:
- return false;
- }
- } else {
- return flagState == ENABLED;
- }
- }
-
- /**
- * Creates a new debug flag. Debug flags always take their default value in release builds. On
- * dogfood builds, they can be manually turned on using the flag toggle UI.
- */
- public static BooleanFlag getDebugFlag(
- int bugId, String key, FlagState flagState, String description) {
- if (IS_DEBUG_DEVICE) {
- boolean defaultValue = getEnabledValue(flagState);
- boolean currentValue = getSharedPreferences().getBoolean(key, defaultValue);
- DebugFlag flag = new DebugFlag(key, description, flagState, currentValue);
- sDebugFlags.add(flag);
- return flag;
- } else {
- return new BooleanFlag(getEnabledValue(flagState));
- }
- }
-
- /**
- * Creates a new release flag. Release flags can be rolled out using server configurations and
- * also allow manual overrides on debug builds.
- */
- public static BooleanFlag getReleaseFlag(
- int bugId, String key, FlagState flagState, String description) {
- INSTANCE.mKeySet.add(key);
- boolean defaultValueInCode = getEnabledValue(flagState);
- boolean defaultValue = DeviceConfig.getBoolean(NAMESPACE_LAUNCHER, key, defaultValueInCode);
- if (IS_DEBUG_DEVICE) {
- boolean currentValue = getSharedPreferences().getBoolean(key, defaultValue);
- DebugFlag flag = new DeviceFlag(key, description,
- (defaultValue == defaultValueInCode) ? flagState
- : defaultValue ? ENABLED : DISABLED, currentValue, defaultValueInCode);
- sDebugFlags.add(flag);
- return flag;
- } else {
- return new BooleanFlag(defaultValue);
- }
- }
-
-
- static List<DebugFlag> getDebugFlags() {
- if (!IS_DEBUG_DEVICE) {
- return Collections.emptyList();
- }
- synchronized (sDebugFlags) {
- return new ArrayList<>(sDebugFlags);
- }
- }
-
- /** Returns the SharedPreferences instance backing Debug FeatureFlags. */
- @NonNull
- static SharedPreferences getSharedPreferences() {
- if (sSharedPreferences == null) {
- sSharedPreferences = currentApplication()
- .createDeviceProtectedStorageContext()
- .getSharedPreferences(FLAGS_PREF_NAME, Context.MODE_PRIVATE);
- }
- return sSharedPreferences;
- }
-
- /**
- * Dumps the current flags state to the print writer
- */
- public static void dump(PrintWriter pw) {
- if (!IS_DEBUG_DEVICE) {
- return;
- }
- pw.println("DeviceFlags:");
- pw.println(" BooleanFlags:");
- synchronized (sDebugFlags) {
- for (DebugFlag flag : sDebugFlags) {
- if (flag instanceof DeviceFlag) {
- pw.println((flag.currentValueModified() ? " ->" : " ") + flag);
- }
- }
- }
- pw.println(" DebugFlags:");
- synchronized (sDebugFlags) {
- for (DebugFlag flag : sDebugFlags) {
- if (!(flag instanceof DeviceFlag)) {
- pw.println((flag.currentValueModified() ? " ->" : " ") + flag);
- }
- }
- }
- }
-
- private void onPropertiesChanged(Properties properties) {
- if (!Collections.disjoint(properties.getKeyset(), mKeySet)) {
- // Schedule a restart
- if (mRestartRequested) {
- return;
- }
- Log.e(TAG, "Flag changed, scheduling restart");
- mRestartRequested = true;
- ScreenOnTracker sot = ScreenOnTracker.INSTANCE.get(currentApplication());
- if (sot.isScreenOn()) {
- sot.addListener(this::onScreenOnChanged);
- } else {
- onScreenOnChanged(false);
- }
- }
- }
-
- private void onScreenOnChanged(boolean isOn) {
- if (mRestartRequested && !isOn) {
- Log.e(TAG, "Restart requested, killing process");
- System.exit(0);
- }
- }
-}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
index 547de77..3ffad70 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java
@@ -91,8 +91,8 @@
@Override
protected float getDepthUnchecked(Context context) {
- if (Launcher.getLauncher(context).areFreeformTasksVisible()) {
- // Don't blur the background while freeform tasks are visible
+ if (Launcher.getLauncher(context).areDesktopTasksVisible()) {
+ // Don't blur the background while desktop tasks are visible
return BaseDepthController.DEPTH_0_PERCENT;
} else if (enableScalingRevealHomeAnimation()) {
return BaseDepthController.DEPTH_70_PERCENT;
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickSwitchState.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickSwitchState.java
index 7fb811d..dfad409 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickSwitchState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickSwitchState.java
@@ -45,8 +45,8 @@
@Override
public int getWorkspaceScrimColor(Launcher launcher) {
- if (launcher.areFreeformTasksVisible()) {
- // No scrim while freeform tasks are visible
+ if (launcher.areDesktopTasksVisible()) {
+ // No scrim while desktop tasks are visible
return Color.TRANSPARENT;
}
DeviceProfile dp = launcher.getDeviceProfile();
diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
index a3f6be0..a3a5f82 100644
--- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
@@ -109,12 +109,12 @@
// We were on our way to this state when we got canceled, end there instead.
startState = stateFromGestureEndTarget(endTarget);
DesktopVisibilityController controller = getDesktopVisibilityController();
- if (controller != null && controller.areFreeformTasksVisible()
+ if (controller != null && controller.areDesktopTasksVisible()
&& endTarget == LAST_TASK) {
// When we are cancelling the transition and going back to last task, move to
// rest state instead when desktop tasks are visible.
// If a fullscreen task is visible, launcher goes to normal state when the
- // activity is stopped. This does not happen when freeform tasks are visible
+ // activity is stopped. This does not happen when desktop tasks are visible
// on top of launcher. Force the launcher state to rest state here.
startState = activity.getStateManager().getRestState();
// Do not animate the transition
diff --git a/quickstep/src/com/android/quickstep/DeviceConfigWrapper.kt b/quickstep/src/com/android/quickstep/DeviceConfigWrapper.kt
index 678709c..1cc54d8 100644
--- a/quickstep/src/com/android/quickstep/DeviceConfigWrapper.kt
+++ b/quickstep/src/com/android/quickstep/DeviceConfigWrapper.kt
@@ -44,9 +44,26 @@
"Enable AGSA override for LPNH and LPH timeout and touch slop"
)
+ val lpnhTimeoutMs =
+ propReader.get("LPNH_TIMEOUT_MS", 450, "Controls lpnh timeout in milliseconds")
+
val lpnhSlopPercentage =
propReader.get("LPNH_SLOP_PERCENTAGE", 100, "Controls touch slop percentage for lpnh")
+ val enableLpnhTwoStages =
+ propReader.get(
+ "ENABLE_LPNH_TWO_STAGES",
+ false,
+ "Enable two stage for LPNH duration and touch slop"
+ )
+
+ val twoStageMultiplier =
+ propReader.get(
+ "TWO_STAGE_MULTIPLIER",
+ 2,
+ "Extends the duration and touch slop if the initial slop is passed"
+ )
+
val animateLpnh = propReader.get("ANIMATE_LPNH", false, "Animates navbar when long pressing")
val shrinkNavHandleOnPress =
@@ -56,9 +73,6 @@
"Shrinks navbar when long pressing if ANIMATE_LPNH is enabled"
)
- val lpnhTimeoutMs =
- propReader.get("LPNH_TIMEOUT_MS", 450, "Controls lpnh timeout in milliseconds")
-
val enableLongPressNavHandle =
propReader.get(
"ENABLE_LONG_PRESS_NAV_HANDLE",
diff --git a/quickstep/src/com/android/quickstep/RemoteTargetGluer.java b/quickstep/src/com/android/quickstep/RemoteTargetGluer.java
index 0ce4d0a..856e8af 100644
--- a/quickstep/src/com/android/quickstep/RemoteTargetGluer.java
+++ b/quickstep/src/com/android/quickstep/RemoteTargetGluer.java
@@ -70,7 +70,7 @@
DesktopVisibilityController desktopVisibilityController =
LauncherActivityInterface.INSTANCE.getDesktopVisibilityController();
if (desktopVisibilityController != null) {
- int visibleTasksCount = desktopVisibilityController.getVisibleFreeformTasksCount();
+ int visibleTasksCount = desktopVisibilityController.getVisibleDesktopTasksCount();
if (visibleTasksCount > 0) {
// Allocate +1 to account for a new task added to the desktop mode
int numHandles = visibleTasksCount + 1;
diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
index 8a4989b..64c4ff4 100644
--- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
@@ -82,9 +82,10 @@
boolean isTablet = activity.getDeviceProfile().isTablet;
boolean isGridOnlyOverview = isTablet && Flags.enableGridOnlyOverview();
- // Add overview actions to the menu when in in-place rotate landscape mode, or in
- // grid-only overview.
- if ((!canLauncherRotate && isInLandscape) || isGridOnlyOverview) {
+ // Add overview actions to the menu when:
+ // - single task is showing
+ // - in in-place rotate landscape mode, or in grid-only overview.
+ if (!hasMultipleTasks && ((!canLauncherRotate && isInLandscape) || isGridOnlyOverview)) {
// Add screenshot action to task menu.
List<SystemShortcut> screenshotShortcuts = TaskShortcutFactory.SCREENSHOT
.getShortcuts(activity, taskContainer);
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index f2ee3f1..485ace8 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -95,7 +95,6 @@
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.testing.shared.TestProtocol;
-import com.android.launcher3.uioverrides.flags.FlagsFactory;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.LockedUserState;
@@ -602,23 +601,21 @@
}
private PendingIntent createAllAppsPendingIntent() {
- final Intent homeIntent = new Intent(mOverviewComponentObserver.getHomeIntent())
- .setAction(INTENT_ACTION_ALL_APPS_TOGGLE);
-
if (FeatureFlags.ENABLE_ALL_APPS_SEARCH_IN_TASKBAR.get()) {
return new PendingIntent(new IIntentSender.Stub() {
@Override
public void send(int code, Intent intent, String resolvedType,
IBinder allowlistToken, IIntentReceiver finishedReceiver,
String requiredPermission, Bundle options) {
- MAIN_EXECUTOR.execute(() -> mTaskbarManager.toggleAllApps(homeIntent));
+ MAIN_EXECUTOR.execute(() -> mTaskbarManager.toggleAllApps());
}
});
} else {
return PendingIntent.getActivity(
this,
GLOBAL_ACTION_ACCESSIBILITY_ALL_APPS,
- homeIntent,
+ new Intent(mOverviewComponentObserver.getHomeIntent())
+ .setAction(INTENT_ACTION_ALL_APPS_TOGGLE),
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
}
}
@@ -1421,7 +1418,6 @@
@Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] rawArgs) {
// Dump everything
- FlagsFactory.dump(pw);
if (LockedUserState.get(this).isUserUnlocked()) {
PluginManagerWrapper.INSTANCE.get(getBaseContext()).dump(pw);
}
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/NavHandleLongPressInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/NavHandleLongPressInputConsumer.java
index 5ab2fcc..075e539 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/NavHandleLongPressInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/NavHandleLongPressInputConsumer.java
@@ -20,6 +20,7 @@
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_LONG_PRESS_NAVBAR;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_LONG_PRESS_STASHED_TASKBAR;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
+import static com.android.launcher3.util.LogConfig.NAV_HANDLE_LONG_PRESS;
import android.content.Context;
import android.util.Log;
@@ -43,14 +44,19 @@
public class NavHandleLongPressInputConsumer extends DelegateInputConsumer {
private static final String TAG = "NavHandleLongPressIC";
+ private static final boolean DEBUG_NAV_HANDLE = Utilities.isPropertyEnabled(
+ NAV_HANDLE_LONG_PRESS);
private final NavHandleLongPressHandler mNavHandleLongPressHandler;
private final float mNavHandleWidth;
private final float mScreenWidth;
private final Runnable mTriggerLongPress = this::triggerLongPress;
- private final float mTouchSlopSquared;
+ private final float mTouchSlopSquaredOriginal;
+ private float mTouchSlopSquared;
+ private final float mOuterTouchSlopSquared;
private final int mLongPressTimeout;
+ private final int mOuterLongPressTimeout;
private final boolean mDeepPressEnabled;
private final NavHandle mNavHandle;
private final StatsLogManager mStatsLogManager;
@@ -65,13 +71,23 @@
super(delegate, inputMonitor);
mScreenWidth = DisplayController.INSTANCE.get(context).getInfo().currentSize.x;
mDeepPressEnabled = DeviceConfigWrapper.get().getEnableLpnhDeepPress();
+ int twoStageMultiplier = DeviceConfigWrapper.get().getTwoStageMultiplier();
AssistStateManager assistStateManager = AssistStateManager.INSTANCE.get(context);
if (assistStateManager.getLPNHDurationMillis().isPresent()) {
mLongPressTimeout = assistStateManager.getLPNHDurationMillis().get().intValue();
} else {
mLongPressTimeout = ViewConfiguration.getLongPressTimeout();
}
- mTouchSlopSquared = deviceState.getSquaredTouchSlop();
+ mOuterLongPressTimeout = mLongPressTimeout * twoStageMultiplier;
+ mTouchSlopSquaredOriginal = deviceState.getSquaredTouchSlop();
+ mTouchSlopSquared = mTouchSlopSquaredOriginal;
+ mOuterTouchSlopSquared = mTouchSlopSquared * (twoStageMultiplier * twoStageMultiplier);
+ if (DEBUG_NAV_HANDLE) {
+ Log.d(TAG, "mLongPressTimeout=" + mLongPressTimeout);
+ Log.d(TAG, "mOuterLongPressTimeout=" + mOuterLongPressTimeout);
+ Log.d(TAG, "mTouchSlopSquared=" + mTouchSlopSquared);
+ Log.d(TAG, "mOuterTouchSlopSquared=" + mOuterTouchSlopSquared);
+ }
mNavHandle = navHandle;
mNavHandleWidth = navHandle.getNavHandleWidth(context);
mNavHandleLongPressHandler = NavHandleLongPressHandler.newInstance(context);
@@ -109,22 +125,44 @@
mCurrentDownEvent.recycle();
}
mCurrentDownEvent = MotionEvent.obtain(ev);
+ mTouchSlopSquared = mTouchSlopSquaredOriginal;
mDeepPressLogged = false;
if (isInNavBarHorizontalArea(ev.getRawX())) {
mNavHandleLongPressHandler.onTouchStarted(mNavHandle);
MAIN_EXECUTOR.getHandler().postDelayed(mTriggerLongPress, mLongPressTimeout);
}
+ if (DEBUG_NAV_HANDLE) {
+ Log.d(TAG, "ACTION_DOWN");
+ }
}
case MotionEvent.ACTION_MOVE -> {
if (!MAIN_EXECUTOR.getHandler().hasCallbacks(mTriggerLongPress)) {
break;
}
- float touchSlopSquared = mTouchSlopSquared;
float dx = ev.getX() - mCurrentDownEvent.getX();
float dy = ev.getY() - mCurrentDownEvent.getY();
double distanceSquared = (dx * dx) + (dy * dy);
- if (distanceSquared > touchSlopSquared) {
+ if (DEBUG_NAV_HANDLE) {
+ Log.d(TAG, "ACTION_MOVE distanceSquared=" + distanceSquared);
+ }
+ if (DeviceConfigWrapper.get().getEnableLpnhTwoStages()) {
+ if (mTouchSlopSquared < distanceSquared
+ && distanceSquared <= mOuterTouchSlopSquared) {
+ MAIN_EXECUTOR.getHandler().removeCallbacks(mTriggerLongPress);
+ int delay = mOuterLongPressTimeout
+ - (int) (ev.getEventTime() - ev.getDownTime());
+ MAIN_EXECUTOR.getHandler().postDelayed(mTriggerLongPress, delay);
+ mTouchSlopSquared = mOuterTouchSlopSquared;
+ if (DEBUG_NAV_HANDLE) {
+ Log.d(TAG, "Touch in middle region!");
+ }
+ }
+ }
+ if (distanceSquared > mTouchSlopSquared) {
+ if (DEBUG_NAV_HANDLE) {
+ Log.d(TAG, "Touch slop out. mTouchSlopSquared=" + mTouchSlopSquared);
+ }
cancelLongPress("touch slop passed");
}
}
@@ -153,6 +191,9 @@
}
private void triggerLongPress() {
+ if (DEBUG_NAV_HANDLE) {
+ Log.d(TAG, "triggerLongPress");
+ }
String runningPackage = mTopTaskTracker.getCachedTopTask(
/* filterOnlyVisibleRecents */ true).getPackageName();
mStatsLogManager.logger().withPackageName(runningPackage).log(
@@ -175,6 +216,9 @@
}
private void cancelLongPress(String reason) {
+ if (DEBUG_NAV_HANDLE) {
+ Log.d(TAG, "cancelLongPress");
+ }
MAIN_EXECUTOR.getHandler().removeCallbacks(mTriggerLongPress);
mNavHandleLongPressHandler.onTouchFinished(mNavHandle, reason);
}
diff --git a/quickstep/src/com/android/quickstep/util/DeviceConfigHelper.kt b/quickstep/src/com/android/quickstep/util/DeviceConfigHelper.kt
index f601fee..544c64d 100644
--- a/quickstep/src/com/android/quickstep/util/DeviceConfigHelper.kt
+++ b/quickstep/src/com/android/quickstep/util/DeviceConfigHelper.kt
@@ -19,13 +19,12 @@
import android.app.ActivityThread
import android.content.Context
import android.content.SharedPreferences
-import android.content.SharedPreferences.*
+import android.content.SharedPreferences.OnSharedPreferenceChangeListener
import android.provider.DeviceConfig
import android.provider.DeviceConfig.OnPropertiesChangedListener
import android.provider.DeviceConfig.Properties
import androidx.annotation.WorkerThread
import com.android.launcher3.BuildConfig
-import com.android.launcher3.uioverrides.flags.FlagsFactory
import com.android.launcher3.util.Executors
/** Utility class to manage a set of device configurations */
@@ -79,10 +78,7 @@
private fun recreateConfig() {
val myProps =
- DeviceConfig.getProperties(
- FlagsFactory.NAMESPACE_LAUNCHER,
- *allKeys.toTypedArray<String>()
- )
+ DeviceConfig.getProperties(NAMESPACE_LAUNCHER, *allKeys.toTypedArray<String>())
config =
factory(
PropReader(
diff --git a/quickstep/src/com/android/quickstep/util/FadeOutRemoteTransition.kt b/quickstep/src/com/android/quickstep/util/FadeOutRemoteTransition.kt
index 24e261f..e6e94e6 100644
--- a/quickstep/src/com/android/quickstep/util/FadeOutRemoteTransition.kt
+++ b/quickstep/src/com/android/quickstep/util/FadeOutRemoteTransition.kt
@@ -20,25 +20,15 @@
import android.os.RemoteException
import android.view.SurfaceControl
import android.view.SurfaceControl.Transaction
-import android.window.IRemoteTransition
import android.window.IRemoteTransitionFinishedCallback
+import android.window.RemoteTransitionStub
import android.window.TransitionInfo
import com.android.launcher3.anim.AnimatorListeners.forEndCallback
import com.android.launcher3.util.Executors
import com.android.wm.shell.shared.TransitionUtil
/** Remote animation which fades out the closing targets */
-class FadeOutRemoteTransition : IRemoteTransition.Stub() {
-
- override fun mergeAnimation(
- iBinder: IBinder,
- transitionInfo: TransitionInfo,
- transaction: Transaction,
- mergeTarget: IBinder,
- finishCB: IRemoteTransitionFinishedCallback
- ) {
- // Do not report finish if we don't know how to handle this transition.
- }
+class FadeOutRemoteTransition : RemoteTransitionStub() {
override fun startAnimation(
transition: IBinder,
@@ -78,6 +68,4 @@
Executors.MAIN_EXECUTOR.execute { anim.start() }
}
-
- override fun onTransitionConsumed(transition: IBinder?, aborted: Boolean) {}
}
diff --git a/quickstep/src/com/android/quickstep/util/SlideInRemoteTransition.kt b/quickstep/src/com/android/quickstep/util/SlideInRemoteTransition.kt
index 1347291..dbeedd3 100644
--- a/quickstep/src/com/android/quickstep/util/SlideInRemoteTransition.kt
+++ b/quickstep/src/com/android/quickstep/util/SlideInRemoteTransition.kt
@@ -23,8 +23,8 @@
import android.os.RemoteException
import android.view.SurfaceControl
import android.view.SurfaceControl.Transaction
-import android.window.IRemoteTransition
import android.window.IRemoteTransitionFinishedCallback
+import android.window.RemoteTransitionStub
import android.window.TransitionInfo
import com.android.launcher3.anim.AnimatorListeners.forEndCallback
import com.android.launcher3.util.Executors
@@ -36,19 +36,9 @@
private val pageSpacing: Int,
private val cornerRadius: Float,
private val interpolator: TimeInterpolator,
-) : IRemoteTransition.Stub() {
+) : RemoteTransitionStub() {
private val animationDurationMs = 500L
- override fun mergeAnimation(
- iBinder: IBinder,
- transitionInfo: TransitionInfo,
- transaction: Transaction,
- mergeTarget: IBinder,
- finishCB: IRemoteTransitionFinishedCallback
- ) {
- // Do not report finish if we don't know how to handle this transition.
- }
-
override fun startAnimation(
transition: IBinder,
info: TransitionInfo,
@@ -116,6 +106,4 @@
Executors.MAIN_EXECUTOR.execute { anim.start() }
}
-
- override fun onTransitionConsumed(transition: IBinder?, aborted: Boolean) {}
}
diff --git a/quickstep/src/com/android/quickstep/util/SplitAnimationController.kt b/quickstep/src/com/android/quickstep/util/SplitAnimationController.kt
index a2d3859..57b0a09 100644
--- a/quickstep/src/com/android/quickstep/util/SplitAnimationController.kt
+++ b/quickstep/src/com/android/quickstep/util/SplitAnimationController.kt
@@ -24,6 +24,7 @@
import android.animation.ValueAnimator
import android.app.ActivityManager.RunningTaskInfo
import android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW
+import android.content.Context
import android.graphics.Bitmap
import android.graphics.Rect
import android.graphics.RectF
@@ -41,8 +42,10 @@
import com.android.app.animation.Interpolators
import com.android.launcher3.DeviceProfile
import com.android.launcher3.Flags.enableOverviewIconMenu
+import com.android.launcher3.InsettableFrameLayout
import com.android.launcher3.Launcher
import com.android.launcher3.QuickstepTransitionManager
+import com.android.launcher3.R
import com.android.launcher3.Utilities
import com.android.launcher3.anim.PendingAnimation
import com.android.launcher3.apppairs.AppPairIcon
@@ -268,6 +271,51 @@
}
}
+ /**
+ * Creates and returns a view to fade in at .4 animation progress and adds it to the provided
+ * [pendingAnimation]. Assumes that animation will be the final split placeholder launch anim.
+ *
+ * [secondPlaceholderEndingBounds] refers to the second placeholder view that gets added on
+ * screen, not the logical second app.
+ * For landscape it's the left app and for portrait the top one.
+ */
+ fun addDividerPlaceholderViewToAnim(pendingAnimation: PendingAnimation,
+ launcher: StatefulActivity<*>,
+ secondPlaceholderEndingBounds: Rect,
+ context: Context) : View {
+ val mSplitDividerPlaceholderView = View(context)
+ val recentsView = launcher.getOverviewPanel<RecentsView<*, *>>()
+ val dp : com.android.launcher3.DeviceProfile = launcher.getDeviceProfile()
+ // Add it before/under the most recently added first floating taskView
+ val firstAddedSplitViewIndex: Int = launcher.getDragLayer().indexOfChild(
+ recentsView.splitSelectController.firstFloatingTaskView)
+ launcher.getDragLayer().addView(mSplitDividerPlaceholderView, firstAddedSplitViewIndex)
+ val lp = mSplitDividerPlaceholderView.layoutParams as InsettableFrameLayout.LayoutParams
+ lp.topMargin = 0
+
+ if (dp.isLeftRightSplit) {
+ lp.height = secondPlaceholderEndingBounds.height()
+ lp.width = launcher.resources
+ .getDimensionPixelSize(R.dimen.split_divider_handle_region_height)
+ mSplitDividerPlaceholderView.translationX = secondPlaceholderEndingBounds.right - lp.width / 2f
+ mSplitDividerPlaceholderView.translationY = 0f
+ } else {
+ lp.height = launcher.resources
+ .getDimensionPixelSize(R.dimen.split_divider_handle_region_height)
+ lp.width = secondPlaceholderEndingBounds.width()
+ mSplitDividerPlaceholderView.translationY = secondPlaceholderEndingBounds.top - lp.height / 2f
+ mSplitDividerPlaceholderView.translationX = 0f
+ }
+
+ mSplitDividerPlaceholderView.alpha = 0f
+ mSplitDividerPlaceholderView.setBackgroundColor(launcher.resources
+ .getColor(R.color.taskbar_background_dark))
+ val timings = AnimUtils.getDeviceSplitToConfirmTimings(dp.isTablet)
+ pendingAnimation.setViewAlpha(mSplitDividerPlaceholderView, 1f,
+ Interpolators.clampToProgress(timings.stagedRectScaleXInterpolator, 0.4f, 1f))
+ return mSplitDividerPlaceholderView
+ }
+
/** Does not play any animation if user is not currently in split selection state. */
fun playPlaceholderDismissAnim(launcher: StatefulActivity<*>, splitDismissEvent: EventEnum) {
if (!splitSelectStateController.isSplitSelectActive) {
@@ -880,11 +928,30 @@
}
}
+ if (splitRoot1 != null) {
+ // Set the highest level split root alpha; we could technically use the parent of
+ // either splitRoot1 or splitRoot2
+ val parentToken = splitRoot1.parent
+ var rootLayer: Change? = null
+ if (parentToken != null) {
+ rootLayer = transitionInfo.getChange(parentToken)
+ }
+ if (rootLayer != null && rootLayer.leash != null) {
+ openingTargets.add(rootLayer.leash)
+ }
+ }
+
val animTransaction = Transaction()
val animator = ValueAnimator.ofFloat(0f, 1f)
animator.setDuration(QuickstepTransitionManager.SPLIT_LAUNCH_DURATION.toLong())
animator.addUpdateListener { valueAnimator: ValueAnimator ->
- val progress = valueAnimator.animatedFraction
+ val progress =
+ Interpolators.clampToProgress(
+ Interpolators.LINEAR,
+ valueAnimator.animatedFraction,
+ 0.8f,
+ 1f
+ )
for (leash in openingTargets) {
animTransaction.setAlpha(leash, progress)
}
@@ -906,19 +973,6 @@
}
)
- if (splitRoot1 != null) {
- // Set the highest level split root alpha; we could technically use the parent of
- // either splitRoot1 or splitRoot2
- val parentToken = splitRoot1.parent
- var rootLayer: Change? = null
- if (parentToken != null) {
- rootLayer = transitionInfo.getChange(parentToken)
- }
- if (rootLayer != null && rootLayer.leash != null) {
- t.setAlpha(rootLayer.leash, 1f)
- }
- }
-
t.apply()
animator.start()
}
diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
index bff5a25..f63d92d 100644
--- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java
@@ -63,9 +63,9 @@
import android.view.RemoteAnimationAdapter;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
-import android.window.IRemoteTransition;
import android.window.IRemoteTransitionFinishedCallback;
import android.window.RemoteTransition;
+import android.window.RemoteTransitionStub;
import android.window.TransitionInfo;
import androidx.annotation.Nullable;
@@ -730,7 +730,7 @@
/**
* Requires Shell Transitions
*/
- private class RemoteSplitLaunchTransitionRunner extends IRemoteTransition.Stub {
+ private class RemoteSplitLaunchTransitionRunner extends RemoteTransitionStub {
private final int mInitialTaskId;
private final int mSecondTaskId;
@@ -779,13 +779,6 @@
}
@Override
- public void mergeAnimation(IBinder transition, TransitionInfo info,
- SurfaceControl.Transaction t, IBinder mergeTarget,
- IRemoteTransitionFinishedCallback finishedCallback) {
- // Do not report finish if we don't know how to handle this transition.
- }
-
- @Override
public void onTransitionConsumed(IBinder transition, boolean aborted)
throws RemoteException {
MAIN_EXECUTOR.execute(() -> {
diff --git a/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java b/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java
index 16d707b..6ab98d5 100644
--- a/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java
+++ b/quickstep/src/com/android/quickstep/util/SplitToWorkspaceController.java
@@ -162,6 +162,10 @@
new RectF(firstTaskStartingBounds), firstTaskEndingBounds,
false /* fadeWithThumbnail */, true /* isStagedTask */);
+ View mSplitDividerPlaceholderView = recentsView.getSplitSelectController()
+ .getSplitAnimationController().addDividerPlaceholderViewToAnim(pendingAnimation,
+ mLauncher, secondTaskEndingBounds, view.getContext());
+
FloatingTaskView secondFloatingTaskView = FloatingTaskView.getFloatingTaskView(mLauncher,
view, bitmap, icon, secondTaskStartingBounds);
secondFloatingTaskView.setAlpha(1);
@@ -172,6 +176,11 @@
private boolean mIsCancelled = false;
@Override
+ public void onAnimationStart(Animator animation) {
+ mController.launchSplitTasks(aBoolean -> cleanUp());
+ }
+
+ @Override
public void onAnimationCancel(Animator animation) {
mIsCancelled = true;
cleanUp();
@@ -180,7 +189,6 @@
@Override
public void onAnimationEnd(Animator animation) {
if (!mIsCancelled) {
- mController.launchSplitTasks(aBoolean -> cleanUp());
InteractionJankMonitorWrapper.end(Cuj.CUJ_SPLIT_SCREEN_ENTER);
}
}
@@ -188,6 +196,7 @@
private void cleanUp() {
mLauncher.getDragLayer().removeView(firstFloatingTaskView);
mLauncher.getDragLayer().removeView(secondFloatingTaskView);
+ mLauncher.getDragLayer().removeView(mSplitDividerPlaceholderView);
mController.getSplitAnimationController().removeSplitInstructionsView(mLauncher);
mController.resetState();
}
diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
index 18922a6..878ff52 100644
--- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
@@ -167,7 +167,7 @@
// Add to top if not
openTaskViewIndex = dragLayer.getChildCount();
}
- dragLayer.addView(floatingView, openTaskViewIndex - 1);
+ dragLayer.addView(floatingView, openTaskViewIndex);
return floatingView;
}
@@ -299,7 +299,6 @@
ValueAnimator transitionAnimator = ValueAnimator.ofFloat(0, 1);
animation.add(transitionAnimator);
- long animDuration = animation.getDuration();
RectF floatingTaskViewBounds = new RectF();
if (fadeWithThumbnail) {
diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
index 0a3d2a0..352ebfe 100644
--- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
@@ -271,7 +271,7 @@
if (desktopVisibilityController != null) {
endTarget = mCurrentGestureEndTarget;
if (endTarget == GestureState.GestureEndTarget.LAST_TASK
- && desktopVisibilityController.areFreeformTasksVisible()) {
+ && desktopVisibilityController.areDesktopTasksVisible()) {
// Recents gesture was cancelled and we are returning to the previous task.
// After super class has handled clean up, show desktop apps on top again
showDesktopApps = true;
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 2e719cd..3ebe66e 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -61,7 +61,6 @@
import static com.android.quickstep.util.TaskGridNavHelper.DIRECTION_TAB;
import static com.android.quickstep.util.TaskGridNavHelper.DIRECTION_UP;
import static com.android.quickstep.views.ClearAllButton.DISMISS_ALPHA;
-import static com.android.window.flags.Flags.enableDesktopWindowingMode;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_ACTIONS_IN_MENU;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_DESKTOP;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NON_ZERO_ROTATION;
@@ -69,6 +68,7 @@
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NO_TASKS;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_SPLIT_SCREEN;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_SPLIT_SELECT_ACTIVE;
+import static com.android.window.flags.Flags.enableDesktopWindowingMode;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -721,6 +721,7 @@
private int mSplitHiddenTaskViewIndex = -1;
@Nullable
private FloatingTaskView mSecondFloatingTaskView;
+ private View mSplitDividerPlaceholderView;
/**
* The task to be removed and immediately re-added. Should not be added to task pool.
@@ -4839,6 +4840,9 @@
mSplitSelectStateController.getActiveSplitStagePosition(), firstTaskEndingBounds,
secondTaskEndingBounds);
+ mSplitDividerPlaceholderView = mSplitSelectStateController
+ .getSplitAnimationController().addDividerPlaceholderViewToAnim(pendingAnimation,
+ mActivity, secondTaskEndingBounds, getContext());
FloatingTaskView firstFloatingTaskView =
mSplitSelectStateController.getFirstFloatingTaskView();
firstFloatingTaskView.getBoundsOnScreen(firstTaskStartingBounds);
@@ -4893,6 +4897,7 @@
safeRemoveDragLayerView(mSplitSelectStateController.getFirstFloatingTaskView());
safeRemoveDragLayerView(mSecondFloatingTaskView);
safeRemoveDragLayerView(mSplitSelectStateController.getSplitInstructionsView());
+ safeRemoveDragLayerView(mSplitDividerPlaceholderView);
mSecondFloatingTaskView = null;
mSplitSelectSource = null;
mSplitSelectStateController.getSplitAnimationController()
diff --git a/res/color/taskbar_background_dark.xml b/res/color/taskbar_background_dark.xml
new file mode 100644
index 0000000..0727b8a
--- /dev/null
+++ b/res/color/taskbar_background_dark.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2024 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<!-- Should be the same as in packages/apps/Launcher3/res/color-night-v31/taskbar_background.xml -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Want to use @android:color/system_neutral1_500, but that causes build errors -->
+ <item android:color="#76777D" android:lStar="6" />
+</selector>
\ No newline at end of file
diff --git a/res/drawable/ic_allapps_search.xml b/res/drawable/ic_allapps_search.xml
index 0c3ab78..53b4f91 100644
--- a/res/drawable/ic_allapps_search.xml
+++ b/res/drawable/ic_allapps_search.xml
@@ -18,8 +18,9 @@
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
- android:autoMirrored="true">
+ android:autoMirrored="true"
+ android:tint="?attr/widgetPickerSearchTextColor">
<path
- android:fillColor="?attr/widgetPickerSearchTextColor"
+ android:fillColor="#FFFFFF"
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z" />
</vector>
diff --git a/res/layout/developer_options_top_bar.xml b/res/layout/developer_options_top_bar.xml
index 1b138ea..ca46311 100644
--- a/res/layout/developer_options_top_bar.xml
+++ b/res/layout/developer_options_top_bar.xml
@@ -11,16 +11,17 @@
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/developer_options_filter_margins"
+ android:background="@drawable/rounded_action_button"
+ android:layout_marginTop="4dp"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:padding="12dp"
+ android:drawableStart="@drawable/ic_allapps_search"
+ android:drawableTint="?android:attr/textColorSecondary"
+ android:drawablePadding="8dp"
android:hint="@string/developer_options_filter_hint"
android:inputType="text"
android:maxLines="1"
android:imeOptions="actionDone"
/>
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:text="Apply"
- android:visibility="invisible"
- android:id="@+id/flag_apply_btn" />
</LinearLayout>
\ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index e9f8f38..632d0fd 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -447,6 +447,8 @@
<dimen name="split_instructions_bottom_margin_phone_landscape">24dp</dimen>
<dimen name="split_instructions_bottom_margin_phone_portrait">60dp</dimen>
<dimen name="split_instructions_start_margin_cancel">8dp</dimen>
+ <dimen name="split_divider_handle_region_width">96dp</dimen>
+ <dimen name="split_divider_handle_region_height">48dp</dimen>
<dimen name="focus_outline_radius">16dp</dimen>
<dimen name="focus_inner_outline_radius">14dp</dimen>
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index dbd594e..d2d5ba9 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1653,7 +1653,7 @@
} else if (Intent.ACTION_ALL_APPS.equals(intent.getAction())) {
showAllAppsFromIntent(alreadyOnHome);
} else if (INTENT_ACTION_ALL_APPS_TOGGLE.equals(intent.getAction())) {
- toggleAllAppsFromIntent(alreadyOnHome);
+ toggleAllAppsSearch(alreadyOnHome);
} else if (Intent.ACTION_SHOW_WORK_APPS.equals(intent.getAction())) {
showAllAppsWithSelectedTabFromIntent(alreadyOnHome,
ActivityAllAppsContainerView.AdapterHolder.WORK);
@@ -1667,7 +1667,12 @@
// Overridden
}
- protected void toggleAllAppsFromIntent(boolean alreadyOnHome) {
+ /** Toggles Launcher All Apps with keyboard ready for search. */
+ public void toggleAllAppsSearch() {
+ toggleAllAppsSearch(/* alreadyOnHome= */ true);
+ }
+
+ protected void toggleAllAppsSearch(boolean alreadyOnHome) {
if (getStateManager().isInStableState(ALL_APPS)) {
getStateManager().goToState(NORMAL, alreadyOnHome);
} else {
@@ -2888,8 +2893,8 @@
* Returns {@code true} if there are visible tasks with windowing mode set to
* {@link android.app.WindowConfiguration#WINDOWING_MODE_FREEFORM}
*/
- public boolean areFreeformTasksVisible() {
- return false; // Base launcher does not track freeform tasks
+ public boolean areDesktopTasksVisible() {
+ return false; // Base launcher does not track desktop tasks
}
// Getters and Setters
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index a4d1dc1..564daf1 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -283,8 +283,7 @@
return;
}
- float deceleratedProgress =
- Interpolators.PREDICTIVE_BACK_DECELERATED_EASE.getInterpolation(backProgress);
+ float deceleratedProgress = Interpolators.BACK_GESTURE.getInterpolation(backProgress);
float scaleProgress = ScrollableLayoutManager.PREDICTIVE_BACK_MIN_SCALE
+ (1 - ScrollableLayoutManager.PREDICTIVE_BACK_MIN_SCALE)
* (1 - deceleratedProgress);
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index d6ce2b3..830e552 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -17,11 +17,8 @@
package com.android.launcher3.config;
import static com.android.launcher3.BuildConfig.WIDGET_ON_FIRST_SCREEN;
-import static com.android.launcher3.config.FeatureFlags.FlagState.DISABLED;
-import static com.android.launcher3.config.FeatureFlags.FlagState.ENABLED;
-import static com.android.launcher3.config.FeatureFlags.FlagState.TEAMFOOD;
-import static com.android.launcher3.uioverrides.flags.FlagsFactory.getDebugFlag;
-import static com.android.launcher3.uioverrides.flags.FlagsFactory.getReleaseFlag;
+import static com.android.launcher3.config.FeatureFlags.BooleanFlag.DISABLED;
+import static com.android.launcher3.config.FeatureFlags.BooleanFlag.ENABLED;
import static com.android.wm.shell.Flags.enableTaskbarNavbarUnification;
import android.content.res.Resources;
@@ -31,8 +28,6 @@
import com.android.launcher3.BuildConfig;
import com.android.launcher3.Flags;
-import java.util.function.Predicate;
-
/**
* Defines a set of flags used to control various launcher behaviors.
* <p>
@@ -40,9 +35,6 @@
*/
public final class FeatureFlags {
- @VisibleForTesting
- public static Predicate<BooleanFlag> sBooleanReader = f -> f.mCurrentValue;
-
private FeatureFlags() { }
/**
@@ -181,7 +173,7 @@
// TODO(Block 14): Cleanup flags
public static final BooleanFlag NOTIFY_CRASHES = getDebugFlag(270393108, "NOTIFY_CRASHES",
- TEAMFOOD, "Sends a notification whenever launcher encounters an uncaught exception.");
+ DISABLED, "Sends a notification whenever launcher encounters an uncaught exception.");
public static final boolean ENABLE_TASKBAR_NAVBAR_UNIFICATION =
enableTaskbarNavbarUnification() && !isPhone();
@@ -251,7 +243,7 @@
// TODO(Block 17): Clean up flags
// Aconfig migration complete for ENABLE_TASKBAR_PINNING.
private static final BooleanFlag ENABLE_TASKBAR_PINNING = getDebugFlag(296231746,
- "ENABLE_TASKBAR_PINNING", TEAMFOOD,
+ "ENABLE_TASKBAR_PINNING", DISABLED,
"Enables taskbar pinning to allow user to switch between transient and persistent "
+ "taskbar flavors");
@@ -291,7 +283,7 @@
// Aconfig migration complete for ENABLE_HOME_TRANSITION_LISTENER.
public static final BooleanFlag ENABLE_HOME_TRANSITION_LISTENER = getDebugFlag(306053414,
- "ENABLE_HOME_TRANSITION_LISTENER", TEAMFOOD,
+ "ENABLE_HOME_TRANSITION_LISTENER", DISABLED,
"Enables launcher to listen to all transitions that include home activity.");
public static boolean enableHomeTransitionListener() {
@@ -386,7 +378,7 @@
// Aconfig migration complete for ENABLE_RESPONSIVE_WORKSPACE.
@VisibleForTesting
public static final BooleanFlag ENABLE_RESPONSIVE_WORKSPACE = getDebugFlag(241386436,
- "ENABLE_RESPONSIVE_WORKSPACE", TEAMFOOD,
+ "ENABLE_RESPONSIVE_WORKSPACE", DISABLED,
"Enables new workspace grid calculations method.");
public static boolean enableResponsiveWorkspace() {
return ENABLE_RESPONSIVE_WORKSPACE.get() || Flags.enableResponsiveWorkspace();
@@ -400,35 +392,31 @@
"ALL_APPS_GONE_VISIBILITY", ENABLED,
"Set all apps container view's hidden visibility to GONE instead of INVISIBLE.");
- // TODO(Block 34): Empty block
- // Please only add flags to your assigned block. If you do not have a block:
- // 1. Assign yourself this block
- // 2. Add your flag to this block
- // 3. Add a new empty block below this one
- // 4. Move this comment to that new empty block
- // This is all to prevent merge conflicts in the future and help keep track of who owns which
- // flags.
- // List of assigned blocks can be found: http://go/gnl-flags-block-directory
+ public static BooleanFlag getDebugFlag(
+ int bugId, String key, BooleanFlag flagState, String description) {
+ return flagState;
+ }
- public static class BooleanFlag {
-
- private final boolean mCurrentValue;
-
- public BooleanFlag(boolean currentValue) {
- mCurrentValue = currentValue;
- }
-
- public boolean get() {
- return sBooleanReader.test(this);
- }
+ public static BooleanFlag getReleaseFlag(
+ int bugId, String key, BooleanFlag flagState, String description) {
+ return flagState;
}
/**
* Enabled state for a flag
*/
- public enum FlagState {
- ENABLED,
- DISABLED,
- TEAMFOOD // Enabled in team food
+ public enum BooleanFlag {
+ ENABLED(true),
+ DISABLED(false);
+
+ private final boolean mValue;
+
+ BooleanFlag(boolean value) {
+ mValue = value;
+ }
+
+ public boolean get() {
+ return mValue;
+ }
}
}
diff --git a/src/com/android/launcher3/util/LogConfig.java b/src/com/android/launcher3/util/LogConfig.java
index e5bbcb1..d59c339 100644
--- a/src/com/android/launcher3/util/LogConfig.java
+++ b/src/com/android/launcher3/util/LogConfig.java
@@ -65,4 +65,9 @@
* When turned on, we enable AGA related session summary logging.
*/
public static final String AGA_SESSION_SUMMARY_LOG = "AGASessionSummaryLog";
+
+ /**
+ * When turned on, we enable long press nav handle related logging.
+ */
+ public static final String NAV_HANDLE_LONG_PRESS = "NavHandleLongPress";
}
diff --git a/src/com/android/launcher3/views/AbstractSlideInView.java b/src/com/android/launcher3/views/AbstractSlideInView.java
index bac3345..9f6e8f8 100644
--- a/src/com/android/launcher3/views/AbstractSlideInView.java
+++ b/src/com/android/launcher3/views/AbstractSlideInView.java
@@ -288,8 +288,7 @@
@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
public void onBackProgressed(BackEvent backEvent) {
final float progress = backEvent.getProgress();
- float deceleratedProgress =
- Interpolators.PREDICTIVE_BACK_DECELERATED_EASE.getInterpolation(progress);
+ float deceleratedProgress = Interpolators.BACK_GESTURE.getInterpolation(progress);
mSwipeToDismissProgress.updateValue(deceleratedProgress);
}
diff --git a/src_no_quickstep/com/android/launcher3/uioverrides/flags/FlagsFactory.java b/src_no_quickstep/com/android/launcher3/uioverrides/flags/FlagsFactory.java
deleted file mode 100644
index 02e0de0..0000000
--- a/src_no_quickstep/com/android/launcher3/uioverrides/flags/FlagsFactory.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher3.uioverrides.flags;
-
-import static com.android.launcher3.config.FeatureFlags.FlagState.ENABLED;
-
-import com.android.launcher3.config.FeatureFlags.BooleanFlag;
-import com.android.launcher3.config.FeatureFlags.FlagState;
-
-import java.io.PrintWriter;
-
-/**
- * Helper class to create various flags for launcher build. The base implementation does
- * not provide any flagging system, and simply replies with the default value.
- */
-public class FlagsFactory {
-
- /**
- * Creates a new debug flag
- */
- public static BooleanFlag getDebugFlag(
- int bugId, String key, FlagState flagState, String description) {
- return new BooleanFlag(flagState == ENABLED);
- }
-
- /**
- * Creates a new debug flag
- */
- public static BooleanFlag getReleaseFlag(
- int bugId, String key, FlagState flagState, String description) {
- return new BooleanFlag(flagState == ENABLED);
- }
-
- /**
- * Dumps the current flags state to the print writer
- */
- public static void dump(PrintWriter pw) { }
-}
diff --git a/tests/multivalentTests/src/com/android/launcher3/util/TestUtil.java b/tests/multivalentTests/src/com/android/launcher3/util/TestUtil.java
index b5707ff..3646f0c 100644
--- a/tests/multivalentTests/src/com/android/launcher3/util/TestUtil.java
+++ b/tests/multivalentTests/src/com/android/launcher3/util/TestUtil.java
@@ -46,8 +46,6 @@
import androidx.test.uiautomator.UiDevice;
-import com.android.launcher3.config.FeatureFlags;
-import com.android.launcher3.config.FeatureFlags.BooleanFlag;
import com.android.launcher3.tapl.LauncherInstrumentation;
import com.android.launcher3.tapl.Workspace;
@@ -64,7 +62,6 @@
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import java.util.function.Predicate;
public class TestUtil {
private static final String TAG = "TestUtil";
@@ -144,21 +141,6 @@
};
}
- /**
- * Utility class to override a boolean flag during test. Note that the returned SafeCloseable
- * must be closed to restore the original state
- */
- public static SafeCloseable overrideFlag(BooleanFlag flag, boolean value) {
- Predicate<BooleanFlag> originalProxy = FeatureFlags.sBooleanReader;
- Predicate<BooleanFlag> testProxy = f -> f == flag ? value : originalProxy.test(f);
- FeatureFlags.sBooleanReader = testProxy;
- return () -> {
- if (FeatureFlags.sBooleanReader == testProxy) {
- FeatureFlags.sBooleanReader = originalProxy;
- }
- };
- }
-
public static void uninstallDummyApp() throws IOException {
UiDevice.getInstance(getInstrumentation()).executeShellCommand(
"pm uninstall " + DUMMY_PACKAGE);