Fix NPE in TaskView.

Bug: 177646952
Change-Id: I14c0244e2d4b494491092c09f96bb50d9c2ceaaf
This commit is contained in:
Yuncheol Heo
2021-01-18 12:06:04 -08:00
parent bfcc7e5f4f
commit 97ae10814c

View File

@@ -252,7 +252,9 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
mTaskOrganizer.setInterceptBackPressedOnTaskRoot(mTaskToken, true);
// TODO: Synchronize show with the resize
onLocationChanged();
setResizeBackgroundColor(taskInfo.taskDescription.getBackgroundColor());
if (taskInfo.taskDescription != null) {
setResizeBackgroundColor(taskInfo.taskDescription.getBackgroundColor());
}
if (mListener != null) {
mListenerExecutor.execute(() -> {
@@ -279,8 +281,9 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
@Override
public void onTaskInfoChanged(ActivityManager.RunningTaskInfo taskInfo) {
mTaskInfo.taskDescription = taskInfo.taskDescription;
setResizeBackgroundColor(taskInfo.taskDescription.getBackgroundColor());
if (taskInfo.taskDescription != null) {
setResizeBackgroundColor(taskInfo.taskDescription.getBackgroundColor());
}
}
@Override