diff --git a/src/com/android/launcher3/popup/SystemShortcut.java b/src/com/android/launcher3/popup/SystemShortcut.java index 80de8f1a3c..c588014197 100644 --- a/src/com/android/launcher3/popup/SystemShortcut.java +++ b/src/com/android/launcher3/popup/SystemShortcut.java @@ -7,6 +7,8 @@ import android.app.ActivityOptions; import android.content.Context; import android.content.Intent; import android.graphics.Rect; +import android.net.Uri; +import android.util.Log; import android.view.View; import android.view.InflateException; import android.view.accessibility.AccessibilityNodeInfo; @@ -30,6 +32,7 @@ import com.android.launcher3.views.ActivityContext; import com.android.launcher3.widget.WidgetsBottomSheet; import com.android.launcher3.customization.InfoBottomSheet; +import java.net.URISyntaxException; import java.util.List; /** @@ -273,11 +276,15 @@ public abstract class SystemShortcut extend @Override public void onClick(View view) { - String packageName = mItemInfo.getTargetComponent().getPackageName(); - Intent intent = new PackageManagerHelper( - view.getContext()).getUninstallIntent(packageName); - mTarget.startActivitySafely(view, intent, mItemInfo); - AbstractFloatingView.closeAllOpenViews(mTarget); + try { + Intent intent = Intent.parseUri(view.getContext().getString(R.string.delete_package_intent), 0) + .setData(Uri.fromParts("package", mItemInfo.getTargetComponent().getPackageName(), + mItemInfo.getTargetComponent().getClassName())).putExtra(Intent.EXTRA_USER, mItemInfo.user); + mTarget.startActivitySafely(view, intent, mItemInfo); + AbstractFloatingView.closeAllOpenViews(mTarget); + } catch (URISyntaxException e) { + // Do nothing. + } } } diff --git a/src/com/android/launcher3/util/PackageManagerHelper.java b/src/com/android/launcher3/util/PackageManagerHelper.java index 808ae43633..d7a354feb6 100644 --- a/src/com/android/launcher3/util/PackageManagerHelper.java +++ b/src/com/android/launcher3/util/PackageManagerHelper.java @@ -197,12 +197,6 @@ public class PackageManagerHelper { .authority(mContext.getPackageName()).build()); } - public Intent getUninstallIntent(String packageName) { - return new Intent(Intent.ACTION_UNINSTALL_PACKAGE) - .setData(Uri.parse("package:" + packageName)) - .putExtra(Intent.EXTRA_RETURN_RESULT, true); - } - /** * Creates a new market search intent. */