Share via


UserManager.GetApplicationRestrictions(String) Method

Definition

Returns a Bundle containing any saved application restrictions for the context user, for the given package name.

[Android.Runtime.Register("getApplicationRestrictions", "(Ljava/lang/String;)Landroid/os/Bundle;", "GetGetApplicationRestrictions_Ljava_lang_String_Handler")]
public virtual Android.OS.Bundle? GetApplicationRestrictions (string? packageName);
[<Android.Runtime.Register("getApplicationRestrictions", "(Ljava/lang/String;)Landroid/os/Bundle;", "GetGetApplicationRestrictions_Ljava_lang_String_Handler")>]
abstract member GetApplicationRestrictions : string -> Android.OS.Bundle
override this.GetApplicationRestrictions : string -> Android.OS.Bundle

Parameters

packageName
String

the package name of the calling application

Returns

a Bundle with the restrictions for that package, or an empty Bundle if there are no saved restrictions.

Attributes

Remarks

Returns a Bundle containing any saved application restrictions for the context user, for the given package name. Only an application with this package name can call this method.

The returned Bundle consists of key-value pairs, as defined by the application, where the types of values may be: <ul> <li>boolean<li>int<li>String or String[]<li>From android.os.Build.VERSION_CODES#M, Bundle or Bundle[]</ul>

NOTE: The method performs disk I/O and shouldn't be called on the main thread

Java documentation for android.os.UserManager.getApplicationRestrictions(java.lang.String).

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.

Applies to