DevicePolicyManager.SetCrossProfilePackages Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the set of admin-allowlisted package names that are allowed to request user consent for cross-profile communication.
[Android.Runtime.Register("setCrossProfilePackages", "(Landroid/content/ComponentName;Ljava/util/Set;)V", "GetSetCrossProfilePackages_Landroid_content_ComponentName_Ljava_util_Set_Handler", ApiSince=30)]
public virtual void SetCrossProfilePackages (Android.Content.ComponentName admin, System.Collections.Generic.ICollection<string> packageNames);
[<Android.Runtime.Register("setCrossProfilePackages", "(Landroid/content/ComponentName;Ljava/util/Set;)V", "GetSetCrossProfilePackages_Landroid_content_ComponentName_Ljava_util_Set_Handler", ApiSince=30)>]
abstract member SetCrossProfilePackages : Android.Content.ComponentName * System.Collections.Generic.ICollection<string> -> unit
override this.SetCrossProfilePackages : Android.Content.ComponentName * System.Collections.Generic.ICollection<string> -> unit
Parameters
- admin
- ComponentName
the DeviceAdminReceiver
this request is associated with
- packageNames
- ICollection<String>
the new cross-profile package names
- Attributes
Remarks
Sets the set of admin-allowlisted package names that are allowed to request user consent for cross-profile communication.
Assumes that the caller is a profile owner and is the given admin
.
Previous calls are overridden by each subsequent call to this method.
Note that other apps may be able to request user consent for cross-profile communication if they have been explicitly allowlisted by the OEM.
When previously-set cross-profile packages are missing from packageNames
, the app-op for INTERACT_ACROSS_PROFILES
will be reset for those packages. This will not occur for packages that are allowlisted by the OEM.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.