diff options
author | Rajeev Kumar <rajekumar@google.com> | 2017-06-15 23:12:14 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-06-15 23:12:15 +0000 |
commit | 21e69dc14240198a2193d5a7bb214d53bc660673 (patch) | |
tree | 889e90a19c85621395295e821bf896b2f32fc5cd | |
parent | da3c18dcbd7f7a1e81872a4b983b7174ff5ca254 (diff) | |
parent | 8cae50d8b2b2e8f4d8ee76b6b8e51b66326abe7f (diff) | |
download | packages_apps_Trebuchet-21e69dc14240198a2193d5a7bb214d53bc660673.tar.gz packages_apps_Trebuchet-21e69dc14240198a2193d5a7bb214d53bc660673.tar.bz2 packages_apps_Trebuchet-21e69dc14240198a2193d5a7bb214d53bc660673.zip |
Merge "Replace use of java.util.HashMap with android.util.ArrayMap in UserManagerCompatVL class" into ub-launcher3-dorval-polish
-rw-r--r-- | src/com/android/launcher3/compat/UserManagerCompatVL.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/com/android/launcher3/compat/UserManagerCompatVL.java b/src/com/android/launcher3/compat/UserManagerCompatVL.java index c7f88f63d..bb425732c 100644 --- a/src/com/android/launcher3/compat/UserManagerCompatVL.java +++ b/src/com/android/launcher3/compat/UserManagerCompatVL.java @@ -21,13 +21,11 @@ import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.os.UserHandle; import android.os.UserManager; - +import android.util.ArrayMap; import com.android.launcher3.util.LongArrayMap; import com.android.launcher3.util.ManagedProfileHeuristic; - import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.List; public class UserManagerCompatVL extends UserManagerCompat { @@ -40,7 +38,7 @@ public class UserManagerCompatVL extends UserManagerCompat { protected LongArrayMap<UserHandle> mUsers; // Create a separate reverse map as LongArrayMap.indexOfValue checks if objects are same // and not {@link Object#equals} - protected HashMap<UserHandle, Long> mUserToSerialMap; + protected ArrayMap<UserHandle, Long> mUserToSerialMap; UserManagerCompatVL(Context context) { mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE); @@ -88,7 +86,7 @@ public class UserManagerCompatVL extends UserManagerCompat { public void enableAndResetCache() { synchronized (this) { mUsers = new LongArrayMap<>(); - mUserToSerialMap = new HashMap<>(); + mUserToSerialMap = new ArrayMap<>(); List<UserHandle> users = mUserManager.getUserProfiles(); if (users != null) { for (UserHandle user : users) { |