語言

DevicePolicyManager.GetApplicationRestrictions(ComponentName, String) 方法

定義

取得呼叫使用者中執行的特定目標應用程式的應用程式限制。

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

參數

admin
ComponentName

這個請求就是與該 DeviceAdminReceiver 套件相關聯,或者 null 如果應用程式限制管理套件呼叫。

packageName
String

用來取得受限設定的套件名稱。

傳回

Bundle 這些設定會呼叫與上次 DevicePolicyManager#setApplicationRestrictions 設定相同的設定,若未設定限制則為空 Bundle 。

屬性

備註

取得呼叫使用者中執行的特定目標應用程式的應用程式限制。

呼叫者必須是該使用者的設定檔或裝置擁有者,或該套件被允許透過作用域管理應用程式限制#setDelegatedScopes#DELEGATION_APP_RESTRICTIONS;否則會拋出安全例外。

注意:此方法執行磁碟 I/O,主執行緒不應被呼叫

Java 文件 android.app.admin.DevicePolicyManager.getApplicationRestrictions(android.content.ComponentName, java.lang.String)。

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

適用於