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
This commit is contained in:
Vinit Nayak
2022-02-09 15:30:19 -08:00
parent 9f0d54ebe3
commit 90e0fe3923

View File

@@ -984,13 +984,17 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
*/
public void launchSideTaskInLiveTileModeForRestartedApp(int taskId) {
int runningTaskViewId = getTaskViewIdFromTaskId(taskId);
if (mRunningTaskViewId != -1 && mRunningTaskViewId == runningTaskViewId) {
TransformParams params = mRemoteTargetHandles[0].getTransformParams();
RemoteAnimationTargets targets = params.getTargetSet();
if (targets != null && targets.findTask(taskId) != null) {
launchSideTaskInLiveTileMode(taskId, targets.apps, targets.wallpapers,
targets.nonApps);
}
if (mRunningTaskViewId == -1 ||
mRunningTaskViewId != runningTaskViewId ||
mRemoteTargetHandles == null) {
return;
}
TransformParams params = mRemoteTargetHandles[0].getTransformParams();
RemoteAnimationTargets targets = params.getTargetSet();
if (targets != null && targets.findTask(taskId) != null) {
launchSideTaskInLiveTileMode(taskId, targets.apps, targets.wallpapers,
targets.nonApps);
}
}