diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java index 383e6efd07..d057f3247e 100644 --- a/src/com/android/launcher3/IconCache.java +++ b/src/com/android/launcher3/IconCache.java @@ -41,7 +41,6 @@ import android.os.UserHandle; import android.support.annotation.NonNull; import android.text.TextUtils; import android.util.Log; - import com.android.launcher3.compat.LauncherAppsCompat; import com.android.launcher3.compat.UserManagerCompat; import com.android.launcher3.config.FeatureFlags; @@ -52,7 +51,6 @@ import com.android.launcher3.util.Preconditions; import com.android.launcher3.util.Provider; import com.android.launcher3.util.SQLiteCacheHelper; import com.android.launcher3.util.Thunk; - import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -91,7 +89,7 @@ public class IconCache { private final Context mContext; private final PackageManager mPackageManager; - private IconProvider mIconProvider; + private final IconProvider mIconProvider; @Thunk final UserManagerCompat mUserManager; private final LauncherAppsCompat mLauncherApps; private final HashMap mCache = @@ -193,7 +191,7 @@ public class IconCache { * Remove any records for the supplied package name from memory. */ private void removeFromMemCacheLocked(String packageName, UserHandle user) { - HashSet forDeletion = new HashSet(); + HashSet forDeletion = new HashSet<>(); for (ComponentKey key: mCache.keySet()) { if (key.componentName.getPackageName().equals(packageName) && key.user.equals(user)) { @@ -219,7 +217,6 @@ public class IconCache { } } catch (NameNotFoundException e) { Log.d(TAG, "Package not found", e); - return; } } @@ -264,7 +261,7 @@ public class IconCache { Set ignorePackages) { long userSerial = mUserManager.getSerialNumberForUser(user); PackageManager pm = mContext.getPackageManager(); - HashMap pkgInfoMap = new HashMap(); + HashMap pkgInfoMap = new HashMap<>(); for (PackageInfo info : pm.getInstalledPackages(PackageManager.GET_UNINSTALLED_PACKAGES)) { pkgInfoMap.put(info.packageName, info); } @@ -274,7 +271,7 @@ public class IconCache { componentMap.put(app.getComponentName(), app); } - HashSet itemsToRemove = new HashSet(); + HashSet itemsToRemove = new HashSet<>(); Stack appsToUpdate = new Stack<>(); Cursor c = null; @@ -704,7 +701,7 @@ public class IconCache { private final HashMap mPkgInfoMap; private final Stack mAppsToAdd; private final Stack mAppsToUpdate; - private final HashSet mUpdatedPackages = new HashSet(); + private final HashSet mUpdatedPackages = new HashSet<>(); @Thunk SerializedIconUpdateTask(long userSerial, HashMap pkgInfoMap, Stack appsToAdd,