Modify code so it compiles on google3
The diamond operator isn't supported on google3 Android projects.
Change-Id: Ie7298b051330bb2cd32426d4c537882faa2f8ebd
diff --git a/src/com/android/launcher3/AppWidgetsRestoredReceiver.java b/src/com/android/launcher3/AppWidgetsRestoredReceiver.java
index 9fef7f9..80cb52d 100644
--- a/src/com/android/launcher3/AppWidgetsRestoredReceiver.java
+++ b/src/com/android/launcher3/AppWidgetsRestoredReceiver.java
@@ -39,7 +39,7 @@
*/
static void restoreAppWidgetIds(Context context, int[] oldWidgetIds, int[] newWidgetIds) {
final ContentResolver cr = context.getContentResolver();
- final List<Integer> idsToRemove = new ArrayList<>();
+ final List<Integer> idsToRemove = new ArrayList<Integer>();
final AppWidgetManager widgets = AppWidgetManager.getInstance(context);
for (int i = 0; i < oldWidgetIds.length; i++) {
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 6e5832a..e115bf1 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -166,7 +166,8 @@
static final ArrayList<Long> sBgWorkspaceScreens = new ArrayList<Long>();
// sPendingPackages is a set of packages which could be on sdcard and are not available yet
- static final HashMap<UserHandleCompat, HashSet<String>> sPendingPackages = new HashMap<>();
+ static final HashMap<UserHandleCompat, HashSet<String>> sPendingPackages =
+ new HashMap<UserHandleCompat, HashSet<String>>();
// </ only access in worker thread >
@@ -1988,7 +1989,7 @@
+ " (check again later)", true);
HashSet<String> pkgs = sPendingPackages.get(user);
if (pkgs == null) {
- pkgs = new HashSet<>();
+ pkgs = new HashSet<String>();
sPendingPackages.put(user, pkgs);
}
pkgs.add(cn.getPackageName());
@@ -2826,7 +2827,7 @@
ArrayList<String> packagesRemoved;
for (Entry<UserHandleCompat, HashSet<String>> entry : sPendingPackages.entrySet()) {
UserHandleCompat user = entry.getKey();
- packagesRemoved = new ArrayList<>();
+ packagesRemoved = new ArrayList<String>();
for (String pkg : entry.getValue()) {
if (!launcherApps.isPackageEnabledForProfile(pkg, user)) {
Launcher.addDumpLog(TAG, "Package not found: " + pkg, true);
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 1011588..6d9b34e 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -4829,7 +4829,7 @@
void updateShortcutsAndWidgets(ArrayList<AppInfo> apps) {
// Create a map of the apps to test against
final HashMap<ComponentName, AppInfo> appsMap = new HashMap<ComponentName, AppInfo>();
- final HashSet<String> pkgNames = new HashSet<>();
+ final HashSet<String> pkgNames = new HashSet<String>();
for (AppInfo ai : apps) {
appsMap.put(ai.componentName, ai);
pkgNames.add(ai.componentName.getPackageName());
@@ -4881,7 +4881,7 @@
if (state == ShortcutInfo.PACKAGE_STATE_DEFAULT) {
// Update any pending widget
- HashSet<String> packages = new HashSet<>();
+ HashSet<String> packages = new HashSet<String>();
packages.add(pkgName);
restorePendingWidgets(packages);
}