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

Commit 5455eace authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by Android (Google) Code Review
Browse files

Merge "Added "Manage users" button" into nyc-dev

parents 959c57cd 10f852cb
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -105,6 +105,14 @@
                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>
+6 −2
Original line number Diff line number Diff line
@@ -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 -->
+14 −0
Original line number Diff line number Diff line
@@ -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