summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2019-03-01 10:41:09 -0800
committerTony <twickham@google.com>2019-03-01 16:34:59 -0800
commit37d3a1ff411d635a3a0a5b88173e3f499fd75c35 (patch)
treec54e0bb3754c24332e9df1c5e8f8260a55d3173e
parent9db9d62b278c69ba62993696f0456ab5c0e39a95 (diff)
downloadandroid_packages_apps_Trebuchet-37d3a1ff411d635a3a0a5b88173e3f499fd75c35.tar.gz
android_packages_apps_Trebuchet-37d3a1ff411d635a3a0a5b88173e3f499fd75c35.tar.bz2
android_packages_apps_Trebuchet-37d3a1ff411d635a3a0a5b88173e3f499fd75c35.zip
Don't crash if there's no running task view when going home
Change-Id: Ib5e9ce961aa4dc6b15da34713967f6ad9dde2054
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java12
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java2
2 files changed, 9 insertions, 5 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java
index 408b749a6..9650a5316 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java
@@ -100,10 +100,14 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
public HomeAnimationFactory prepareHomeUI(Launcher activity) {
final DeviceProfile dp = activity.getDeviceProfile();
final RecentsView recentsView = activity.getOverviewPanel();
- final ComponentName component = recentsView.getRunningTaskView().getTask().key
- .sourceComponent;
-
- final View workspaceView = activity.getWorkspace().getFirstMatchForAppClose(component);
+ final TaskView runningTaskView = recentsView.getRunningTaskView();
+ final View workspaceView;
+ if (runningTaskView != null) {
+ ComponentName component = runningTaskView.getTask().key.sourceComponent;
+ workspaceView = activity.getWorkspace().getFirstMatchForAppClose(component);
+ } else {
+ workspaceView = null;
+ }
final Rect iconLocation = new Rect();
final FloatingIconView floatingView = workspaceView == null ? null
: FloatingIconView.getFloatingIconView(activity, workspaceView,
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
index a7bf2c3ee..3e0e8ae58 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
@@ -773,7 +773,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
setCurrentTask(runningTaskId);
}
- public TaskView getRunningTaskView() {
+ public @Nullable TaskView getRunningTaskView() {
return getTaskView(mRunningTaskId);
}