MockPackageManager.GetPackageInfo 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.
Overloads
| Name | Description |
|---|---|
| GetPackageInfo(VersionedPackage, PackageInfoFlags) |
Throws UnsupportedOperationException. Override this method to get package information in a test. |
| GetPackageInfo(String, PackageInfoFlags) |
Retrieve overall information about an application package that is installed on the system. |
GetPackageInfo(VersionedPackage, PackageInfoFlags)
Throws UnsupportedOperationException. Override this method to get package information in a test.
[Android.Runtime.Register("getPackageInfo", "(Landroid/content/pm/VersionedPackage;I)Landroid/content/pm/PackageInfo;", "GetGetPackageInfo_Landroid_content_pm_VersionedPackage_IHandler", ApiSince=26)]
public override Android.Content.PM.PackageInfo? GetPackageInfo(Android.Content.PM.VersionedPackage? versionedPackage, Android.Content.PM.PackageInfoFlags flags);
[<Android.Runtime.Register("getPackageInfo", "(Landroid/content/pm/VersionedPackage;I)Landroid/content/pm/PackageInfo;", "GetGetPackageInfo_Landroid_content_pm_VersionedPackage_IHandler", ApiSince=26)>]
override this.GetPackageInfo : Android.Content.PM.VersionedPackage * Android.Content.PM.PackageInfoFlags -> Android.Content.PM.PackageInfo
Parameters
- versionedPackage
- VersionedPackage
The package name and version. Available to a test override; the default mock implementation does not use this argument.
- flags
- PackageInfoFlags
The flags for the requested operation. Available to a test override; the default mock implementation does not use this argument.
Returns
No value is returned. The default mock implementation throws UnsupportedOperationException; override this method to supply a test result.
- Attributes
Remarks
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
GetPackageInfo(String, PackageInfoFlags)
Retrieve overall information about an application package that is installed on the system.
[Android.Runtime.Register("getPackageInfo", "(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;", "GetGetPackageInfo_Ljava_lang_String_IHandler")]
public override Android.Content.PM.PackageInfo? GetPackageInfo(string? packageName, Android.Content.PM.PackageInfoFlags flags);
[<Android.Runtime.Register("getPackageInfo", "(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;", "GetGetPackageInfo_Ljava_lang_String_IHandler")>]
override this.GetPackageInfo : string * Android.Content.PM.PackageInfoFlags -> Android.Content.PM.PackageInfo
Parameters
- packageName
- String
The full name (i.e. com.google.apps.contacts) of the desired package.
- flags
- PackageInfoFlags
Additional option flags. Use any combination of Activities, Gids, Configurations, Instrumentation, Permissions, Providers, Receivers, Services, Signatures, UninstalledPackages to modify the data returned.
Returns
No value is returned. The default mock implementation throws UnsupportedOperationException; override this method to supply a test result.
- Attributes
Exceptions
Not thrown by the default mock implementation, which throws UnsupportedOperationException instead. A test override can supply its own behavior.
Remarks
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.