DevicePolicyManager.SetTime(ComponentName, Int64) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
由裝置擁有者或組織擁有的管理型態設定檔擁有者呼叫,以設定系統的壁掛時鐘時間。
[Android.Runtime.Register("setTime", "(Landroid/content/ComponentName;J)Z", "GetSetTime_Landroid_content_ComponentName_JHandler", ApiSince=28)]
[Android.Runtime.RequiresPermission("android.permission.SET_TIME")]
public virtual bool SetTime(Android.Content.ComponentName? admin, long millis);
[<Android.Runtime.Register("setTime", "(Landroid/content/ComponentName;J)Z", "GetSetTime_Landroid_content_ComponentName_JHandler", ApiSince=28)>]
[<Android.Runtime.RequiresPermission("android.permission.SET_TIME")>]
abstract member SetTime : Android.Content.ComponentName * int64 -> bool
override this.SetTime : Android.Content.ComponentName * int64 -> bool
參數
- admin
- ComponentName
這個請求就是和這個 DeviceAdminReceiver 問題有關的。 如果呼叫者不是裝置管理員,則為 Null。
- millis
- Int64
自紀元以來的時間以毫秒計
傳回
true 如果設定時間成功, false 否則。
- 屬性
備註
由裝置擁有者或組織擁有的管理型態設定檔擁有者呼叫,以設定系統的壁掛時鐘時間。 只有當 android.provider.Settings.Global#AUTO_TIME 為 0 時才會生效,否則 false 會回傳。
Java 文件 android.app.admin.DevicePolicyManager.setTime(android.content.ComponentName, long)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。