summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-11-02 22:20:28 (GMT)
committerAndroid Git Automerger <android-git-automerger@android.com>2012-11-02 22:20:28 (GMT)
commitaae5fe999dd827548a1ffd744238ef23615806ff (patch)
treeb012d7678c9ba215c95a9c3b7b116efa3cc8d13f
parent6d449fe9f5d7e26d363192d2cc020cd3a51826be (diff)
parent8124c242d390b283c2623c24a93fe9756658571a (diff)
downloadandroid_packages_apps_PackageInstaller-aae5fe999dd827548a1ffd744238ef23615806ff.zip
android_packages_apps_PackageInstaller-aae5fe999dd827548a1ffd744238ef23615806ff.tar.gz
android_packages_apps_PackageInstaller-aae5fe999dd827548a1ffd744238ef23615806ff.tar.bz2
am 8124c242: Fix issue #7448596: Can\'t uninstall app that was installed by another user
* commit '8124c242d390b283c2623c24a93fe9756658571a': Fix issue #7448596: Can't uninstall app that was installed by another user
-rw-r--r--AndroidManifest.xml1
-rwxr-xr-xsrc/com/android/packageinstaller/UninstallerActivity.java5
2 files changed, 5 insertions, 1 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index dfc1a6d..de11795 100644
--- a/AndroidManifest.xml
+++ b/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">
diff --git a/src/com/android/packageinstaller/UninstallerActivity.java b/src/com/android/packageinstaller/UninstallerActivity.java
index 93e096e..1b9bdce 100755
--- a/src/com/android/packageinstaller/UninstallerActivity.java
+++ b/src/com/android/packageinstaller/UninstallerActivity.java
@@ -20,6 +20,7 @@ import android.app.Activity;
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.content.pm.ResolveInfo;
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 class UninstallerActivity extends Activity implements OnClickListener,
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);