Merge "Make sure to udpate enterprise id" am: 724e9d6a7f am: 0cd153c240
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1956749 Change-Id: I23bc303e7c273ae087a2f089f94889f4eab95054
This commit is contained in:
@@ -109,6 +109,7 @@ import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE;
|
|||||||
import static android.content.pm.PackageManager.MATCH_UNINSTALLED_PACKAGES;
|
import static android.content.pm.PackageManager.MATCH_UNINSTALLED_PACKAGES;
|
||||||
import static android.net.ConnectivityManager.PROFILE_NETWORK_PREFERENCE_DEFAULT;
|
import static android.net.ConnectivityManager.PROFILE_NETWORK_PREFERENCE_DEFAULT;
|
||||||
import static android.net.ConnectivityManager.PROFILE_NETWORK_PREFERENCE_ENTERPRISE;
|
import static android.net.ConnectivityManager.PROFILE_NETWORK_PREFERENCE_ENTERPRISE;
|
||||||
|
import static android.net.NetworkCapabilities.NET_ENTERPRISE_ID_1;
|
||||||
import static android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK;
|
import static android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK;
|
||||||
import static android.provider.Settings.Global.PRIVATE_DNS_SPECIFIER;
|
import static android.provider.Settings.Global.PRIVATE_DNS_SPECIFIER;
|
||||||
import static android.provider.Settings.Secure.USER_SETUP_COMPLETE;
|
import static android.provider.Settings.Secure.USER_SETUP_COMPLETE;
|
||||||
@@ -17546,7 +17547,12 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
|
|||||||
? PROFILE_NETWORK_PREFERENCE_ENTERPRISE : PROFILE_NETWORK_PREFERENCE_DEFAULT;
|
? PROFILE_NETWORK_PREFERENCE_ENTERPRISE : PROFILE_NETWORK_PREFERENCE_DEFAULT;
|
||||||
ProfileNetworkPreference.Builder preferenceBuilder =
|
ProfileNetworkPreference.Builder preferenceBuilder =
|
||||||
new ProfileNetworkPreference.Builder();
|
new ProfileNetworkPreference.Builder();
|
||||||
preferenceBuilder.setPreference(networkPreference);
|
if (preferentialNetworkServiceEnabled) {
|
||||||
|
preferenceBuilder.setPreference(PROFILE_NETWORK_PREFERENCE_ENTERPRISE);
|
||||||
|
preferenceBuilder.setPreferenceEnterpriseId(NET_ENTERPRISE_ID_1);
|
||||||
|
} else {
|
||||||
|
preferenceBuilder.setPreference(PROFILE_NETWORK_PREFERENCE_DEFAULT);
|
||||||
|
}
|
||||||
List<ProfileNetworkPreference> preferences = new ArrayList<>();
|
List<ProfileNetworkPreference> preferences = new ArrayList<>();
|
||||||
preferences.add(preferenceBuilder.build());
|
preferences.add(preferenceBuilder.build());
|
||||||
mInjector.binderWithCleanCallingIdentity(() ->
|
mInjector.binderWithCleanCallingIdentity(() ->
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import static android.content.pm.ApplicationInfo.PRIVATE_FLAG_DIRECT_BOOT_AWARE;
|
|||||||
import static android.net.ConnectivityManager.PROFILE_NETWORK_PREFERENCE_DEFAULT;
|
import static android.net.ConnectivityManager.PROFILE_NETWORK_PREFERENCE_DEFAULT;
|
||||||
import static android.net.ConnectivityManager.PROFILE_NETWORK_PREFERENCE_ENTERPRISE;
|
import static android.net.ConnectivityManager.PROFILE_NETWORK_PREFERENCE_ENTERPRISE;
|
||||||
import static android.net.InetAddresses.parseNumericAddress;
|
import static android.net.InetAddresses.parseNumericAddress;
|
||||||
|
import static android.net.NetworkCapabilities.NET_ENTERPRISE_ID_1;
|
||||||
|
|
||||||
import static com.android.internal.widget.LockPatternUtils.CREDENTIAL_TYPE_NONE;
|
import static com.android.internal.widget.LockPatternUtils.CREDENTIAL_TYPE_NONE;
|
||||||
import static com.android.internal.widget.LockPatternUtils.EscrowTokenStateChangeCallback;
|
import static com.android.internal.widget.LockPatternUtils.EscrowTokenStateChangeCallback;
|
||||||
@@ -4109,6 +4110,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
|
|||||||
ProfileNetworkPreference preferenceDetails2 =
|
ProfileNetworkPreference preferenceDetails2 =
|
||||||
new ProfileNetworkPreference.Builder()
|
new ProfileNetworkPreference.Builder()
|
||||||
.setPreference(PROFILE_NETWORK_PREFERENCE_ENTERPRISE)
|
.setPreference(PROFILE_NETWORK_PREFERENCE_ENTERPRISE)
|
||||||
|
.setPreferenceEnterpriseId(NET_ENTERPRISE_ID_1)
|
||||||
.build();
|
.build();
|
||||||
List<ProfileNetworkPreference> preferences2 = new ArrayList<>();
|
List<ProfileNetworkPreference> preferences2 = new ArrayList<>();
|
||||||
preferences2.add(preferenceDetails);
|
preferences2.add(preferenceDetails);
|
||||||
|
|||||||
Reference in New Issue
Block a user