Loading services/core/java/com/android/server/ConnectivityService.java +2 −8 Original line number Diff line number Diff line Loading @@ -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 Loading tests/net/java/com/android/server/ConnectivityServiceTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
services/core/java/com/android/server/ConnectivityService.java +2 −8 Original line number Diff line number Diff line Loading @@ -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 Loading
tests/net/java/com/android/server/ConnectivityServiceTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -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 Loading