Merge "Revert "Lists returned from OS aren't mutable.""
This commit is contained in:
@@ -17,15 +17,12 @@
|
||||
package android.content.pm;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import dalvik.system.VMRuntime;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -130,11 +127,7 @@ public class ParceledListSlice<T extends Parcelable> implements Parcelable {
|
||||
}
|
||||
|
||||
public List<T> getList() {
|
||||
if (VMRuntime.getRuntime().getTargetSdkVersion() > Build.VERSION_CODES.N_MR1) {
|
||||
return Collections.unmodifiableList(mList);
|
||||
} else {
|
||||
return mList;
|
||||
}
|
||||
return mList;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -104,8 +104,8 @@ public class RecentsTaskLoadPlan {
|
||||
int currentUserId = UserHandle.USER_CURRENT;
|
||||
updateCurrentQuietProfilesCache(currentUserId);
|
||||
SystemServicesProxy ssp = Recents.getSystemServices();
|
||||
mRawTasks = new ArrayList<>(ssp.getRecentTasks(ActivityManager.getMaxRecentTasksStatic(),
|
||||
currentUserId, includeFrontMostExcludedTask, mCurrentQuietProfiles));
|
||||
mRawTasks = ssp.getRecentTasks(ActivityManager.getMaxRecentTasksStatic(),
|
||||
currentUserId, includeFrontMostExcludedTask, mCurrentQuietProfiles);
|
||||
|
||||
// Since the raw tasks are given in most-recent to least-recent order, we need to reverse it
|
||||
Collections.reverse(mRawTasks);
|
||||
|
||||
Reference in New Issue
Block a user