語言

DevicePolicyManager.SetBackupServiceEnabled(ComponentName, Boolean) 方法

定義

允許裝置擁有者或設定檔擁有者啟用或停用備份服務。

[Android.Runtime.Register("setBackupServiceEnabled", "(Landroid/content/ComponentName;Z)V", "GetSetBackupServiceEnabled_Landroid_content_ComponentName_ZHandler", ApiSince=26)]
public virtual void SetBackupServiceEnabled(Android.Content.ComponentName admin, bool enabled);
[<Android.Runtime.Register("setBackupServiceEnabled", "(Landroid/content/ComponentName;Z)V", "GetSetBackupServiceEnabled_Landroid_content_ComponentName_ZHandler", ApiSince=26)>]
abstract member SetBackupServiceEnabled : Android.Content.ComponentName * bool -> unit
override this.SetBackupServiceEnabled : Android.Content.ComponentName * bool -> unit

參數

admin
ComponentName

這個請求就是和這個 DeviceAdminReceiver 問題有關的。

enabled
Boolean

true 啟用備份服務, false 關閉它。

屬性

備註

允許裝置擁有者或設定檔擁有者啟用或停用備份服務。

每位使用者都有自己的備份服務,負責管理該使用者的備份與還原機制。 停用備份服務會阻止資料備份或還原。

裝置擁有者呼叫此 API,以控制裝置上所有使用者的備份服務。 設定檔擁有者可以使用此 API 啟用或停用設定檔的備份服務。 然而,對於受管理的設定檔,只有當裝置擁有者與設定設定檔擁有者都啟用備份服務時,其備份功能才會被啟用。

預設情況下,備份服務會在擁有裝置的裝置上被停用,且在受管理的設定檔中。

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

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

適用於