summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/ShortcutInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/ShortcutInfo.java')
-rw-r--r--src/com/android/launcher3/ShortcutInfo.java18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/com/android/launcher3/ShortcutInfo.java b/src/com/android/launcher3/ShortcutInfo.java
index fb9374314..9a9287234 100644
--- a/src/com/android/launcher3/ShortcutInfo.java
+++ b/src/com/android/launcher3/ShortcutInfo.java
@@ -31,6 +31,7 @@ import com.android.launcher3.compat.LauncherActivityInfoCompat;
import com.android.launcher3.compat.UserHandleCompat;
import com.android.launcher3.compat.UserManagerCompat;
import com.android.launcher3.folder.FolderIcon;
+import com.android.launcher3.graphics.LauncherIcons;
import com.android.launcher3.shortcuts.ShortcutInfoCompat;
/**
@@ -147,11 +148,6 @@ public class ShortcutInfo extends ItemInfo {
private int mInstallProgress;
/**
- * TODO move this to {@link #status}
- */
- int flags = 0;
-
- /**
* If this shortcut is a placeholder, then intent will be a market intent for the package, and
* this will hold the original intent from the database. Otherwise, null.
* Refer {@link #FLAG_RESTORED_ICON}, {@link #FLAG_AUTOINTALL_ICON}
@@ -188,7 +184,6 @@ public class ShortcutInfo extends ItemInfo {
intent = new Intent(info.intent);
iconResource = info.iconResource;
mIcon = info.mIcon; // TODO: should make a copy here. maybe we don't need this ctor at all
- flags = info.flags;
status = info.status;
mInstallProgress = info.mInstallProgress;
isDisabled = info.isDisabled;
@@ -200,7 +195,6 @@ public class ShortcutInfo extends ItemInfo {
super(info);
title = Utilities.trim(info.title);
intent = new Intent(info.intent);
- flags = info.flags;
isDisabled = info.isDisabled;
}
@@ -211,7 +205,6 @@ public class ShortcutInfo extends ItemInfo {
.getBadgedLabelForUser(info.getLabel(), info.getUser());
intent = AppInfo.makeLaunchIntent(context, info, info.getUser());
itemType = LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
- flags = AppInfo.initFlags(info);
}
/**
@@ -221,7 +214,6 @@ public class ShortcutInfo extends ItemInfo {
public ShortcutInfo(ShortcutInfoCompat shortcutInfo, Context context) {
user = shortcutInfo.getUserHandle();
itemType = LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT;
- flags = 0;
updateFromDeepShortcutInfo(shortcutInfo, context);
}
@@ -323,13 +315,13 @@ public class ShortcutInfo extends ItemInfo {
IconCache cache = launcherAppState.getIconCache();
Bitmap unbadgedBitmap = unbadgedDrawable == null
? cache.getDefaultIcon(UserHandleCompat.myUserHandle())
- : Utilities.createScaledBitmapWithoutShadow(unbadgedDrawable, context);
+ : LauncherIcons.createScaledBitmapWithoutShadow(unbadgedDrawable, context);
setIcon(getBadgedIcon(unbadgedBitmap, shortcutInfo, cache, context));
}
protected Bitmap getBadgedIcon(Bitmap unbadgedBitmap, ShortcutInfoCompat shortcutInfo,
IconCache cache, Context context) {
- unbadgedBitmap = Utilities.addShadowToIcon(unbadgedBitmap);
+ unbadgedBitmap = LauncherIcons.addShadowToIcon(unbadgedBitmap);
// Get the app info for the source activity.
AppInfo appInfo = new AppInfo();
appInfo.user = user;
@@ -338,9 +330,9 @@ public class ShortcutInfo extends ItemInfo {
cache.getTitleAndIcon(appInfo, shortcutInfo.getActivityInfo(context), false);
} catch (NullPointerException e) {
// This may happen when we fail to load the activity info. Worst case ignore badging.
- return Utilities.badgeIconForUser(unbadgedBitmap, user, context);
+ return LauncherIcons.badgeIconForUser(unbadgedBitmap, user, context);
}
- return Utilities.badgeWithBitmap(unbadgedBitmap, appInfo.iconBitmap, context);
+ return LauncherIcons.badgeWithBitmap(unbadgedBitmap, appInfo.iconBitmap, context);
}
/** Returns the ShortcutInfo id associated with the deep shortcut. */