Add uninstall button and it's fixes (#2840)

* Lawnchair: Add uninstall button to system shortcuts

[ghostrider-reborn] updated for android 12
[marshmello61] adapt for Lawnchair
Change-Id: I005d676d9a98f65296c330e5e13fd0d849df6fe5
Signed-off-by: Adithya <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: Mayur <ultramayur123@gmail.com>

* Lawnchair: Fix NPE in SystemShortcut

[marshmello61] adapt for Lawnchair
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Mayur <ultramayur123@gmail.com>

* Lawnchair: Use standard launcher method for uninstalling

[marshmello61] adapt for Lawnchair
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Mayur <ultramayur123@gmail.com>

* Fix PR issues

Co-authored-by: Ali B <abittin@gmail.com>
Co-authored-by: Pranav Vashi <neobuddy89@gmail.com>
Co-authored-by: Yasan Ghaffarian <y.ghafarian@dariahamrah.ir>
This commit is contained in:
authored and GitHub committed 2022-09-05 13:14:22 +04:30
1 parent 08031573ff
commit bf7e4d562c
5 files changed
+59 -11

No files matched your search

@@ -169,6 +169,7 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
private static final TaskShortcutFactory[] MENU_OPTIONS = new TaskShortcutFactory[]{
TaskShortcutFactory.APP_INFO,
TaskShortcutFactory.SPLIT_SCREEN,
TaskShortcutFactory.UNINSTALL,
TaskShortcutFactory.PIN,
TaskShortcutFactory.INSTALL,
TaskShortcutFactory.FREE_FORM,
@@ -42,6 +42,7 @@ import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.popup.SystemShortcut.AppInfo;
import com.android.launcher3.util.InstantAppResolver;
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskThumbnailView;
import com.android.quickstep.views.TaskView;
@@ -88,6 +89,11 @@ public interface TaskShortcutFactory {
}
};
TaskShortcutFactory UNINSTALL = (activity, view) ->
PackageManagerHelper.isSystemApp(activity,
view.getTask().getTopComponent().getPackageName())
? null : new SystemShortcut.UnInstall(activity, view.getItemInfo());
abstract class MultiWindowFactory implements TaskShortcutFactory {
private final int mIconRes;