Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9efa1cc4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix jank when launching the All set page on devices that support...

Merge "Fix jank when launching the All set page on devices that support vibrations" into tm-dev am: 160b18ab am: d8e7c1ac am: 2d623277

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18310268



Change-Id: I44ecec52101b0ecd2b551597077f00c72baa2df5
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 842c54b5 2d623277
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import androidx.core.graphics.ColorUtils;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.Executors;
import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.GestureState;
import com.android.quickstep.TouchInteractionService.TISBinder;
@@ -136,6 +137,10 @@ public class AllSetActivity extends Activity {
        startBackgroundAnimation();
    }

    private void runOnUiHelperThread(Runnable runnable) {
        Executors.UI_HELPER_EXECUTOR.execute(runnable);
    }

    private void startBackgroundAnimation() {
        if (Utilities.ATLEAST_S && mVibrator != null && mVibrator.areAllPrimitivesSupported(
                VibrationEffect.Composition.PRIMITIVE_THUD)) {
@@ -144,22 +149,22 @@ public class AllSetActivity extends Activity {
                        new Animator.AnimatorListener() {
                            @Override
                            public void onAnimationStart(Animator animation) {
                                mVibrator.vibrate(getVibrationEffect());
                                runOnUiHelperThread(() -> mVibrator.vibrate(getVibrationEffect()));
                            }

                            @Override
                            public void onAnimationRepeat(Animator animation) {
                                mVibrator.vibrate(getVibrationEffect());
                                runOnUiHelperThread(() -> mVibrator.vibrate(getVibrationEffect()));
                            }

                            @Override
                            public void onAnimationEnd(Animator animation) {
                                mVibrator.cancel();
                                runOnUiHelperThread(mVibrator::cancel);
                            }

                            @Override
                            public void onAnimationCancel(Animator animation) {
                                mVibrator.cancel();
                                runOnUiHelperThread(mVibrator::cancel);
                            }
                        };
            }