public ResolveInfo getResolveInfo() { if (mComponentName == null) { return null; } ItemInfo itemInfo; if ("Widget".equals(mType)) { itemInfo = LauncherModel.getInstance().findWidgetItem(mComponentName); } else { itemInfo = LauncherModel.getInstance().findAppItem(mComponentName); } if (itemInfo != null) { return itemInfo.getResolveInfo(); } return null; }
/** Get sorted apps by name */ public static ArrayList<AppItemInfo> getSortedAppsByName() { ArrayList<AppItemInfo> apps = LauncherModel.getInstance().getApps(); try { Collections.sort(apps, new AppComparator()); } catch (Exception e) { } return apps; }
public void init(Context context) { File file = new File(HomeUtils.get3DHomePath() + File.separator + ".debug"); if (file.exists()) { HomeUtils.DEBUG = true; } System.setProperty("java.util.Arrays.useLegacyMergeSort", "true"); SESceneManager.getInstance().initEngine(context); SESceneManager.getInstance().enableLight(true); SESceneManager.setDebug_JNI(HomeUtils.DEBUG); createOrUpgradeDB(); LauncherModel.getInstance().loadAllData(false); mTimeCallBacks = new ArrayList<TimeChangeCallBack>(); mAppWidgetManager = AppWidgetManager.getInstance(context); mAppIconBackgroundType = SettingsActivity.getAppIconBackgroundType(getContext()); mShowAppShef = SettingsActivity.getShowShelfSetting(getContext()); mShowDeskObjectShef = SettingsActivity.getShowDeskObjectShelfSetting(getContext()); mShowAllIndicator = SettingsActivity.isEnableWallIndicator(getContext()); mShowHelpDialog = !SettingsActivity.getHelpStatus(getContext()); mCurSceneOrientation = SceneOrientation.AUTO_PORT; }
public static ComponentName getCategoryComponentName(Context context, String[] keywords) { ComponentName componentName = null; if (keywords != null) { List<AppItemInfo> apps = LauncherModel.getInstance().getApps(); for (String keyword : keywords) { for (AppItemInfo info : apps) { ResolveInfo ri = info.getResolveInfo(); if (ri.activityInfo.name.toLowerCase().contains(keyword)) { componentName = new ComponentName(ri.activityInfo.packageName, ri.activityInfo.name); break; } if (componentName != null) { break; } } } } return componentName; }