Merge changes Ib386c3b8,I2315e0af into main

* changes:
  Fix broken uses of TISBinder.refreshOverviewTarget
  Fix missing TAPL test state checks
This commit is contained in:
Schneider Victor-tulias authored and Android (Google) Code Review committed 2025-04-01 07:26:27 -07:00
commit f311ff67ff
10 files changed
+119 -73

No files matched your search

@@ -174,7 +174,7 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {
return response;
case TestProtocol.REQUEST_REFRESH_OVERVIEW_TARGET:
runOnTISBinder(TouchInteractionService.TISBinder::refreshOverviewTarget);
runOnTISBinder(TouchInteractionService.TISBinder::refreshOverviewTargetForTest);
return response;
case TestProtocol.REQUEST_RECREATE_TASKBAR:
@@ -73,6 +73,7 @@ import com.android.app.displaylib.PerDisplayRepository;
import com.android.launcher3.ConstantItem;
import com.android.launcher3.EncryptionType;
import com.android.launcher3.Flags;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.desktop.DesktopAppLaunchTransitionManager;
@@ -96,6 +97,7 @@ import com.android.launcher3.util.TraceHelper;
import com.android.quickstep.OverviewCommandHelper.CommandType;
import com.android.quickstep.OverviewComponentObserver.OverviewChangeListener;
import com.android.quickstep.fallback.window.RecentsDisplayModel;
import com.android.quickstep.fallback.window.RecentsWindowFlags;
import com.android.quickstep.fallback.window.RecentsWindowSwipeHandler;
import com.android.quickstep.inputconsumers.BubbleBarInputConsumer;
import com.android.quickstep.inputconsumers.OneHandedModeInputConsumer;
@@ -537,10 +539,17 @@ public class TouchInteractionService extends Service {
}
/** Refreshes the current overview target. */
public void refreshOverviewTarget() {
@VisibleForTesting
public void refreshOverviewTargetForTest() {
executeForTouchInteractionService(tis -> {
tis.mAllAppsActionManager.onDestroy();
tis.onOverviewTargetChanged(tis.mOverviewComponentObserver.isHomeAndOverviewSame());
if (RecentsWindowFlags.getEnableOverviewInWindow()) {
Launcher launcher = Launcher.ACTIVITY_TRACKER.getCreatedContext();
if (launcher != null) {
tis.mTaskbarManager.setActivity(launcher);
}
}
});
}
}
@@ -37,6 +37,7 @@ import com.android.launcher3.AbstractFloatingView
import com.android.launcher3.BaseActivity
import com.android.launcher3.LauncherAnimationRunner
import com.android.launcher3.LauncherAnimationRunner.RemoteAnimationFactory
import com.android.launcher3.LauncherState
import com.android.launcher3.R
import com.android.launcher3.compat.AccessibilityManagerCompat
import com.android.launcher3.statemanager.StateManager
@@ -66,7 +67,7 @@ import com.android.quickstep.fallback.RecentsState
import com.android.quickstep.fallback.RecentsState.BACKGROUND_APP
import com.android.quickstep.fallback.RecentsState.BG_LAUNCHER
import com.android.quickstep.fallback.RecentsState.DEFAULT
import com.android.quickstep.fallback.RecentsState.HOME
import com.android.quickstep.fallback.toLauncherState
import com.android.quickstep.fallback.toLauncherStateOrdinal
import com.android.quickstep.util.RecentsAtomicAnimationFactory
import com.android.quickstep.util.RecentsWindowProtoLogProxy
@@ -361,7 +362,7 @@ class RecentsWindowManager(context: Context, wallpaperColorHints: Int) :
override fun onStateSetEnd(state: RecentsState) {
super.onStateSetEnd(state)
RecentsWindowProtoLogProxy.logOnStateSetEnd(state.toString())
if (state == HOME || state == BG_LAUNCHER) {
if (state.toLauncherState() == LauncherState.NORMAL) {
cleanupRecentsWindow()
}
AccessibilityManagerCompat.sendStateEventToTest(baseContext, state.toLauncherStateOrdinal())
@@ -27,6 +27,7 @@ import static com.android.launcher3.GestureNavContract.EXTRA_ON_FINISH_CALLBACK;
import static com.android.launcher3.GestureNavContract.EXTRA_REMOTE_CALLBACK;
import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
import android.animation.Animator;
import android.app.ActivityManager.RunningTaskInfo;
import android.content.Context;
import android.content.Intent;
@@ -58,6 +59,7 @@ import androidx.annotation.UiThread;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.anim.SpringAnimationBuilder;
@@ -273,8 +275,10 @@ public class RecentsWindowSwipeHandler extends AbsSwipeUpHandler<RecentsWindowMa
public AnimatorPlaybackController createActivityAnimationToHome() {
// copied from {@link LauncherSwipeHandlerV2.LauncherHomeAnimationFactory}
long accuracy = 2 * Math.max(mDp.widthPx, mDp.heightPx);
return mContainer.getStateManager().createAnimationToNewWorkspace(
RecentsState.HOME, accuracy, StateAnimationConfig.SKIP_ALL_ANIMATIONS);
return mRecentsDisplayModel.getRecentsWindowManager(mGestureState.getDisplayId())
.getStateManager()
.createAnimationToNewWorkspace(
RecentsState.HOME, accuracy, StateAnimationConfig.SKIP_ALL_ANIMATIONS);
}
}
@@ -321,9 +325,18 @@ public class RecentsWindowSwipeHandler extends AbsSwipeUpHandler<RecentsWindowMa
@NonNull
@Override
public AnimatorPlaybackController createActivityAnimationToHome() {
// TODO(b/377678992): Implement a new AtomicAnimationFactory for RecentsWindowManager
PendingAnimation pa = new PendingAnimation(mDuration);
pa.setFloat(mRecentsAlpha, AnimatedFloat.VALUE, 0, ACCELERATE);
pa.setFloat(mHomeAlpha, AnimatedFloat.VALUE, 1, ACCELERATE);
pa.addListener(new AnimationSuccessListener() {
@Override
public void onAnimationSuccess(Animator animator) {
mRecentsDisplayModel.getRecentsWindowManager(mGestureState.getDisplayId())
.getStateManager()
.goToState(RecentsState.HOME, false);
}
});
return pa.createPlaybackController();
}