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

Commit 90e0fe39 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Add null check for mRemoteTargetHandles for side task launch

* Other checks haven't changed, only pulled them out into
separate block

Fixes: 215699962
Test: Unable to repro the crash, I tried ending the
activity and starting via adb shell, but I was never
able to get into the original if-block that triggered the NPE

Change-Id: I83320634f1d059de610176f9031682ca287bd589
parent 9f0d54eb
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -984,7 +984,12 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
     */
    public void launchSideTaskInLiveTileModeForRestartedApp(int taskId) {
        int runningTaskViewId = getTaskViewIdFromTaskId(taskId);
        if (mRunningTaskViewId != -1 && mRunningTaskViewId == runningTaskViewId) {
        if (mRunningTaskViewId == -1 ||
                mRunningTaskViewId != runningTaskViewId ||
                mRemoteTargetHandles == null) {
            return;
        }

        TransformParams params = mRemoteTargetHandles[0].getTransformParams();
        RemoteAnimationTargets targets = params.getTargetSet();
        if (targets != null && targets.findTask(taskId) != null) {
@@ -992,7 +997,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
                    targets.nonApps);
        }
    }
    }

    public void launchSideTaskInLiveTileMode(int taskId, RemoteAnimationTargetCompat[] apps,
            RemoteAnimationTargetCompat[] wallpaper, RemoteAnimationTargetCompat[] nonApps) {