<!-- Name of a subclass of AppFilter used to filter the activities shown in the launcher. Can be empty. --> <stringname="app_filter_class"translatable="false"></string>
<!-- Name of a subclass of AppFilter used to filter the activities shown in the launcher. Can be empty. --> <stringname="app_filter_class"translatable="false">com.android.launcher3.AppFilterImpl</string>
/** * Add the supplied ApplicationInfo objects to the list, and enqueue it into the * list to broadcast when notify() is called. * * If the app is already in the list, doesn't add it. */ publicvoidadd(AppInfo info) { if (mAppFilter != null && !mAppFilter.shouldShowApp(info.componentName)) { return; } if (findActivity(data, info.componentName, info.user)) { return; } data.add(info); added.add(info); }
// Temporary list for {@link PackageItemInfos} to avoid having to go through // {@link mPackageItemInfos} to locate the key to be used for {@link #mWidgetsList} HashMap<String, PackageItemInfo> tmpPackageItemInfos = newHashMap<>();
// clear the lists. mWidgetsList.clear(); mPackageItemInfos.clear(); mWidgetAndShortcutNameComparator.reset();
// add and update. for (Object o: rawWidgetsShortcuts) { StringpackageName=""; UserHandleCompatuserHandle=null; ComponentNamecomponentName=null; if (o instanceof LauncherAppWidgetProviderInfo) { LauncherAppWidgetProviderInfowidgetInfo= (LauncherAppWidgetProviderInfo) o;
// Ensure that all widgets we show can be added on a workspace of this size intminSpanX= Math.min(widgetInfo.spanX, widgetInfo.minSpanX); intminSpanY= Math.min(widgetInfo.spanY, widgetInfo.minSpanY); if (minSpanX <= (int) idp.numColumns && minSpanY <= (int) idp.numRows) { componentName = widgetInfo.provider; packageName = widgetInfo.provider.getPackageName(); userHandle = mAppWidgetMgr.getUser(widgetInfo); } else { if (DEBUG) { Log.d(TAG, String.format( "Widget %s : (%d X %d) can't fit on this device", widgetInfo.provider, minSpanX, minSpanY)); } continue; } } elseif (o instanceof ResolveInfo) { ResolveInforesolveInfo= (ResolveInfo) o; componentName = newComponentName(resolveInfo.activityInfo.packageName, resolveInfo.activityInfo.name); packageName = resolveInfo.activityInfo.packageName; userHandle = UserHandleCompat.myUserHandle(); }
if (componentName == null || userHandle == null) { Log.e(TAG, String.format("Widget cannot be set for %s.", o.getClass().toString())); continue; }
if (mAppFilter != null && !mAppFilter.shouldShowApp(componentName)) { if (DEBUG) { Log.d(TAG, String.format("%s is filtered and not added to the widget tray.", packageName)); } continue; }
if (mAppFilter != null && !mAppFilter.shouldShowApp(componentName)) { if (DEBUG) { Log.d(TAG, String.format("%s is filtered and not added to the widget tray.", packageName)); } continue; }
if (mWidgetFilter != null && !mWidgetFilter.shouldShowAppWidget(componentName)) { continue; }