DevicePolicyManager.SetDelegatedScopes 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.
Called by a profile owner or device owner to grant access to privileged APIs to another app.
[Android.Runtime.Register("setDelegatedScopes", "(Landroid/content/ComponentName;Ljava/lang/String;Ljava/util/List;)V", "GetSetDelegatedScopes_Landroid_content_ComponentName_Ljava_lang_String_Ljava_util_List_Handler", ApiSince=26)]
public virtual void SetDelegatedScopes (Android.Content.ComponentName admin, string delegatePackage, System.Collections.Generic.IList<string> scopes);
[<Android.Runtime.Register("setDelegatedScopes", "(Landroid/content/ComponentName;Ljava/lang/String;Ljava/util/List;)V", "GetSetDelegatedScopes_Landroid_content_ComponentName_Ljava_lang_String_Ljava_util_List_Handler", ApiSince=26)>]
abstract member SetDelegatedScopes : Android.Content.ComponentName * string * System.Collections.Generic.IList<string> -> unit
override this.SetDelegatedScopes : Android.Content.ComponentName * string * System.Collections.Generic.IList<string> -> unit
Parameters
- admin
- ComponentName
Which DeviceAdminReceiver
this request is associated with.
- delegatePackage
- String
The package name of the app which will be given access.
The groups of privileged APIs whose access should be granted to
delegatedPackage
.
- Attributes
Remarks
Called by a profile owner or device owner to grant access to privileged APIs to another app. Granted APIs are determined by scopes
, which is a list of the DELEGATION_*
constants.
A broadcast with the #ACTION_APPLICATION_DELEGATION_SCOPES_CHANGED
action will be sent to the delegatePackage
with its new scopes in an ArrayList<String>
extra under the #EXTRA_DELEGATION_SCOPES
key. The broadcast is sent with the Intent#FLAG_RECEIVER_REGISTERED_ONLY
flag.
Delegated scopes are a per-user state. The delegated access is persistent until it is later cleared by calling this method with an empty scopes
list or uninstalling the delegatePackage
.
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.