DevicePolicyManager.SetTimeZone(ComponentName, String) 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 or a profile owner of an organization-owned managed profile to set the system's persistent default time zone.
[Android.Runtime.Register("setTimeZone", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "GetSetTimeZone_Landroid_content_ComponentName_Ljava_lang_String_Handler", ApiSince=28)]
[Android.Runtime.RequiresPermission("android.permission.SET_TIME_ZONE")]
public virtual bool SetTimeZone (Android.Content.ComponentName? admin, string? timeZone);
[<Android.Runtime.Register("setTimeZone", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "GetSetTimeZone_Landroid_content_ComponentName_Ljava_lang_String_Handler", ApiSince=28)>]
[<Android.Runtime.RequiresPermission("android.permission.SET_TIME_ZONE")>]
abstract member SetTimeZone : Android.Content.ComponentName * string -> bool
override this.SetTimeZone : Android.Content.ComponentName * string -> bool
Parameters
- admin
- ComponentName
Which DeviceAdminReceiver
this request is associated with. Null if the
caller is not a device admin.
- timeZone
- String
one of the Olson ids from the list returned by
java.util.TimeZone#getAvailableIDs
Returns
true
if set timezone succeeded, false
otherwise.
- Attributes
Remarks
Called by a device owner or a profile owner of an organization-owned managed profile to set the system's persistent default time zone. This only takes effect if called when android.provider.Settings.Global#AUTO_TIME_ZONE
is 0, otherwise false
will be returned.
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.