Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a55949c authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Tweak strings when uninstalling updates

Inform about data deletion and also about other users.

Bug: 26694521
Change-Id: Ib1ab8ca58e111cfbad6895f296e567e289ce34d8
parent a4f67b71
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -111,7 +111,8 @@
    <string name="uninstall_application_text_all_users">Do you want to uninstall this app for <b>all</b>
        users?  The application and its data will be removed from <b>all</b> users on the device.</string>
    <string name="uninstall_application_text_user">Do you want to uninstall this app for the user <xliff:g id="username">%1$s</xliff:g>?</string>
    <string name="uninstall_update_text">Do you want to replace this app with the factory version?</string>
    <string name="uninstall_update_text">Replace this app with the factory version? All data will be removed.</string>
    <string name="uninstall_update_text_multiuser">Replace this app with the factory version? All data will be removed. This affects all users of this device, including those with work profiles.</string>
    <string name="uninstalling">Uninstalling\u2026</string>
    <string name="uninstall_done">Uninstall finished.</string>
    <string name="uninstall_failed">Uninstall unsuccessful.</string>
+17 −3
Original line number Diff line number Diff line
@@ -74,11 +74,15 @@ public class UninstallerActivity extends Activity {

            final boolean isUpdate =
                    ((dialogInfo.appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0);
            UserManager userManager = UserManager.get(getActivity());
            if (isUpdate) {
                if (isSingleUser(userManager)) {
                    messageBuilder.append(getString(R.string.uninstall_update_text));
                } else {
                UserManager userManager = UserManager.get(getActivity());
                if (dialogInfo.allUsers && userManager.getUserCount() >= 2) {
                    messageBuilder.append(getString(R.string.uninstall_update_text_multiuser));
                }
            } else {
                if (dialogInfo.allUsers && !isSingleUser(userManager)) {
                    messageBuilder.append(getString(R.string.uninstall_application_text_all_users));
                } else if (!dialogInfo.user.equals(android.os.Process.myUserHandle())) {
                    UserInfo userInfo = userManager.getUserInfo(dialogInfo.user.getIdentifier());
@@ -113,6 +117,16 @@ public class UninstallerActivity extends Activity {
                getActivity().finish();
            }
        }

        /**
         * Returns whether there is only one user on this device, not including
         * the system-only user.
         */
        private boolean isSingleUser(UserManager userManager) {
            final int userCount = userManager.getUserCount();
            return userCount == 1
                    || (UserManager.isSplitSystemUser() && userCount == 2);
        }
    }

    public static class AppNotFoundDialogFragment extends DialogFragment {