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

Commit 6381d382 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Adding nullcheck while launching task during quickswitch" into ub-launcher3-rvc-qpr-dev

parents fa990331 798b5f48
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
 */
package com.android.quickstep;

import static android.widget.Toast.LENGTH_SHORT;

import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.VibratorWrapper.OVERVIEW_HAPTIC;
@@ -27,11 +29,13 @@ import android.graphics.Rect;
import android.os.Build;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.Toast;

import androidx.annotation.CallSuper;
import androidx.annotation.UiThread;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.util.VibratorWrapper;
@@ -138,10 +142,10 @@ public abstract class BaseSwipeUpHandler<T extends StatefulActivity<?>, Q extend
            mRecentsView.getNextPageTaskView().launchTask(false /* animate */,
                    true /* freezeTaskList */);
        } else {
            int taskId = mRecentsView.getNextPageTaskView().getTask().key.id;
            if (!mCanceled) {
                TaskView nextTask = mRecentsView.getTaskView(taskId);
                TaskView nextTask = mRecentsView.getNextPageTaskView();
                if (nextTask != null) {
                    int taskId = nextTask.getTask().key.id;
                    mGestureState.updateLastStartedTaskId(taskId);
                    boolean hasTaskPreviouslyAppeared = mGestureState.getPreviouslyAppearedTaskIds()
                            .contains(taskId);
@@ -158,6 +162,10 @@ public abstract class BaseSwipeUpHandler<T extends StatefulActivity<?>, Q extend
                                    mRecentsAnimationController.finish(true /* toRecents */, null);
                                }
                            }, MAIN_EXECUTOR.getHandler());
                } else {
                    mActivityInterface.onLaunchTaskFailed();
                    Toast.makeText(mContext, R.string.activity_not_available, LENGTH_SHORT).show();
                    mRecentsAnimationController.finish(true /* toRecents */, null);
                }
            }
            mCanceled = false;