use of com.android.launcher3.userevent.nano.LauncherLogProto.ItemType in project android_packages_apps_Launcher3 by AOSPA.
the class LoaderCursor method getRestoredItemInfo.
/**
* Make an WorkspaceItemInfo object for a restored application or shortcut item that points
* to a package that is not yet installed on the system.
*/
public WorkspaceItemInfo getRestoredItemInfo(Intent intent) {
final WorkspaceItemInfo info = new WorkspaceItemInfo();
info.user = user;
info.intent = intent;
// the fallback icon
if (!loadIcon(info)) {
mIconCache.getTitleAndIcon(info, false);
}
if (hasRestoreFlag(WorkspaceItemInfo.FLAG_RESTORED_ICON)) {
String title = getTitle();
if (!TextUtils.isEmpty(title)) {
info.title = Utilities.trim(title);
}
} else if (hasRestoreFlag(WorkspaceItemInfo.FLAG_AUTOINSTALL_ICON)) {
if (TextUtils.isEmpty(info.title)) {
info.title = getTitle();
}
} else {
throw new InvalidParameterException("Invalid restoreType " + restoreFlag);
}
info.contentDescription = mPM.getUserBadgedLabel(info.title, info.user);
info.itemType = itemType;
info.status = restoreFlag;
return info;
}
Aggregations