Adding support for new APIs in O related to configurable shortcuts

> Config activities can now return PinItemRequest which can be used to pin
  deep shortcuts

Bug: 33584624
Change-Id: Ic0df436bd79e069615b9d60d24eb7594b824b2da
This commit is contained in:
Sunny Goyal
2017-01-19 10:27:54 -08:00
parent 278359539c
commit 782f0c9a89
12 changed files with 297 additions and 58 deletions

View File

@@ -17,6 +17,9 @@ import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherAppWidgetProviderInfo;
import com.android.launcher3.Utilities;
import com.android.launcher3.compat.AppWidgetManagerCompat;
import com.android.launcher3.compat.LauncherAppsCompat;
import com.android.launcher3.compat.ShortcutConfigActivityInfo;
import com.android.launcher3.compat.UserManagerCompat;
import com.android.launcher3.config.ProviderConfig;
import com.android.launcher3.util.MultiHashMap;
import com.android.launcher3.util.Preconditions;
@@ -70,9 +73,9 @@ public class WidgetsModel {
}
// Shortcuts
for (ResolveInfo info :
pm.queryIntentActivities(new Intent(Intent.ACTION_CREATE_SHORTCUT), 0)) {
widgetsAndShortcuts.add(new WidgetItem(info, pm));
for (ShortcutConfigActivityInfo info : LauncherAppsCompat.getInstance(context)
.getCustomShortcutActivityList()) {
widgetsAndShortcuts.add(new WidgetItem(info));
}
setWidgetsAndShortcuts(widgetsAndShortcuts, context);
} catch (Exception e) {