Merge "Close Taskbar All Apps when Taskbar Pinning is animating" into main
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
index 881f5c4..0b52195 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt
@@ -41,7 +41,7 @@
import com.android.launcher3.DeviceProfile
import com.android.launcher3.R
import com.android.launcher3.anim.AlphaUpdateListener
-import com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NO_RECREATION
+import com.android.launcher3.config.FeatureFlags.enableTaskbarNoRecreate
import com.android.launcher3.taskbar.TaskbarControllers.LoggableTaskbarController
import com.android.launcher3.util.DisplayController
import java.io.PrintWriter
@@ -99,7 +99,7 @@
}
windowLayoutParams.providedInsets =
- if (ENABLE_TASKBAR_NO_RECREATION.get()) {
+ if (enableTaskbarNoRecreate()) {
getProvidedInsets(controllers.sharedState!!.insetsFrameProviders!!,
insetsRoundedCornerFlag)
} else {
@@ -225,7 +225,6 @@
provider.insetsSize = Insets.of(0, 0, rightIndexInset, 0)
}
-
// When in gesture nav, report the stashed height to the IME, to allow hiding the
// IME navigation bar.
val imeInsetsSize = if (ENABLE_HIDE_IME_CAPTION_BAR && context.isGestureNav) {
@@ -236,6 +235,12 @@
val imeInsetsSizeOverride =
arrayOf(
InsetsFrameProvider.InsetsSizeOverride(TYPE_INPUT_METHOD, imeInsetsSize),
+ InsetsFrameProvider.InsetsSizeOverride(TYPE_VOICE_INTERACTION,
+ // No-op override to keep the size and types in sync with the
+ // override below (insetsSizeOverrides must have the same length and
+ // types after the window is added according to
+ // WindowManagerService#relayoutWindow)
+ provider.insetsSize)
)
// Use 0 tappableElement insets for the VoiceInteractionWindow when gesture nav is enabled.
val visInsetsSizeForTappableElement =
@@ -244,8 +249,7 @@
val insetsSizeOverrideForTappableElement =
arrayOf(
InsetsFrameProvider.InsetsSizeOverride(TYPE_INPUT_METHOD, imeInsetsSize),
- InsetsFrameProvider.InsetsSizeOverride(
- TYPE_VOICE_INTERACTION,
+ InsetsFrameProvider.InsetsSizeOverride(TYPE_VOICE_INTERACTION,
visInsetsSizeForTappableElement
),
)
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index 0780cf8..fd66b45 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -581,6 +581,11 @@
* 1 => fully aligned
*/
public void setLauncherIconAlignment(float alignmentRatio, DeviceProfile launcherDp) {
+ if (isPhoneMode(launcherDp)) {
+ mIconAlignControllerLazy = null;
+ return;
+ }
+
boolean isHotseatIconOnTopWhenAligned =
mControllers.uiController.isHotseatIconOnTopWhenAligned();
boolean isStashed = mControllers.taskbarStashController.isStashed();
@@ -609,11 +614,6 @@
*/
private AnimatorPlaybackController createIconAlignmentController(DeviceProfile launcherDp) {
PendingAnimation setter = new PendingAnimation(100);
- if (TaskbarManager.isPhoneMode(launcherDp)) {
- // No animation for icons in small-screen
- return setter.createPlaybackController();
- }
-
mOnControllerPreCreateCallback.run();
DeviceProfile taskbarDp = mActivity.getDeviceProfile();
Rect hotseatPadding = launcherDp.getHotseatLayoutPadding(mActivity);
diff --git a/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java b/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java
index c5a88bc..57b9a39 100644
--- a/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java
+++ b/quickstep/src/com/android/quickstep/FallbackSwipeHandler.java
@@ -66,6 +66,7 @@
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.fallback.FallbackRecentsView;
import com.android.quickstep.fallback.RecentsState;
+import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.util.RectFSpringAnim;
import com.android.quickstep.util.SurfaceTransaction.SurfaceProperties;
import com.android.quickstep.util.TransformParams;
@@ -151,19 +152,20 @@
return new FallbackPipToHomeAnimationFactory();
}
mActiveAnimationFactory = new FallbackHomeAnimationFactory(duration);
- startHomeIntent(mActiveAnimationFactory, runningTaskTarget);
+ startHomeIntent(mActiveAnimationFactory, runningTaskTarget, "FallbackSwipeHandler-home");
return mActiveAnimationFactory;
}
private void startHomeIntent(
@Nullable FallbackHomeAnimationFactory gestureContractAnimationFactory,
- @Nullable RemoteAnimationTarget runningTaskTarget) {
+ @Nullable RemoteAnimationTarget runningTaskTarget,
+ @NonNull String reason) {
ActivityOptions options = ActivityOptions.makeCustomAnimation(mContext, 0, 0);
Intent intent = new Intent(mGestureState.getHomeIntent());
if (gestureContractAnimationFactory != null && runningTaskTarget != null) {
gestureContractAnimationFactory.addGestureContract(intent, runningTaskTarget.taskInfo);
}
- startHomeIntentSafely(mContext, intent, options.toBundle());
+ startHomeIntentSafely(mContext, intent, options.toBundle(), reason);
}
@Override
@@ -185,8 +187,8 @@
// the PiP task appearing.
recentsCallback = () -> {
callback.run();
- startHomeIntent(
- null /* gestureContractAnimationFactory */, null /* runningTaskTarget */);
+ startHomeIntent(null /* gestureContractAnimationFactory */,
+ null /* runningTaskTarget */, "FallbackSwipeHandler-resumeLauncher");
};
} else {
recentsCallback = callback;
diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
index 833bf5f..31fe791 100644
--- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
+++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
@@ -37,6 +37,7 @@
import com.android.launcher3.taskbar.TaskbarUIController;
import com.android.launcher3.util.RunnableList;
import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener;
+import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.ThumbnailData;
@@ -220,6 +221,7 @@
return true;
}
if (cmd.type == TYPE_HOME) {
+ ActiveGestureLog.INSTANCE.addLog("OverviewCommandHelper.executeCommand(TYPE_HOME)");
mService.startActivity(mOverviewComponentObserver.getHomeIntent());
return true;
}
diff --git a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
index 60713cf..0a02e99 100644
--- a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
+++ b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
@@ -39,6 +39,7 @@
import com.android.launcher3.R;
import com.android.launcher3.util.SimpleBroadcastReceiver;
+import com.android.quickstep.util.ActiveGestureLog;
import com.android.systemui.shared.system.PackageManagerWrapper;
import java.io.PrintWriter;
@@ -276,20 +277,24 @@
/**
* Starts the intent for the current home activity.
*/
- public static void startHomeIntentSafely(@NonNull Context context, @Nullable Bundle options) {
+ public static void startHomeIntentSafely(@NonNull Context context, @Nullable Bundle options,
+ @NonNull String reason) {
RecentsAnimationDeviceState deviceState = new RecentsAnimationDeviceState(context);
OverviewComponentObserver observer = new OverviewComponentObserver(context, deviceState);
Intent intent = observer.getHomeIntent();
observer.onDestroy();
deviceState.destroy();
- startHomeIntentSafely(context, intent, options);
+ startHomeIntentSafely(context, intent, options, reason);
}
/**
* Starts the intent for the current home activity.
*/
public static void startHomeIntentSafely(
- @NonNull Context context, @NonNull Intent homeIntent, @Nullable Bundle options) {
+ @NonNull Context context, @NonNull Intent homeIntent, @Nullable Bundle options,
+ @NonNull String reason) {
+ ActiveGestureLog.INSTANCE.addLog(new ActiveGestureLog.CompoundString(
+ "OverviewComponentObserver.startHomeIntent: ").append(reason));
try {
context.startActivity(homeIntent, options);
} catch (NullPointerException | ActivityNotFoundException | SecurityException e) {
diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java
index 961d8c0..39edd70 100644
--- a/quickstep/src/com/android/quickstep/RecentsActivity.java
+++ b/quickstep/src/com/android/quickstep/RecentsActivity.java
@@ -94,6 +94,7 @@
* See {@link com.android.quickstep.views.RecentsView}.
*/
public final class RecentsActivity extends StatefulActivity<RecentsState> {
+ private static final String TAG = "RecentsActivity";
public static final ActivityTracker<RecentsActivity> ACTIVITY_TRACKER =
new ActivityTracker<>();
@@ -427,7 +428,7 @@
new RemoteAnimationAdapter(runner, HOME_APPEAR_DURATION, 0),
new RemoteTransition(runner.toRemoteTransition(), getIApplicationThread(),
"StartHomeFromRecents"));
- startHomeIntentSafely(this, options.toBundle());
+ startHomeIntentSafely(this, options.toBundle(), TAG);
}
private final RemoteAnimationFactory mAnimationToHomeFactory =
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index 038a022..d53922b 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -17,6 +17,8 @@
import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
+import static com.android.launcher3.testing.shared.TestProtocol.SPLIT_LEAK;
+import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
@@ -97,6 +99,7 @@
import com.android.wm.shell.transition.IShellTransitions;
import com.android.wm.shell.util.GroupedRecentTaskInfo;
+import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
@@ -270,6 +273,7 @@
*/
@MainThread
public void clearProxy() {
+ testLogD(SPLIT_LEAK, "systemUiProxy clearingProxy");
setProxy(null, null, null, null, null, null, null, null, null, null, null, null, null);
}
@@ -1249,19 +1253,21 @@
}
public ArrayList<GroupedRecentTaskInfo> getRecentTasks(int numTasks, int userId) {
- if (mRecentTasks != null) {
- try {
- final GroupedRecentTaskInfo[] rawTasks = mRecentTasks.getRecentTasks(numTasks,
- RECENT_IGNORE_UNAVAILABLE, userId);
- if (rawTasks == null) {
- return new ArrayList<>();
- }
- return new ArrayList<>(Arrays.asList(rawTasks));
- } catch (RemoteException e) {
- Log.w(TAG, "Failed call getRecentTasks", e);
- }
+ if (mRecentTasks == null) {
+ Log.w(TAG, "getRecentTasks() failed due to null mRecentTasks");
+ return new ArrayList<>();
}
- return new ArrayList<>();
+ try {
+ final GroupedRecentTaskInfo[] rawTasks = mRecentTasks.getRecentTasks(numTasks,
+ RECENT_IGNORE_UNAVAILABLE, userId);
+ if (rawTasks == null) {
+ return new ArrayList<>();
+ }
+ return new ArrayList<>(Arrays.asList(rawTasks));
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call getRecentTasks", e);
+ return new ArrayList<>();
+ }
}
/**
@@ -1405,7 +1411,7 @@
public boolean startRecentsActivity(Intent intent, ActivityOptions options,
RecentsAnimationListener listener) {
if (mRecentTasks == null) {
- ActiveGestureLog.INSTANCE.trackEvent(RECENT_TASKS_MISSING);
+ ActiveGestureLog.INSTANCE.addLog("Null mRecentTasks", RECENT_TASKS_MISSING);
return false;
}
final IRecentsAnimationRunner runner = new IRecentsAnimationRunner.Stub() {
@@ -1463,4 +1469,35 @@
return false;
}
}
+
+ public void dump(PrintWriter pw) {
+ pw.println(TAG + ":");
+
+ pw.println("\tmSystemUiProxy=" + mSystemUiProxy);
+ pw.println("\tmPip=" + mPip);
+ pw.println("\tmPipAnimationListener=" + mPipAnimationListener);
+ pw.println("\tmBubbles=" + mBubbles);
+ pw.println("\tmBubblesListener=" + mBubblesListener);
+ pw.println("\tmSplitScreen=" + mSplitScreen);
+ pw.println("\tmSplitScreenListener=" + mSplitScreenListener);
+ pw.println("\tmSplitSelectListener=" + mSplitSelectListener);
+ pw.println("\tmOneHanded=" + mOneHanded);
+ pw.println("\tmShellTransitions=" + mShellTransitions);
+ pw.println("\tmHomeTransitionListener=" + mHomeTransitionListener);
+ pw.println("\tmStartingWindow=" + mStartingWindow);
+ pw.println("\tmStartingWindowListener=" + mStartingWindowListener);
+ pw.println("\tmSysuiUnlockAnimationController=" + mSysuiUnlockAnimationController);
+ pw.println("\tmLauncherActivityClass=" + mLauncherActivityClass);
+ pw.println("\tmLauncherUnlockAnimationController=" + mLauncherUnlockAnimationController);
+ pw.println("\tmRecentTasks=" + mRecentTasks);
+ pw.println("\tmRecentTasksListener=" + mRecentTasksListener);
+ pw.println("\tmBackAnimation=" + mBackAnimation);
+ pw.println("\tmBackToLauncherCallback=" + mBackToLauncherCallback);
+ pw.println("\tmBackToLauncherRunner=" + mBackToLauncherRunner);
+ pw.println("\tmDesktopMode=" + mDesktopMode);
+ pw.println("\tmDesktopTaskListener=" + mDesktopTaskListener);
+ pw.println("\tmUnfoldAnimation=" + mUnfoldAnimation);
+ pw.println("\tmUnfoldAnimationListener=" + mUnfoldAnimationListener);
+ pw.println("\tmDragAndDrop=" + mDragAndDrop);
+ }
}
diff --git a/quickstep/src/com/android/quickstep/TaskIconCache.java b/quickstep/src/com/android/quickstep/TaskIconCache.java
index f0f8aec..20a751b 100644
--- a/quickstep/src/com/android/quickstep/TaskIconCache.java
+++ b/quickstep/src/com/android/quickstep/TaskIconCache.java
@@ -15,6 +15,7 @@
*/
package com.android.quickstep;
+import static com.android.launcher3.Flags.enableOverviewIconMenu;
import static com.android.launcher3.util.DisplayController.CHANGE_DENSITY;
import android.annotation.Nullable;
@@ -120,6 +121,7 @@
public void handleResult(TaskCacheEntry result) {
task.icon = result.icon;
task.titleDescription = result.contentDescription;
+ task.title = result.title;
callback.accept(task);
dispatchIconUpdate(task.key.id);
}
@@ -190,6 +192,10 @@
if (activityInfo != null) {
entry.contentDescription = getBadgedContentDescription(
activityInfo, task.key.userId, task.taskDescription);
+ if (enableOverviewIconMenu()) {
+ entry.title = Utilities.trim(
+ activityInfo.applicationInfo.loadLabel(mContext.getPackageManager()));
+ }
}
mIconCache.put(task.key, entry);
@@ -280,6 +286,7 @@
private static class TaskCacheEntry {
public Drawable icon;
public String contentDescription = "";
+ public String title = "";
}
void registerTaskVisualsChangeListener(TaskVisualsChangeListener newListener) {
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index 98a9938..b4fe5e4 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -1299,6 +1299,7 @@
Log.i(TAG, "preloadOverview: forSUWAllSet=" + forSUWAllSet
+ ", isHomeAndOverviewSame=" + mOverviewComponentObserver.isHomeAndOverviewSame());
+ ActiveGestureLog.INSTANCE.addLog("preloadRecentsAnimation");
mTaskAnimationManager.preloadRecentsAnimation(overviewIntent);
}
@@ -1373,6 +1374,7 @@
mTaskbarManager.dumpLogs("", pw);
pw.println("AssistStateManager:");
AssistStateManager.INSTANCE.get(this).dump(" ", pw);
+ SystemUiProxy.INSTANCE.get(this).dump(pw);
}
private AbsSwipeUpHandler createLauncherSwipeHandler(
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java
index 2a35584..1b3d759 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java
@@ -68,6 +68,7 @@
*/
public class DeviceLockedInputConsumer implements InputConsumer,
RecentsAnimationCallbacks.RecentsAnimationListener, BuilderProxy {
+ private final String TAG = "DeviceLockedInputConsumer";
private static final String[] STATE_NAMES = DEBUG_STATES ? new String[2] : null;
private static int getFlagForIndex(int index, String name) {
@@ -220,7 +221,7 @@
} else if (dismissTask) {
// For now, just start the home intent so user is prompted to
// unlock the device.
- startHomeIntentSafely(mContext, mGestureState.getHomeIntent(), null);
+ startHomeIntentSafely(mContext, mGestureState.getHomeIntent(), null, TAG);
mHomeLaunched = true;
}
mStateCallback.setState(STATE_HANDLER_INVALIDATED);
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
index b70fe8e..41730bb 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
@@ -37,6 +37,7 @@
public class OverviewWithoutFocusInputConsumer implements InputConsumer,
TriggerSwipeUpTouchTracker.OnSwipeUpListener {
+ private static final String TAG = "OverviewWithoutFocusInputConsumer";
private final Context mContext;
private final InputMonitorCompat mInputMonitor;
@@ -77,7 +78,7 @@
@Override
public void onSwipeUp(boolean wasFling, PointF finalVelocity) {
- startHomeIntentSafely(mContext, mGestureState.getHomeIntent(), null);
+ startHomeIntentSafely(mContext, mGestureState.getHomeIntent(), null, TAG);
BaseActivity activity = BaseDraggingActivity.fromContext(mContext);
int state = (mGestureState != null && mGestureState.getEndTarget() != null)
? mGestureState.getEndTarget().containerType
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
index c9c64b6..6dcb7bc 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
@@ -53,6 +53,7 @@
public class ProgressDelegateInputConsumer implements InputConsumer,
RecentsAnimationCallbacks.RecentsAnimationListener,
SingleAxisSwipeDetector.Listener {
+ private static final String TAG = "ProgressDelegateInputConsumer";
private static final float SWIPE_DISTANCE_THRESHOLD = 0.2f;
@@ -165,7 +166,7 @@
mRecentsAnimationController.finishController(endToRecents /* toRecents */,
null /* callback */, false /* sendUserLeaveHint */);
} else if (endToRecents) {
- startHomeIntentSafely(mContext, null);
+ startHomeIntentSafely(mContext, null, TAG);
}
}
diff --git a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java
index 49814df..fce188f 100644
--- a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java
+++ b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java
@@ -15,6 +15,9 @@
*/
package com.android.quickstep.interaction;
+import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS;
+import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS;
+
import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN;
import static com.android.app.animation.Interpolators.LINEAR;
import static com.android.launcher3.Utilities.mapBoundToRange;
@@ -47,6 +50,8 @@
import android.util.Log;
import android.view.View;
import android.view.View.AccessibilityDelegate;
+import android.view.Window;
+import android.view.WindowInsetsController;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
import android.widget.ImageView;
@@ -78,6 +83,7 @@
* for the gestural system navigation.
*/
public class AllSetActivity extends Activity {
+ private static final String TAG = "AllSetActivity";
private static final String LOG_TAG = "AllSetActivity";
private static final String URI_SYSTEM_NAVIGATION_SETTING =
@@ -121,6 +127,17 @@
Resources resources = getResources();
int mode = resources.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
boolean isDarkTheme = mode == Configuration.UI_MODE_NIGHT_YES;
+
+ int systemBarsMask = APPEARANCE_LIGHT_STATUS_BARS | APPEARANCE_LIGHT_NAVIGATION_BARS;
+ int systemBarsAppearance = isDarkTheme ? 0 : systemBarsMask;
+ Window window = getWindow();
+ WindowInsetsController insetsController = window == null
+ ? null
+ : window.getInsetsController();
+ if (insetsController != null) {
+ insetsController.setSystemBarsAppearance(systemBarsAppearance, systemBarsMask);
+ }
+
Intent intent = getIntent();
int accentColor = intent.getIntExtra(
isDarkTheme ? EXTRA_ACCENT_COLOR_DARK_MODE : EXTRA_ACCENT_COLOR_LIGHT_MODE,
@@ -299,7 +316,9 @@
if (mBackgroundAnimatorListener != null) {
mAnimatedBackground.removeAnimatorListener(mBackgroundAnimatorListener);
}
- dispatchLauncherAnimStartEnd();
+ if (!isChangingConfigurations()) {
+ dispatchLauncherAnimStartEnd();
+ }
}
private AnimatedFloat createSwipeUpProxy(GestureState state) {
@@ -356,7 +375,7 @@
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
if (action == AccessibilityAction.ACTION_CLICK.getId()) {
- startHomeIntentSafely(AllSetActivity.this, null);
+ startHomeIntentSafely(AllSetActivity.this, null, TAG);
finish();
return true;
}
diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
index a4a53d1..5b1d614 100644
--- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java
@@ -27,7 +27,6 @@
import com.android.quickstep.RecentsModel;
import com.android.quickstep.TaskIconCache;
import com.android.quickstep.TaskThumbnailCache;
-import com.android.quickstep.TaskUtils;
import com.android.quickstep.util.CancellableTask;
import com.android.quickstep.util.RecentsOrientedState;
import com.android.quickstep.util.SplitSelectStateController;
@@ -170,7 +169,7 @@
(task) -> {
setIcon(mIconView2, task.icon);
if (enableOverviewIconMenu()) {
- setText(mIconView2, TaskUtils.getTitle(getContext(), task));
+ setText(mIconView2, task.title);
}
mDigitalWellBeingToast2.initialize(mSecondaryTask);
mDigitalWellBeingToast2.setSplitConfiguration(mSplitBoundsConfig);
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index 5093f22..94183c4 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -1096,7 +1096,7 @@
(task) -> {
setIcon(mIconView, task.icon);
if (enableOverviewIconMenu()) {
- setText(mIconView, TaskUtils.getTitle(getContext(), task));
+ setText(mIconView, task.title);
}
mDigitalWellBeingToast.initialize(task);
});
diff --git a/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java b/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java
index a54dc2d..b365173 100644
--- a/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java
+++ b/quickstep/tests/src/com/android/quickstep/util/TaskViewSimulatorTest.java
@@ -18,11 +18,15 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import android.content.Context;
+import android.content.res.Configuration;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.RectF;
import android.util.ArrayMap;
+import android.util.DisplayMetrics;
import android.view.RemoteAnimationTarget;
import android.view.Surface;
@@ -35,7 +39,6 @@
import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.LauncherModelHelper;
import com.android.launcher3.util.NavigationMode;
-import com.android.launcher3.util.ReflectionHelpers;
import com.android.launcher3.util.RotationUtils;
import com.android.launcher3.util.WindowBounds;
import com.android.launcher3.util.window.CachedDisplayInfo;
@@ -61,6 +64,7 @@
public void taskProperlyScaled_portrait_noRotation_sameInsets1() {
new TaskMatrixVerifier()
.withLauncherSize(1200, 2450)
+ .withDensityDpi(420)
.withInsets(new Rect(0, 80, 0, 120))
.verifyNoTransforms();
}
@@ -69,6 +73,7 @@
public void taskProperlyScaled_portrait_noRotation_sameInsets2() {
new TaskMatrixVerifier()
.withLauncherSize(1200, 2450)
+ .withDensityDpi(420)
.withInsets(new Rect(55, 80, 55, 120))
.verifyNoTransforms();
}
@@ -77,6 +82,7 @@
public void taskProperlyScaled_landscape_noRotation_sameInsets1() {
new TaskMatrixVerifier()
.withLauncherSize(2450, 1250)
+ .withDensityDpi(420)
.withInsets(new Rect(0, 80, 0, 40))
.verifyNoTransforms();
}
@@ -85,6 +91,7 @@
public void taskProperlyScaled_landscape_noRotation_sameInsets2() {
new TaskMatrixVerifier()
.withLauncherSize(2450, 1250)
+ .withDensityDpi(420)
.withInsets(new Rect(0, 80, 120, 0))
.verifyNoTransforms();
}
@@ -93,6 +100,7 @@
public void taskProperlyScaled_landscape_noRotation_sameInsets3() {
new TaskMatrixVerifier()
.withLauncherSize(2450, 1250)
+ .withDensityDpi(420)
.withInsets(new Rect(55, 80, 55, 120))
.verifyNoTransforms();
}
@@ -101,6 +109,7 @@
public void taskProperlyScaled_landscape_rotated() {
new TaskMatrixVerifier()
.withLauncherSize(1200, 2450)
+ .withDensityDpi(420)
.withInsets(new Rect(0, 80, 0, 120))
.withAppBounds(
new Rect(0, 0, 2450, 1200),
@@ -112,6 +121,7 @@
private static class TaskMatrixVerifier extends TransformParams {
private Point mDisplaySize = new Point();
+ private int mDensityDpi = DisplayMetrics.DENSITY_DEFAULT;
private Rect mDisplayInsets = new Rect();
private Rect mAppBounds = new Rect();
private Rect mLauncherInsets = new Rect();
@@ -129,6 +139,11 @@
return this;
}
+ TaskMatrixVerifier withDensityDpi(int densityDpi) {
+ mDensityDpi = densityDpi;
+ return this;
+ }
+
TaskMatrixVerifier withInsets(Rect insets) {
mDisplayInsets.set(insets);
mLauncherInsets.set(insets);
@@ -173,13 +188,17 @@
new ArrayMap<>();
perDisplayBoundsCache.put(cdi.normalize(), allBounds);
- DisplayController.Info mockInfo = new Info(
- helper.sandboxContext, wmProxy, perDisplayBoundsCache);
+ Configuration configuration = new Configuration();
+ configuration.densityDpi = mDensityDpi;
+ Context configurationContext = helper.sandboxContext.createConfigurationContext(
+ configuration);
- DisplayController controller =
- DisplayController.INSTANCE.get(helper.sandboxContext);
- controller.close();
- ReflectionHelpers.setField(controller, "mInfo", mockInfo);
+ DisplayController.Info info = new Info(
+ configurationContext, wmProxy, perDisplayBoundsCache);
+
+ DisplayController mockController = mock(DisplayController.class);
+ when(mockController.getInfo()).thenReturn(info);
+ helper.sandboxContext.putObject(DisplayController.INSTANCE, mockController);
mDeviceProfile = InvariantDeviceProfile.INSTANCE.get(helper.sandboxContext)
.getBestMatch(mAppBounds.width(), mAppBounds.height(), rotation);
@@ -189,7 +208,7 @@
FallbackActivityInterface.INSTANCE);
tvs.setDp(mDeviceProfile);
- int launcherRotation = mockInfo.rotation;
+ int launcherRotation = info.rotation;
if (mAppRotation < 0) {
mAppRotation = launcherRotation;
}
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index ddcb1e6..883c379 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -22,6 +22,7 @@
import static com.android.launcher3.config.FeatureFlags.ENABLE_ICON_LABEL_AUTO_SCALING;
import static com.android.launcher3.graphics.PreloadIconDrawable.newPendingIcon;
import static com.android.launcher3.icons.BitmapInfo.FLAG_NO_BADGE;
+import static com.android.launcher3.icons.BitmapInfo.FLAG_SKIP_USER_BADGE;
import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED;
import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_INCREMENTAL_DOWNLOAD_ACTIVE;
@@ -164,6 +165,8 @@
@ViewDebug.ExportedProperty(category = "launcher")
private boolean mHideBadge = false;
@ViewDebug.ExportedProperty(category = "launcher")
+ private boolean mSkipUserBadge = false;
+ @ViewDebug.ExportedProperty(category = "launcher")
private boolean mIsIconVisible = true;
@ViewDebug.ExportedProperty(category = "launcher")
private int mTextColor;
@@ -266,6 +269,10 @@
mHideBadge = hideBadge;
}
+ public void setSkipUserBadge(boolean skipUserBadge) {
+ mSkipUserBadge = skipUserBadge;
+ }
+
/**
* Resets the view so it can be recycled.
*/
@@ -395,6 +402,9 @@
if (mHideBadge || mDisplay == DISPLAY_SEARCH_RESULT_SMALL) {
flags |= FLAG_NO_BADGE;
}
+ if (mSkipUserBadge) {
+ flags |= FLAG_SKIP_USER_BADGE;
+ }
FastBitmapDrawable iconDrawable = info.newIcon(getContext(), flags);
mDotParams.appColor = iconDrawable.getIconColor();
mDotParams.dotColor = Themes.getAttrColor(getContext(), R.attr.notificationDotColor);
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index edff48b..ec2816b 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2121,7 +2121,7 @@
@Override
public void bindScreens(IntArray orderedScreenIds) {
- mWorkspace.mPageIndicator.setAreScreensBinding(true);
+ mWorkspace.mPageIndicator.setAreScreensBinding(true, mDeviceProfile.isTwoPanels);
int firstScreenPosition = 0;
if ((FeatureFlags.QSB_ON_FIRST_SCREEN
&& mIsFirstPagePinnedItemEnabled
@@ -2650,7 +2650,7 @@
TraceHelper.INSTANCE.endSection();
mWorkspace.removeExtraEmptyScreen(/* stripEmptyScreens= */ true);
- mWorkspace.mPageIndicator.setAreScreensBinding(false);
+ mWorkspace.mPageIndicator.setAreScreensBinding(false, mDeviceProfile.isTwoPanels);
}
private boolean canAnimatePageChange() {
diff --git a/src/com/android/launcher3/pageindicators/PageIndicator.java b/src/com/android/launcher3/pageindicators/PageIndicator.java
index 4ab2037..30156c8 100644
--- a/src/com/android/launcher3/pageindicators/PageIndicator.java
+++ b/src/com/android/launcher3/pageindicators/PageIndicator.java
@@ -30,7 +30,7 @@
* Sets flag to indicate when the screens are in the process of binding so that we don't animate
* during that period.
*/
- default void setAreScreensBinding(boolean areScreensBinding) {
+ default void setAreScreensBinding(boolean areScreensBinding, boolean isTwoPanels) {
// No-op by default
}
diff --git a/src/com/android/launcher3/pageindicators/PageIndicatorDots.java b/src/com/android/launcher3/pageindicators/PageIndicatorDots.java
index 323b3a7..fd1b64f 100644
--- a/src/com/android/launcher3/pageindicators/PageIndicatorDots.java
+++ b/src/com/android/launcher3/pageindicators/PageIndicatorDots.java
@@ -16,6 +16,8 @@
package com.android.launcher3.pageindicators;
+import static com.android.launcher3.config.FeatureFlags.FOLDABLE_SINGLE_PAGE;
+
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
@@ -129,6 +131,7 @@
private float mCurrentPosition;
private float mFinalPosition;
private boolean mAreScreensBinding;
+ private boolean mIsTwoPanels;
private ObjectAnimator mAnimator;
private @Nullable ObjectAnimator mAlphaAnimator;
@@ -348,6 +351,12 @@
@Override
public void setActiveMarker(int activePage) {
+ // In unfolded foldables, every page has two CellLayouts, so we need to halve the active
+ // page for it to be accurate.
+ if (mIsTwoPanels && !FOLDABLE_SINGLE_PAGE.get()) {
+ activePage = activePage / 2;
+ }
+
if (mActivePage != activePage) {
mActivePage = activePage;
}
@@ -360,7 +369,9 @@
}
@Override
- public void setAreScreensBinding(boolean areScreensBinding) {
+ public void setAreScreensBinding(boolean areScreensBinding, boolean isTwoPanels) {
+ mIsTwoPanels = isTwoPanels;
+
// Reapply correct current position which was skipped during setScroll.
if (mAreScreensBinding && !areScreensBinding) {
CURRENT_POSITION.set(this, (float) mActivePage);
diff --git a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
index 3e80e6b..eb45ded 100644
--- a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
+++ b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
@@ -158,6 +158,7 @@
public static final String PERMANENT_DIAG_TAG = "TaplTarget";
public static final String TWO_TASKBAR_LONG_CLICKS = "b/262282528";
public static final String ICON_MISSING = "b/282963545";
+ public static final String SPLIT_LEAK = "b/302551868";
public static final String REQUEST_EMULATE_DISPLAY = "emulate-display";
public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";