Include user handle for uninstall intents.
Add support for uninstalling apps from other profiles.
Bug: 14127299
Change-Id: I1a3724a45c95cf93b958d23a57829efcedfc4291
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index a85b5b1..0b07968 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2718,7 +2718,8 @@
}
// returns true if the activity was started
- boolean startApplicationUninstallActivity(ComponentName componentName, int flags) {
+ boolean startApplicationUninstallActivity(ComponentName componentName, int flags,
+ UserHandleCompat user) {
if ((flags & AppInfo.DOWNLOADED_FLAG) == 0) {
// System applications cannot be installed. For now, show a toast explaining that.
// We may give them the option of disabling apps this way.
@@ -2732,6 +2733,9 @@
Intent.ACTION_DELETE, Uri.fromParts("package", packageName, className));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
+ if (user != null) {
+ user.addToIntent(intent, Intent.EXTRA_USER);
+ }
startActivity(intent);
return true;
}