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

Commit f83190c2 authored by Chalard Jean's avatar Chalard Jean Committed by Gerrit Code Review
Browse files

Merge "Fix a bug where the wrong profile is queried"

parents a8b1b1a2 60967ccf
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -9423,14 +9423,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
            throw new IllegalArgumentException("Must explicitly specify a user handle ("
                    + "UserHandle.CURRENT not supported)");
        }
        final UserManager um;
        try {
            um = mContext.createContextAsUser(profile, 0 /* flags */)
                    .getSystemService(UserManager.class);
        } catch (IllegalStateException e) {
            throw new IllegalArgumentException("Profile does not exist");
        }
        if (!um.isManagedProfile()) {
        final UserManager um = mContext.getSystemService(UserManager.class);
        if (!um.isManagedProfile(profile.getIdentifier())) {
            throw new IllegalArgumentException("Profile must be a managed profile");
        }
        // Strictly speaking, mOemNetworkPreferences should only be touched on the
+1 −0
Original line number Diff line number Diff line
@@ -578,6 +578,7 @@ public class ConnectivityServiceTest {
            final UserManager umMock = createContextAsUser(userHandle, 0 /* flags */)
                    .getSystemService(UserManager.class);
            doReturn(value).when(umMock).isManagedProfile();
            doReturn(value).when(mUserManager).isManagedProfile(eq(userHandle.getIdentifier()));
        }
        @Override