Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f067ac73 authored by Winson Chung's avatar Winson Chung
Browse files

Fixing CTS regression

- Ensure IllegalArgException is thrown when invalid maxNum of recents
  is requested.

Bug: 68215720
Test: android.app.cts.ActivityManagerTest
Test: #testGetRecentTasks
Change-Id: Idaccc97c609e3deede455fb285801e8cc56a02f9
parent 7b2b1767
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1596,6 +1596,9 @@ public class ActivityManager {
    public List<RecentTaskInfo> getRecentTasks(int maxNum, int flags)
            throws SecurityException {
        try {
            if (maxNum < 0) {
                throw new IllegalArgumentException("The requested number of tasks should be >= 0");
            }
            return getService().getRecentTasks(maxNum, flags, UserHandle.myUserId()).getList();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();