use of com.android.launcher3.util.InstantAppResolver in project android_packages_apps_Trebuchet by LineageOS.
the class LoggerUtils method newItemTarget.
public static Target newItemTarget(ItemInfo info, InstantAppResolver instantAppResolver) {
Target t = newTarget(Target.Type.ITEM);
switch(info.itemType) {
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
t.itemType = (instantAppResolver != null && info instanceof AppInfo && instantAppResolver.isInstantApp(((AppInfo) info))) ? ItemType.WEB_APP : ItemType.APP_ICON;
t.predictedRank = DEFAULT_PREDICTED_RANK;
break;
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
t.itemType = ItemType.SHORTCUT;
t.predictedRank = DEFAULT_PREDICTED_RANK;
break;
case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
t.itemType = ItemType.FOLDER_ICON;
break;
case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
t.itemType = ItemType.WIDGET;
break;
case LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT:
t.itemType = ItemType.DEEPSHORTCUT;
t.predictedRank = DEFAULT_PREDICTED_RANK;
break;
}
return t;
}
use of com.android.launcher3.util.InstantAppResolver in project Neo-Launcher by NeoApplications.
the class LoggerUtils method newItemTarget.
public static Target newItemTarget(ItemInfo info, InstantAppResolver instantAppResolver) {
Target t = newTarget(Target.Type.ITEM);
switch(info.itemType) {
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
t.itemType = (instantAppResolver != null && info instanceof AppInfo && instantAppResolver.isInstantApp(((AppInfo) info))) ? ItemType.WEB_APP : ItemType.APP_ICON;
t.predictedRank = DEFAULT_PREDICTED_RANK;
break;
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
t.itemType = ItemType.SHORTCUT;
t.predictedRank = DEFAULT_PREDICTED_RANK;
break;
case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
t.itemType = ItemType.FOLDER_ICON;
break;
case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
t.itemType = ItemType.WIDGET;
break;
case LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT:
t.itemType = ItemType.DEEPSHORTCUT;
t.predictedRank = DEFAULT_PREDICTED_RANK;
break;
}
return t;
}
Aggregations