Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix issue #7448596: Can't uninstall app that was installed by another…

… user

Change-Id: I80a07a30cb452eee61e0838b5133559bb1f10d6f
  • Loading branch information...
commit 8124c242d390b283c2623c24a93fe9756658571a 1 parent 03347ba
Dianne Hackborn authored
View
1  AndroidManifest.xml
@@ -10,6 +10,7 @@
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CLEAR_APP_USER_DATA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.MANAGE_USERS" />
<application android:label="@string/app_name"
android:allowBackup="false"
android:theme="@android:style/Theme.DeviceDefault.DialogWhenLarge.NoActionBar">
View
5 src/com/android/packageinstaller/UninstallerActivity.java
@@ -20,6 +20,7 @@
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ComponentName;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
@@ -30,6 +31,7 @@
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
+import android.os.UserManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -161,7 +163,8 @@ public void onCreate(Bundle icicle) {
confirm.setText(R.string.uninstall_update_text);
} else {
setTitle(R.string.uninstall_application_title);
- if (mAllUsers) {
+ if (mAllUsers && ((UserManager)getSystemService(
+ Context.USER_SERVICE)).getUsers().size() >= 2) {
confirm.setText(R.string.uninstall_application_text_all_users);
} else {
confirm.setText(R.string.uninstall_application_text);
Please sign in to comment.
Something went wrong with that request. Please try again.