DevicePolicyManager.SetAutoTimeZoneEnabled(ComponentName, Boolean) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
由裝置擁有者、主要使用者的設定檔擁有者,或組織擁有的管理型設定檔的設定檔擁有者呼叫,以開啟或關閉自動時區。
[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
參數
- admin
- ComponentName
這個請求會與該 DeviceAdminReceiver 請求相關聯,或如果呼叫者不是裝置管理員,則為 Null。
- enabled
- Boolean
時區是否應該自動從網路取得。
- 屬性
備註
由裝置擁有者、主要使用者的設定檔擁有者,或組織擁有的管理型設定檔的設定檔擁有者呼叫,以開啟或關閉自動時區。
建議來電者使用 UserManager#DISALLOW_CONFIG_DATE_TIME 此設定,以防止使用者更改此設定,避免使用者能設定日期與時區。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。