Waiting for wallpaper animation completion when configuring new widget

This will help to ensure that Launcher state has settled before continuing the test.

Bug: 313926097
Flag: N/A
Test: presubmit
Change-Id: Ice7ae8a2517d68c53d135a34cc33e11f3203f788
This commit is contained in:
Vadim Tryshev
2023-12-05 13:31:22 -08:00
parent dc7de0d9fb
commit 61434924f0
4 changed files with 28 additions and 3 deletions

View File

@@ -55,6 +55,7 @@ import static com.android.launcher3.config.FeatureFlags.ENABLE_SCRIM_FOR_APP_LAU
import static com.android.launcher3.config.FeatureFlags.KEYGUARD_ANIMATION;
import static com.android.launcher3.config.FeatureFlags.SEPARATE_RECENTS_ACTIVITY;
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.testing.shared.TestProtocol.WALLPAPER_OPEN_ANIMATION_FINISHED_MESSAGE;
import static com.android.launcher3.util.DisplayController.isTransientTaskbar;
import static com.android.launcher3.util.Executors.ORDERED_BG_EXECUTOR;
import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE;
@@ -120,6 +121,7 @@ import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
import com.android.launcher3.LauncherAnimationRunner.RemoteAnimationFactory;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.icons.FastBitmapDrawable;
import com.android.launcher3.model.data.ItemInfo;
@@ -1651,6 +1653,15 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
if (launcherIsForceInvisibleOrOpening) {
addCujInstrumentation(anim, playFallBackAnimation
? CUJ_APP_CLOSE_TO_HOME_FALLBACK : CUJ_APP_CLOSE_TO_HOME);
anim.addListener(new AnimationSuccessListener() {
@Override
public void onAnimationSuccess(Animator animator) {
AccessibilityManagerCompat.sendTestProtocolEventToTest(
mLauncher, WALLPAPER_OPEN_ANIMATION_FINISHED_MESSAGE);
}
});
// Only register the content animation for cancellation when state changes
mLauncher.getStateManager().setCurrentAnimation(anim);