語言

DevicePolicyManager.SetCrossProfileWidgetProviders 方法

定義

由受管理設定檔的設定檔擁有者或持有 android.Manifest.permission#MANAGE_DEVICE_POLICY_PROFILE_INTERACTION 授權者呼叫,以啟用套件中小工具提供者在父設定檔中。

[Android.Runtime.Register("setCrossProfileWidgetProviders", "(Ljava/util/Set;)V", "GetSetCrossProfileWidgetProviders_Ljava_util_Set_Handler", ApiSince=37)]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_PROFILE_INTERACTION")]
public virtual void SetCrossProfileWidgetProviders(System.Collections.Generic.ICollection<string> packageNames);
[<Android.Runtime.Register("setCrossProfileWidgetProviders", "(Ljava/util/Set;)V", "GetSetCrossProfileWidgetProviders_Ljava_util_Set_Handler", ApiSince=37)>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_PROFILE_INTERACTION")>]
abstract member SetCrossProfileWidgetProviders : System.Collections.Generic.ICollection<string> -> unit
override this.SetCrossProfileWidgetProviders : System.Collections.Generic.ICollection<string> -> unit

參數

packageNames
ICollection<String>

這些套件是 widget 提供者被允許列入名單的。

屬性

備註

由管理型態設定檔的設定檔擁有者或權限Manifest.permission.MANAGE_DEVICE_POLICY_PROFILE_INTERACTION持有者呼叫,以啟用套件中的元件提供者在父設定檔中可用。 因此,使用者將能將允許清單套件中執行於設定檔下的元件加入,並加入執行於父設定檔下的元件主機,例如主畫面。 請注意,一個套件可能包含零個或多個提供者元件,每個元件提供不同的元件類型。

注意:預設情況下,沒有任何 widget 提供者套件被允許列出。

注意:此 API 一次性更新整個允許清單,覆蓋先前的任何允許清單。 這比起使用 addCrossProfileWidgetProvider(ComponentName, String) 和 removeCrossProfileWidgetProvider(ComponentName, String) 逐個更新 Allowlist 套件,尤其是當 allowlist 包含多個套件時,效率更高。

Android 參考資料。android.app.admin.DevicePolicyManager.setCrossProfileWidgetProviders

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

適用於