diff options
-rw-r--r-- | res/layout/uninstall_progress.xml | 10 | ||||
-rw-r--r-- | res/values/strings.xml | 8 | ||||
-rwxr-xr-x | src/com/android/packageinstaller/UninstallAppProgress.java | 14 |
3 files changed, 29 insertions, 3 deletions
diff --git a/res/layout/uninstall_progress.xml b/res/layout/uninstall_progress.xml index ff80fe11..1d63841f 100644 --- a/res/layout/uninstall_progress.xml +++ b/res/layout/uninstall_progress.xml @@ -104,7 +104,15 @@ android:visibility="gone" android:maxLines="2" android:text="@string/manage_device_administrators" /> - + + <Button android:id="@+id/users_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:visibility="gone" + android:maxLines="2" + android:text="@string/manage_users" /> + </LinearLayout> </RelativeLayout> diff --git a/res/values/strings.xml b/res/values/strings.xml index 367f466b..8aed10da 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -126,8 +126,8 @@ active device administrator for the user <xliff:g id="username">%1$s</xliff:g>.</string> <!-- String presented to the user when uninstalling a package failed because a profile owner has marked the the target package as not able to be uninstalled [CHAR LIMIT=80] --> - <string name="uninstall_blocked_profile_owner">This app is needed for - your work profile and can\'t be uninstalled.</string> + <string name="uninstall_blocked_profile_owner">This app is required for some users or profiles + and was uninstalled for others</string> <!-- String presented to the user when uninstalling a package failed because a device owner has marked the the target package as not able to be uninstalled [CHAR LIMIT=80] --> <string name="uninstall_blocked_device_owner">This app is required @@ -136,6 +136,10 @@ user will be able to disable the device administrator in order to uninstall it. [CHAR LIMIT=50] --> <string name="manage_device_administrators">Manage device administrators</string> + <!-- String on a button that leads to the "Users" page in Settings where a + user will be able to remove the secondary user(s) in order to uninstall + the app. [CHAR LIMIT=50] --> + <string name="manage_users">Manage users</string> <string name="uninstall_failed_msg"><xliff:g id="app_name">%1$s</xliff:g> couldn\'t be uninstalled.</string> <!-- Dialog attributes to indicate parse errors --> diff --git a/src/com/android/packageinstaller/UninstallAppProgress.java b/src/com/android/packageinstaller/UninstallAppProgress.java index 4c039051..f1c569a7 100755 --- a/src/com/android/packageinstaller/UninstallAppProgress.java +++ b/src/com/android/packageinstaller/UninstallAppProgress.java @@ -35,6 +35,7 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.os.UserHandle; import android.os.UserManager; +import android.provider.Settings; import android.util.Log; import android.view.KeyEvent; import android.view.View; @@ -64,6 +65,7 @@ public class UninstallAppProgress extends Activity implements OnClickListener { private TextView mStatusTextView; private Button mOkButton; private Button mDeviceManagerButton; + private Button mUsersButton; private ProgressBar mProgressBar; private View mOkPanel; private volatile int mResultCode = -1; @@ -180,6 +182,7 @@ public class UninstallAppProgress extends Activity implements OnClickListener { mDeviceManagerButton.setVisibility(View.VISIBLE); } else { mDeviceManagerButton.setVisibility(View.GONE); + mUsersButton.setVisibility(View.VISIBLE); } // TODO: b/25442806 if (blockingUserId == UserHandle.USER_SYSTEM) { @@ -260,6 +263,7 @@ public class UninstallAppProgress extends Activity implements OnClickListener { mStatusTextView = (TextView) findViewById(R.id.center_text); mStatusTextView.setText(R.string.uninstalling); mDeviceManagerButton = (Button) findViewById(R.id.device_manager_button); + mUsersButton = (Button) findViewById(R.id.users_button); mDeviceManagerButton.setVisibility(View.GONE); mDeviceManagerButton.setOnClickListener(new OnClickListener() { @Override @@ -272,6 +276,16 @@ public class UninstallAppProgress extends Activity implements OnClickListener { finish(); } }); + mUsersButton.setVisibility(View.GONE); + mUsersButton.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_USER_SETTINGS); + intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + finish(); + } + }); mProgressBar = (ProgressBar) findViewById(R.id.progress_bar); mProgressBar.setIndeterminate(true); // Hide button till progress is being displayed |