Freigeben über


DevicePolicyManager.SetGlobalPrivateDnsModeOpportunistic Method

Definition

Sets the global Private DNS mode to opportunistic.

[Android.Runtime.Register("setGlobalPrivateDnsModeOpportunistic", "(Landroid/content/ComponentName;)I", "GetSetGlobalPrivateDnsModeOpportunistic_Landroid_content_ComponentName_Handler", ApiSince=29)]
public virtual Android.App.Admin.PrivateDnsSet SetGlobalPrivateDnsModeOpportunistic (Android.Content.ComponentName admin);
[<Android.Runtime.Register("setGlobalPrivateDnsModeOpportunistic", "(Landroid/content/ComponentName;)I", "GetSetGlobalPrivateDnsModeOpportunistic_Landroid_content_ComponentName_Handler", ApiSince=29)>]
abstract member SetGlobalPrivateDnsModeOpportunistic : Android.Content.ComponentName -> Android.App.Admin.PrivateDnsSet
override this.SetGlobalPrivateDnsModeOpportunistic : Android.Content.ComponentName -> Android.App.Admin.PrivateDnsSet

Parameters

admin
ComponentName

which DeviceAdminReceiver this request is associated with.

Returns

PRIVATE_DNS_SET_NO_ERROR if the mode was set successfully, or PRIVATE_DNS_SET_ERROR_FAILURE_SETTING if it could not be set.

Attributes

Remarks

Sets the global Private DNS mode to opportunistic. May only be called by the device owner.

In this mode, the DNS subsystem will attempt a TLS handshake to the network-supplied resolver prior to attempting name resolution in cleartext.

Note: The device owner won't be able to set the global private DNS mode if there are unaffiliated secondary users or profiles on the device. It's recommended that affiliation ids are set for new users as soon as possible after provisioning via #setAffiliationIds.

Java documentation for android.app.admin.DevicePolicyManager.setGlobalPrivateDnsModeOpportunistic(android.content.ComponentName).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to