diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-01-19 10:27:54 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-01-19 13:54:31 -0800 |
commit | 782f0c9a896db58aeaa60d15f291831b8d7b4c93 (patch) | |
tree | b8d8b2da1ae765811dedd9a9ec55d3c27898d727 /src/com/android/launcher3/compat/LauncherAppsCompatVL.java | |
parent | 278359539c02ca160caf1df54ce96053a2a2ef59 (diff) | |
download | android_packages_apps_Trebuchet-782f0c9a896db58aeaa60d15f291831b8d7b4c93.tar.gz android_packages_apps_Trebuchet-782f0c9a896db58aeaa60d15f291831b8d7b4c93.tar.bz2 android_packages_apps_Trebuchet-782f0c9a896db58aeaa60d15f291831b8d7b4c93.zip |
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
Diffstat (limited to 'src/com/android/launcher3/compat/LauncherAppsCompatVL.java')
-rw-r--r-- | src/com/android/launcher3/compat/LauncherAppsCompatVL.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/launcher3/compat/LauncherAppsCompatVL.java b/src/com/android/launcher3/compat/LauncherAppsCompatVL.java index e2739c10e..3cb721ccc 100644 --- a/src/com/android/launcher3/compat/LauncherAppsCompatVL.java +++ b/src/com/android/launcher3/compat/LauncherAppsCompatVL.java @@ -21,11 +21,14 @@ import android.content.Context; import android.content.Intent; import android.content.pm.LauncherActivityInfo; import android.content.pm.LauncherApps; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; import android.content.pm.ShortcutInfo; import android.graphics.Rect; import android.os.Bundle; import android.os.UserHandle; +import com.android.launcher3.compat.ShortcutConfigActivityInfo.ShortcutConfigActivityInfoVL; import com.android.launcher3.shortcuts.ShortcutInfoCompat; import java.util.ArrayList; @@ -35,11 +38,13 @@ import java.util.Map; public class LauncherAppsCompatVL extends LauncherAppsCompat { - protected LauncherApps mLauncherApps; + protected final LauncherApps mLauncherApps; + protected final Context mContext; private Map<OnAppsChangedCallbackCompat, WrappedCallback> mCallbacks = new HashMap<>(); LauncherAppsCompatVL(Context context) { + mContext = context; mLauncherApps = (LauncherApps) context.getSystemService(Context.LAUNCHER_APPS_SERVICE); } @@ -140,5 +145,16 @@ public class LauncherAppsCompatVL extends LauncherAppsCompat { mCallback.onShortcutsChanged(packageName, shortcutInfoCompats, user); } } + + @Override + public List<ShortcutConfigActivityInfo> getCustomShortcutActivityList() { + PackageManager pm = mContext.getPackageManager(); + List<ShortcutConfigActivityInfo> result = new ArrayList<>(); + for (ResolveInfo info : + pm.queryIntentActivities(new Intent(Intent.ACTION_CREATE_SHORTCUT), 0)) { + result.add(new ShortcutConfigActivityInfoVL(info.activityInfo, pm)); + } + return result; + } } |