語言

DevicePolicyManager.SetAutoTimeEnabled(ComponentName, Boolean) 方法

定義

由裝置擁有者、主要使用者的設定檔擁有者,或組織擁有的管理型態設定檔的設定檔擁有者呼叫,以開啟或關閉自動時間。

[Android.Runtime.Register("setAutoTimeEnabled", "(Landroid/content/ComponentName;Z)V", "GetSetAutoTimeEnabled_Landroid_content_ComponentName_ZHandler", ApiSince=30)]
[Android.Runtime.RequiresPermission("android.permission.SET_TIME")]
public virtual void SetAutoTimeEnabled(Android.Content.ComponentName? admin, bool enabled);
[<Android.Runtime.Register("setAutoTimeEnabled", "(Landroid/content/ComponentName;Z)V", "GetSetAutoTimeEnabled_Landroid_content_ComponentName_ZHandler", ApiSince=30)>]
[<Android.Runtime.RequiresPermission("android.permission.SET_TIME")>]
abstract member SetAutoTimeEnabled : Android.Content.ComponentName * bool -> unit
override this.SetAutoTimeEnabled : Android.Content.ComponentName * bool -> unit

參數

admin
ComponentName

這個請求就是和這個 DeviceAdminReceiver 問題有關的。 如果呼叫者不是裝置管理員,則為 Null。

enabled
Boolean

是否應該自動從網路取得時間。

屬性

備註

由裝置擁有者、主要使用者的設定檔擁有者,或組織擁有的管理型態設定檔的設定檔擁有者呼叫,以開啟或關閉自動時間。

建議來電者使用 UserManager#DISALLOW_CONFIG_DATE_TIME 此設定,以防止使用者更改此設定,避免使用者能設定日期與時區。

Java 文件 android.app.admin.DevicePolicyManager.setAutoTimeEnabled(android.content.ComponentName, boolean)

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於