Add system shortcuts when long pressing recent icon

We add a floating view for the menu that aligns with the task icon.

If available, the following shortcuts are present:
- Widgets
- App info
- Install (for instant apps)

It is designed to be straightforward to add to this list.

Bug: 70294936

Change-Id: I56c1098353d09fc564e0e92e59e4fcf692e486ba
This commit is contained in:
Tony Wickham
2017-12-14 18:38:25 -08:00
parent 9328a51271
commit 2fae2a0e9c
9 changed files with 426 additions and 13 deletions

View File

@@ -18,8 +18,11 @@ package com.android.launcher3.util;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.util.Log;
import com.android.launcher3.AppInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
@@ -44,6 +47,17 @@ public class InstantAppResolver {
return false;
}
public boolean isInstantApp(Launcher launcher, String packageName) {
PackageManager packageManager = launcher.getPackageManager();
try {
return isInstantApp(packageManager.getPackageInfo(packageName, 0).applicationInfo);
} catch (PackageManager.NameNotFoundException e) {
Log.e("InstantAppResolver", "Failed to determine whether package is instant app "
+ packageName, e);
}
return false;
}
public List<ApplicationInfo> getInstantApps() {
return Collections.emptyList();
}