Android.Test.Mock.MockPackageManager.SetInstallerPackageName Method
Change the installer associated with a given package.

Syntax

[Android.Runtime.Register("setInstallerPackageName", "(Ljava/lang/String;Ljava/lang/String;)V", "GetSetInstallerPackageName_Ljava_lang_String_Ljava_lang_String_Handler")]
public override void SetInstallerPackageName (string targetPackage, string installerPackageName)

Parameters

targetPackage
The installed package whose installer will be changed.
installerPackageName
The package name of the new installer. May be null to clear the association.

Remarks

Change the installer associated with a given package. There are limitations on how the installer package can be changed; in particular:

  • A SecurityException will be thrown if installerPackageName is not signed with the same certificate as the calling application.
  • A SecurityException will be thrown if targetPackage already has an installer package, and that installer package is not signed with the same certificate as the calling application.

[Android Documentation]

Requirements

Namespace: Android.Test.Mock
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 11