summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRajeev Kumar <rajekumar@google.com>2017-06-12 19:57:48 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-06-12 19:57:48 +0000
commit606d3836a522ebf11a27f72717bf96958a3c99a7 (patch)
tree65dcccb9fbf6fe9449d553325ff40e1458a45849 /src
parent97d7491343f65ac1293630088bec05f5ed808842 (diff)
parent0a3169bc6652f8cfb0b57ec9d6ac7491b5126bf8 (diff)
downloadandroid_packages_apps_Trebuchet-606d3836a522ebf11a27f72717bf96958a3c99a7.tar.gz
android_packages_apps_Trebuchet-606d3836a522ebf11a27f72717bf96958a3c99a7.tar.bz2
android_packages_apps_Trebuchet-606d3836a522ebf11a27f72717bf96958a3c99a7.zip
Merge "1. Replace use of java.util.HashMap with android.util.ArrayMap in ShortcutCache class 2. Get rid of unused constants from ShortcutCache class 3. Make instance variables final" into ub-launcher3-dorval-polish
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/shortcuts/ShortcutCache.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/com/android/launcher3/shortcuts/ShortcutCache.java b/src/com/android/launcher3/shortcuts/ShortcutCache.java
index d4db96d31..5742d1de3 100644
--- a/src/com/android/launcher3/shortcuts/ShortcutCache.java
+++ b/src/com/android/launcher3/shortcuts/ShortcutCache.java
@@ -19,9 +19,8 @@ package com.android.launcher3.shortcuts;
import android.annotation.TargetApi;
import android.os.Build;
import android.os.UserHandle;
+import android.util.ArrayMap;
import android.util.LruCache;
-
-import java.util.HashMap;
import java.util.List;
/**
@@ -31,18 +30,15 @@ import java.util.List;
*/
@TargetApi(Build.VERSION_CODES.N)
public class ShortcutCache {
- private static final String TAG = "ShortcutCache";
- private static final boolean LOGD = false;
-
private static final int CACHE_SIZE = 30; // Max number shortcuts we cache.
- private LruCache<ShortcutKey, ShortcutInfoCompat> mCachedShortcuts;
+ private final LruCache<ShortcutKey, ShortcutInfoCompat> mCachedShortcuts;
// We always keep pinned shortcuts in the cache.
- private HashMap<ShortcutKey, ShortcutInfoCompat> mPinnedShortcuts;
+ private final ArrayMap<ShortcutKey, ShortcutInfoCompat> mPinnedShortcuts;
public ShortcutCache() {
mCachedShortcuts = new LruCache<>(CACHE_SIZE);
- mPinnedShortcuts = new HashMap<>();
+ mPinnedShortcuts = new ArrayMap<>();
}
/**