OSDN Git Service

Prevent task in recents being empty when activity info in unavailable
authorMatthew Ng <ngmatthew@google.com>
Thu, 19 Oct 2017 23:04:30 +0000 (16:04 -0700)
committerMatthew Ng <ngmatthew@google.com>
Thu, 19 Oct 2017 23:04:30 +0000 (16:04 -0700)
When an app is unavailable to get its activity info, it will not have a
color, title or icon and it would look weird in recents. Therefore skip
adding it to the recents list when this occurs.

Test: manual
Change-Id: I1cf2f7f8ea5ce132159f6aabfbfae31df0187660
Fixes: 64236158

packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/RecentsTaskLoadPlan.java

index c9368f3..806a073 100644 (file)
@@ -115,8 +115,12 @@ public class RecentsTaskLoadPlan {
             boolean isStackTask = !isFreeformTask;
             boolean isLaunchTarget = taskKey.id == runningTaskId;
 
-            // Load the title, icon, and color
             ActivityInfo info = loader.getAndUpdateActivityInfo(taskKey);
+            if (info == null) {
+                continue;
+            }
+
+            // Load the title, icon, and color
             String title = loader.getAndUpdateActivityTitle(taskKey, t.taskDescription);
             String titleDescription = loader.getAndUpdateContentDescription(taskKey,
                     t.taskDescription);