DevicePolicyManager.SetAutoTimeZoneEnabled(ComponentName, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Called by a device owner, a profile owner for the primary user or a profile owner of an organization-owned managed profile to turn auto time zone on and off.
[Android.Runtime.Register("setAutoTimeZoneEnabled", "(Landroid/content/ComponentName;Z)V", "GetSetAutoTimeZoneEnabled_Landroid_content_ComponentName_ZHandler", ApiSince=30)]
[Android.Runtime.RequiresPermission("android.permission.SET_TIME_ZONE")]
public virtual void SetAutoTimeZoneEnabled (Android.Content.ComponentName? admin, bool enabled);
[<Android.Runtime.Register("setAutoTimeZoneEnabled", "(Landroid/content/ComponentName;Z)V", "GetSetAutoTimeZoneEnabled_Landroid_content_ComponentName_ZHandler", ApiSince=30)>]
[<Android.Runtime.RequiresPermission("android.permission.SET_TIME_ZONE")>]
abstract member SetAutoTimeZoneEnabled : Android.Content.ComponentName * bool -> unit
override this.SetAutoTimeZoneEnabled : Android.Content.ComponentName * bool -> unit
Parameters
- admin
- ComponentName
Which DeviceAdminReceiver
this request is associated with or Null if the
caller is not a device admin.
- enabled
- Boolean
Whether time zone should be obtained automatically from the network or not.
- Attributes
Remarks
Called by a device owner, a profile owner for the primary user or a profile owner of an organization-owned managed profile to turn auto time zone on and off. Callers are recommended to use UserManager#DISALLOW_CONFIG_DATE_TIME
to prevent the user from changing this setting.
If user restriction UserManager#DISALLOW_CONFIG_DATE_TIME
is used, no user will be able set the date and time zone. Instead, the network date and time zone will be used.
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.