Modify code so it compiles on google3
The diamond operator isn't supported on google3 Android projects. Change-Id: Ie7298b051330bb2cd32426d4c537882faa2f8ebd
This commit is contained in:
@@ -39,7 +39,7 @@ public class AppWidgetsRestoredReceiver extends BroadcastReceiver {
|
||||
*/
|
||||
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++) {
|
||||
|
||||
@@ -166,7 +166,8 @@ public class LauncherModel extends BroadcastReceiver
|
||||
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 @@ public class LauncherModel extends BroadcastReceiver
|
||||
+ " (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 @@ public class LauncherModel extends BroadcastReceiver
|
||||
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);
|
||||
|
||||
@@ -4829,7 +4829,7 @@ public class Workspace extends SmoothPagedView
|
||||
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 @@ public class Workspace extends SmoothPagedView
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user