Loading src/com/android/launcher3/IconCache.java +10 −6 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ public class IconCache { mIconDpi = activityManager.getLauncherLargeIconDensity(); mIconDb = new IconDB(context); mWorkerHandler = new Handler(LauncherModel.sWorkerThread.getLooper()); mWorkerHandler = new Handler(LauncherModel.getWorkerLooper()); } private Drawable getFullResDefaultActivityIcon() { Loading Loading @@ -388,16 +388,20 @@ public class IconCache { return new IconLoadRequest(request, mWorkerHandler); } private Bitmap getNonNullIcon(CacheEntry entry, UserHandleCompat user) { return entry.icon == null ? getDefaultIcon(user) : entry.icon; } /** * Fill in "application" with the icon and label for "info." */ public synchronized void getTitleAndIcon(AppInfo application, LauncherActivityInfoCompat info, boolean useLowResIcon) { CacheEntry entry = cacheLocked(application.componentName, info, info == null ? application.user : info.getUser(), UserHandleCompat user = info == null ? application.user : info.getUser(); CacheEntry entry = cacheLocked(application.componentName, info, user, false, useLowResIcon); application.title = entry.title; application.iconBitmap = entry.icon; application.iconBitmap = getNonNullIcon(entry, user); application.contentDescription = entry.contentDescription; application.usingLowResIcon = entry.isLowResIcon; } Loading Loading @@ -445,7 +449,7 @@ public class IconCache { ShortcutInfo shortcutInfo, ComponentName component, LauncherActivityInfoCompat info, UserHandleCompat user, boolean usePkgIcon, boolean useLowResIcon) { CacheEntry entry = cacheLocked(component, info, user, usePkgIcon, useLowResIcon); shortcutInfo.setIcon(entry.icon); shortcutInfo.setIcon(getNonNullIcon(entry, user)); shortcutInfo.title = entry.title; shortcutInfo.usingFallbackIcon = isDefaultIcon(entry.icon, user); shortcutInfo.usingLowResIcon = entry.isLowResIcon; Loading @@ -458,7 +462,7 @@ public class IconCache { String packageName, UserHandleCompat user, boolean useLowResIcon, PackageItemInfo infoOut) { CacheEntry entry = getEntryForPackageLocked(packageName, user, useLowResIcon); infoOut.iconBitmap = entry.icon; infoOut.iconBitmap = getNonNullIcon(entry, user); infoOut.title = entry.title; infoOut.usingLowResIcon = entry.isLowResIcon; infoOut.contentDescription = entry.contentDescription; Loading src/com/android/launcher3/InstallShortcutReceiver.java +2 −6 Original line number Diff line number Diff line Loading @@ -199,13 +199,9 @@ public class InstallShortcutReceiver extends BroadcastReceiver { } } final boolean exists = LauncherModel.shortcutExists(context, pendingInfo.label, intent, pendingInfo.user); if (!exists) { // Generate a shortcut info to add into the model addShortcuts.add(pendingInfo.getShortcutInfo()); } } // Add the new apps to the model and bind them if (!addShortcuts.isEmpty()) { Loading src/com/android/launcher3/Launcher.java +14 −22 Original line number Diff line number Diff line Loading @@ -98,8 +98,6 @@ import com.android.launcher3.PagedView.PageSwitchListener; import com.android.launcher3.compat.AppWidgetManagerCompat; import com.android.launcher3.compat.LauncherActivityInfoCompat; import com.android.launcher3.compat.LauncherAppsCompat; import com.android.launcher3.compat.PackageInstallerCompat; import com.android.launcher3.compat.PackageInstallerCompat.PackageInstallInfo; import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.compat.UserManagerCompat; import com.android.launcher3.util.Thunk; Loading Loading @@ -1060,9 +1058,6 @@ public class Launcher extends Activity getWorkspace().reinflateWidgetsIfNecessary(); reinflateQSBIfNecessary(); // Process any items that were added while Launcher was away. InstallShortcutReceiver.disableAndFlushInstallQueue(this); if (DEBUG_RESUME_TIME) { Log.d(TAG, "Time spent in onResume: " + (System.currentTimeMillis() - startTime)); } Loading @@ -1078,7 +1073,10 @@ public class Launcher extends Activity mWorkspace.updateInteractionForState(); mWorkspace.onResume(); PackageInstallerCompat.getInstance(this).onResume(); if (!isWorkspaceLoading()) { // Process any items that were added while Launcher was away. InstallShortcutReceiver.disableAndFlushInstallQueue(this); } if (mLauncherCallbacks != null) { mLauncherCallbacks.onResume(); Loading @@ -1089,7 +1087,6 @@ public class Launcher extends Activity protected void onPause() { // Ensure that items added to Launcher are queued until Launcher returns InstallShortcutReceiver.enableInstallQueue(); PackageInstallerCompat.getInstance(this).onPause(); super.onPause(); mPaused = true; Loading Loading @@ -4084,7 +4081,7 @@ public class Launcher extends Activity sPendingAddItem = null; } PackageInstallerCompat.getInstance(this).onFinishBind(); InstallShortcutReceiver.disableAndFlushInstallQueue(this); if (mLauncherCallbacks != null) { mLauncherCallbacks.finishBindingItems(false); Loading Loading @@ -4236,22 +4233,17 @@ public class Launcher extends Activity * Implementation of the method from LauncherModel.Callbacks. */ @Override public void updatePackageState(ArrayList<PackageInstallInfo> installInfo) { if (mWorkspace != null) { mWorkspace.updatePackageState(installInfo); public void bindRestoreItemsChange(final HashSet<ItemInfo> updates) { Runnable r = new Runnable() { public void run() { bindRestoreItemsChange(updates); } }; if (waitUntilResume(r)) { return; } /** * Update the label and icon of all the icons in a package * * Implementation of the method from LauncherModel.Callbacks. */ @Override public void updatePackageBadge(String packageName) { if (mWorkspace != null) { mWorkspace.updatePackageBadge(packageName, UserHandleCompat.myUserHandle()); } mWorkspace.updateRestoreItems(updates); } /** Loading src/com/android/launcher3/LauncherAppState.java +0 −11 Original line number Diff line number Diff line Loading @@ -256,15 +256,4 @@ public class LauncherAppState implements DeviceProfile.DeviceProfileCallbacks { public static boolean isDogfoodBuild() { return getInstance().mBuildInfo.isDogfoodBuild(); } public void setPackageState(ArrayList<PackageInstallInfo> installInfo) { mModel.setPackageState(installInfo); } /** * Updates the icons and label of all icons for the provided package name. */ public void updatePackageBadge(String packageName) { mModel.updatePackageBadge(packageName); } } src/com/android/launcher3/LauncherFiles.java +2 −1 Original line number Diff line number Diff line Loading @@ -42,5 +42,6 @@ public class LauncherFiles { // TODO: Delete these files on upgrade public static final List<String> OBSOLETE_FILES = Collections.unmodifiableList(Arrays.asList( "launches.log", "stats.log")); "stats.log", "com.android.launcher3.compat.PackageInstallerCompatV16.queue")); } Loading
src/com/android/launcher3/IconCache.java +10 −6 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ public class IconCache { mIconDpi = activityManager.getLauncherLargeIconDensity(); mIconDb = new IconDB(context); mWorkerHandler = new Handler(LauncherModel.sWorkerThread.getLooper()); mWorkerHandler = new Handler(LauncherModel.getWorkerLooper()); } private Drawable getFullResDefaultActivityIcon() { Loading Loading @@ -388,16 +388,20 @@ public class IconCache { return new IconLoadRequest(request, mWorkerHandler); } private Bitmap getNonNullIcon(CacheEntry entry, UserHandleCompat user) { return entry.icon == null ? getDefaultIcon(user) : entry.icon; } /** * Fill in "application" with the icon and label for "info." */ public synchronized void getTitleAndIcon(AppInfo application, LauncherActivityInfoCompat info, boolean useLowResIcon) { CacheEntry entry = cacheLocked(application.componentName, info, info == null ? application.user : info.getUser(), UserHandleCompat user = info == null ? application.user : info.getUser(); CacheEntry entry = cacheLocked(application.componentName, info, user, false, useLowResIcon); application.title = entry.title; application.iconBitmap = entry.icon; application.iconBitmap = getNonNullIcon(entry, user); application.contentDescription = entry.contentDescription; application.usingLowResIcon = entry.isLowResIcon; } Loading Loading @@ -445,7 +449,7 @@ public class IconCache { ShortcutInfo shortcutInfo, ComponentName component, LauncherActivityInfoCompat info, UserHandleCompat user, boolean usePkgIcon, boolean useLowResIcon) { CacheEntry entry = cacheLocked(component, info, user, usePkgIcon, useLowResIcon); shortcutInfo.setIcon(entry.icon); shortcutInfo.setIcon(getNonNullIcon(entry, user)); shortcutInfo.title = entry.title; shortcutInfo.usingFallbackIcon = isDefaultIcon(entry.icon, user); shortcutInfo.usingLowResIcon = entry.isLowResIcon; Loading @@ -458,7 +462,7 @@ public class IconCache { String packageName, UserHandleCompat user, boolean useLowResIcon, PackageItemInfo infoOut) { CacheEntry entry = getEntryForPackageLocked(packageName, user, useLowResIcon); infoOut.iconBitmap = entry.icon; infoOut.iconBitmap = getNonNullIcon(entry, user); infoOut.title = entry.title; infoOut.usingLowResIcon = entry.isLowResIcon; infoOut.contentDescription = entry.contentDescription; Loading
src/com/android/launcher3/InstallShortcutReceiver.java +2 −6 Original line number Diff line number Diff line Loading @@ -199,13 +199,9 @@ public class InstallShortcutReceiver extends BroadcastReceiver { } } final boolean exists = LauncherModel.shortcutExists(context, pendingInfo.label, intent, pendingInfo.user); if (!exists) { // Generate a shortcut info to add into the model addShortcuts.add(pendingInfo.getShortcutInfo()); } } // Add the new apps to the model and bind them if (!addShortcuts.isEmpty()) { Loading
src/com/android/launcher3/Launcher.java +14 −22 Original line number Diff line number Diff line Loading @@ -98,8 +98,6 @@ import com.android.launcher3.PagedView.PageSwitchListener; import com.android.launcher3.compat.AppWidgetManagerCompat; import com.android.launcher3.compat.LauncherActivityInfoCompat; import com.android.launcher3.compat.LauncherAppsCompat; import com.android.launcher3.compat.PackageInstallerCompat; import com.android.launcher3.compat.PackageInstallerCompat.PackageInstallInfo; import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.compat.UserManagerCompat; import com.android.launcher3.util.Thunk; Loading Loading @@ -1060,9 +1058,6 @@ public class Launcher extends Activity getWorkspace().reinflateWidgetsIfNecessary(); reinflateQSBIfNecessary(); // Process any items that were added while Launcher was away. InstallShortcutReceiver.disableAndFlushInstallQueue(this); if (DEBUG_RESUME_TIME) { Log.d(TAG, "Time spent in onResume: " + (System.currentTimeMillis() - startTime)); } Loading @@ -1078,7 +1073,10 @@ public class Launcher extends Activity mWorkspace.updateInteractionForState(); mWorkspace.onResume(); PackageInstallerCompat.getInstance(this).onResume(); if (!isWorkspaceLoading()) { // Process any items that were added while Launcher was away. InstallShortcutReceiver.disableAndFlushInstallQueue(this); } if (mLauncherCallbacks != null) { mLauncherCallbacks.onResume(); Loading @@ -1089,7 +1087,6 @@ public class Launcher extends Activity protected void onPause() { // Ensure that items added to Launcher are queued until Launcher returns InstallShortcutReceiver.enableInstallQueue(); PackageInstallerCompat.getInstance(this).onPause(); super.onPause(); mPaused = true; Loading Loading @@ -4084,7 +4081,7 @@ public class Launcher extends Activity sPendingAddItem = null; } PackageInstallerCompat.getInstance(this).onFinishBind(); InstallShortcutReceiver.disableAndFlushInstallQueue(this); if (mLauncherCallbacks != null) { mLauncherCallbacks.finishBindingItems(false); Loading Loading @@ -4236,22 +4233,17 @@ public class Launcher extends Activity * Implementation of the method from LauncherModel.Callbacks. */ @Override public void updatePackageState(ArrayList<PackageInstallInfo> installInfo) { if (mWorkspace != null) { mWorkspace.updatePackageState(installInfo); public void bindRestoreItemsChange(final HashSet<ItemInfo> updates) { Runnable r = new Runnable() { public void run() { bindRestoreItemsChange(updates); } }; if (waitUntilResume(r)) { return; } /** * Update the label and icon of all the icons in a package * * Implementation of the method from LauncherModel.Callbacks. */ @Override public void updatePackageBadge(String packageName) { if (mWorkspace != null) { mWorkspace.updatePackageBadge(packageName, UserHandleCompat.myUserHandle()); } mWorkspace.updateRestoreItems(updates); } /** Loading
src/com/android/launcher3/LauncherAppState.java +0 −11 Original line number Diff line number Diff line Loading @@ -256,15 +256,4 @@ public class LauncherAppState implements DeviceProfile.DeviceProfileCallbacks { public static boolean isDogfoodBuild() { return getInstance().mBuildInfo.isDogfoodBuild(); } public void setPackageState(ArrayList<PackageInstallInfo> installInfo) { mModel.setPackageState(installInfo); } /** * Updates the icons and label of all icons for the provided package name. */ public void updatePackageBadge(String packageName) { mModel.updatePackageBadge(packageName); } }
src/com/android/launcher3/LauncherFiles.java +2 −1 Original line number Diff line number Diff line Loading @@ -42,5 +42,6 @@ public class LauncherFiles { // TODO: Delete these files on upgrade public static final List<String> OBSOLETE_FILES = Collections.unmodifiableList(Arrays.asList( "launches.log", "stats.log")); "stats.log", "com.android.launcher3.compat.PackageInstallerCompatV16.queue")); }