summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2016-02-16 17:32:35 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-02-16 17:32:36 +0000
commitbc56ca34aaa02bc4c1f83d0aad621a1eef45aab8 (patch)
treeb649fb915266b417e6fd99518d00bcaa6612ebbb
parent8da2bf49467f026da70a94d7cdf01b84d80bd07a (diff)
parent59e18729f0a3ef639356647ca14f0f1386f4e938 (diff)
Merge "Adding null check for invalid activity" into nyc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java b/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java
index 016e6d30843d..824231ae2fc1 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java
@@ -18,6 +18,7 @@ package com.android.systemui.recents.model;
import android.app.ActivityManager;
import android.content.Context;
+import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.UserInfo;
import android.content.res.Resources;
@@ -180,6 +181,7 @@ public class RecentsTaskLoadPlan {
}
// Load the title, icon, and color
+ ActivityInfo info = loader.getAndUpdateActivityInfo(taskKey);
String title = loader.getAndUpdateActivityTitle(taskKey, t.taskDescription);
String contentDescription = loader.getAndUpdateContentDescription(taskKey, res);
String dismissDescription = dismissDescFormatter.format(dismissDescFormat,
@@ -190,8 +192,8 @@ public class RecentsTaskLoadPlan {
Bitmap thumbnail = loader.getAndUpdateThumbnail(taskKey, false);
int activityColor = loader.getActivityPrimaryColor(t.taskDescription);
int backgroundColor = loader.getActivityBackgroundColor(t.taskDescription);
- boolean isSystemApp = (loader.getAndUpdateActivityInfo(taskKey).applicationInfo.flags
- & ApplicationInfo.FLAG_SYSTEM) != 0;
+ boolean isSystemApp = (info != null) &&
+ ((info.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0);
// Add the task to the stack
Task task = new Task(taskKey, t.affiliatedTaskId, t.affiliatedTaskColor, icon,