Merge "Adding NPE check when the system has no tasks." into mnc-dev

This commit is contained in:
Winson Chung
2015-05-27 21:27:20 +00:00
committed by Android (Google) Code Review

View File

@@ -227,7 +227,7 @@ public class SystemServicesProxy {
/** Returns the top task. */
public ActivityManager.RunningTaskInfo getTopMostTask() {
List<ActivityManager.RunningTaskInfo> tasks = getRunningTasks(1);
if (!tasks.isEmpty()) {
if (tasks != null && !tasks.isEmpty()) {
return tasks.get(0);
}
return null;