다음을 통해 공유


DevicePolicyManager.SetRecommendedGlobalProxy Method

Definition

Set a network-independent global HTTP proxy.

[Android.Runtime.Register("setRecommendedGlobalProxy", "(Landroid/content/ComponentName;Landroid/net/ProxyInfo;)V", "GetSetRecommendedGlobalProxy_Landroid_content_ComponentName_Landroid_net_ProxyInfo_Handler")]
public virtual void SetRecommendedGlobalProxy (Android.Content.ComponentName admin, Android.Net.ProxyInfo? proxyInfo);
[<Android.Runtime.Register("setRecommendedGlobalProxy", "(Landroid/content/ComponentName;Landroid/net/ProxyInfo;)V", "GetSetRecommendedGlobalProxy_Landroid_content_ComponentName_Landroid_net_ProxyInfo_Handler")>]
abstract member SetRecommendedGlobalProxy : Android.Content.ComponentName * Android.Net.ProxyInfo -> unit
override this.SetRecommendedGlobalProxy : Android.Content.ComponentName * Android.Net.ProxyInfo -> unit

Parameters

admin
ComponentName

Which DeviceAdminReceiver this request is associated with.

proxyInfo
ProxyInfo

The a ProxyInfo object defining the new global HTTP proxy. A null value will clear the global HTTP proxy.

Attributes

Remarks

Set a network-independent global HTTP proxy. This is not normally what you want for typical HTTP proxies - they are generally network dependent. However if you're doing something unusual like general internal filtering this may be useful. On a private network where the proxy is not accessible, you may break HTTP using this.

This method requires the caller to be the device owner.

This proxy is only a recommendation and it is possible that some apps will ignore it.

Note: The device owner won't be able to set a global HTTP proxy 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.setRecommendedGlobalProxy(android.content.ComponentName, android.net.ProxyInfo).

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

See also