다음을 통해 공유


PackageInstaller.SessionParams.SetInstallerPackageName(String) Method

Definition

Set the installer package for the app.

[Android.Runtime.Register("setInstallerPackageName", "(Ljava/lang/String;)V", "GetSetInstallerPackageName_Ljava_lang_String_Handler", ApiSince=34)]
public virtual void SetInstallerPackageName (string? installerPackageName);
[<Android.Runtime.Register("setInstallerPackageName", "(Ljava/lang/String;)V", "GetSetInstallerPackageName_Ljava_lang_String_Handler", ApiSince=34)>]
abstract member SetInstallerPackageName : string -> unit
override this.SetInstallerPackageName : string -> unit

Parameters

installerPackageName
String

The name of the installer package, its length must be less than 255, otherwise it will be invalid.

Attributes

Remarks

Set the installer package for the app.

By default this is the app that created the PackageInstaller object.

Note: Only applications with android.Manifest.permission#INSTALL_PACKAGES permission are allowed to set an installer that is not the caller's own installer package name, otherwise it will cause a SecurityException when creating the install session.

Java documentation for android.content.pm.PackageInstaller.SessionParams.setInstallerPackageName(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