Just return an empty list if the system returns null

Bug: 206648922
Test: Presubmit (unable to reproduce this)
Change-Id: I04a4759a1c237513ab314ece4acd542e1407edb1
This commit is contained in:
Winson Chung
2022-02-25 06:41:45 +00:00
parent 2a431f4a79
commit e479619836
@@ -816,8 +816,12 @@ public class SystemUiProxy implements ISystemUiProxy,
public ArrayList<GroupedRecentTaskInfo> getRecentTasks(int numTasks, int userId) {
if (mRecentTasks != null) {
try {
return new ArrayList<>(Arrays.asList(mRecentTasks.getRecentTasks(numTasks,
RECENT_IGNORE_UNAVAILABLE, userId)));
final GroupedRecentTaskInfo[] rawTasks = mRecentTasks.getRecentTasks(numTasks,
RECENT_IGNORE_UNAVAILABLE, userId);
if (rawTasks == null) {
return new ArrayList<>();
}
return new ArrayList<>(Arrays.asList(rawTasks));
} catch (RemoteException e) {
Log.w(TAG, "Failed call getRecentTasks", e);
}