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

Commit 031104f1 authored by Yasin Kilicdere's avatar Yasin Kilicdere Committed by Android (Google) Code Review
Browse files

Merge "Make sure activity for adding a supervised user is opened full screen."

parents cd78c73c d9281c88
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -503,7 +503,8 @@ public class UserSettings extends SettingsPreferenceFragment
    private void onAddSupervisedUserClicked() {
        final Intent intent = new Intent()
                .setAction(UserManager.ACTION_CREATE_SUPERVISED_USER)
                .setPackage(mConfigSupervisedUserCreationPackage);
                .setPackage(mConfigSupervisedUserCreationPackage)
                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        // TODO(b/209659998): [to-be-removed] fallback activity for supervised user creation.
        if (getActivity().getPackageManager().resolveActivity(intent, 0) == null) {
+2 −0
Original line number Diff line number Diff line
@@ -664,6 +664,7 @@ public class UserSettingsTest {
    public void onPreferenceClick_addSupervisedUserClicked_startIntentWithAction() {
        final String intentPackage = "testPackage";
        final String intentAction = UserManager.ACTION_CREATE_SUPERVISED_USER;
        final int intentFlags = Intent.FLAG_ACTIVITY_NEW_TASK;
        final int metricsAction = SettingsEnums.ACTION_USER_SUPERVISED_ADD;
        try {
            setConfigSupervisedUserCreationPackage(intentPackage);
@@ -676,6 +677,7 @@ public class UserSettingsTest {
            verify(mFragment).startActivity(captor.capture());
            assertThat(captor.getValue().getPackage()).isEqualTo(intentPackage);
            assertThat(captor.getValue().getAction()).isEqualTo(intentAction);
            assertThat(captor.getValue().getFlags() & intentFlags).isGreaterThan(0);

            verify(mMetricsFeatureProvider).action(any(), eq(metricsAction));
        } finally {