PackageManager.CanPackageQuery Method

Definition

Overloads

CanPackageQuery(String, String)

Returns true if the source package is able to query for details about the target package.

CanPackageQuery(String, String[])

Same as #canPackageQuery(String, String) but accepts an array of target packages to be queried.

CanPackageQuery(String, String)

Returns true if the source package is able to query for details about the target package.

[Android.Runtime.Register("canPackageQuery", "(Ljava/lang/String;Ljava/lang/String;)Z", "GetCanPackageQuery_Ljava_lang_String_Ljava_lang_String_Handler", ApiSince=33)]
public virtual bool CanPackageQuery (string sourcePackageName, string targetPackageName);
[<Android.Runtime.Register("canPackageQuery", "(Ljava/lang/String;Ljava/lang/String;)Z", "GetCanPackageQuery_Ljava_lang_String_Ljava_lang_String_Handler", ApiSince=33)>]
abstract member CanPackageQuery : string * string -> bool
override this.CanPackageQuery : string * string -> bool

Parameters

sourcePackageName
String

The source package that would receive details about the target package.

targetPackageName
String

The target package whose details would be shared with the source package.

Returns

true if the source package is able to query for details about the target package.

Attributes

Remarks

Returns true if the source package is able to query for details about the target package. Applications that share details about other applications should use this API to determine if those details should be withheld from callers that do not otherwise have visibility of them.

Note: The caller must be able to query for details about the source and target package. A NameNotFoundException is thrown if it isn't.

Java documentation for android.content.pm.PackageManager.canPackageQuery(java.lang.String, 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

CanPackageQuery(String, String[])

Same as #canPackageQuery(String, String) but accepts an array of target packages to be queried.

[Android.Runtime.Register("canPackageQuery", "(Ljava/lang/String;[Ljava/lang/String;)[Z", "GetCanPackageQuery_Ljava_lang_String_arrayLjava_lang_String_Handler", ApiSince=34)]
public virtual bool[] CanPackageQuery (string sourcePackageName, string[] targetPackageNames);
[<Android.Runtime.Register("canPackageQuery", "(Ljava/lang/String;[Ljava/lang/String;)[Z", "GetCanPackageQuery_Ljava_lang_String_arrayLjava_lang_String_Handler", ApiSince=34)>]
abstract member CanPackageQuery : string * string[] -> bool[]
override this.CanPackageQuery : string * string[] -> bool[]

Parameters

sourcePackageName
String

The source package that would receive details about the target package.

targetPackageNames
String[]

An array of target packages whose details would be shared with the source package.

Returns

An array of booleans where each member specifies whether the source package is able to query for details about the target package given by the corresponding value at the same index in the array of target packages.

Attributes

Remarks

Same as #canPackageQuery(String, String) but accepts an array of target packages to be queried.

Java documentation for android.content.pm.PackageManager.canPackageQuery(java.lang.String, 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