类android.app.PackageInstallObserver源码实例Demo

下面列出了怎么用android.app.PackageInstallObserver的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: AndroidComponentPlugin   文件: PackageManager.java
/**
 * @hide
 *
 * Install a package. Since this may take a little while, the result will
 * be posted back to the given observer.  An installation will fail if the calling context
 * lacks the {@link android.Manifest.permission#INSTALL_PACKAGES} permission, if the
 * package named in the package file's manifest is already installed, or if there's no space
 * available on the device.
 *
 * @param packageURI The location of the package file to install.  This can be a 'file:' or a
 * 'content:' URI.
 * @param observer An observer callback to get notified when the package installation is
 * complete. {@link PackageInstallObserver#packageInstalled(String, Bundle, int)} will be
 * called when that happens. This parameter must not be null.
 * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK},
 * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}.
 * @param installerPackageName Optional package name of the application that is performing the
 * installation. This identifies which market the package came from.
 */
public abstract void installPackage(
        Uri packageURI, PackageInstallObserver observer,
        int flags, String installerPackageName);
 
源代码2 项目: AndroidComponentPlugin   文件: PackageManager.java
/**
 * Similar to
 * {@link #installPackage(Uri, IPackageInstallObserver, int, String)} but
 * with an extra verification file provided.
 *
 * @param packageURI The location of the package file to install. This can
 *            be a 'file:' or a 'content:' URI.
 * @param observer An observer callback to get notified when the package installation is
 * complete. {@link PackageInstallObserver#packageInstalled(String, Bundle, int)} will be
 * called when that happens. This parameter must not be null.
 * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK},
 *            {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}.
 * @param installerPackageName Optional package name of the application that
 *            is performing the installation. This identifies which market
 *            the package came from.
 * @param verificationURI The location of the supplementary verification
 *            file. This can be a 'file:' or a 'content:' URI. May be
 *            {@code null}.
 * @param manifestDigest an object that holds the digest of the package
 *            which can be used to verify ownership. May be {@code null}.
 * @param encryptionParams if the package to be installed is encrypted,
 *            these parameters describing the encryption and authentication
 *            used. May be {@code null}.
 * @hide
 */
public abstract void installPackageWithVerification(Uri packageURI,
        PackageInstallObserver observer, int flags, String installerPackageName,
        Uri verificationURI, ManifestDigest manifestDigest,
        ContainerEncryptionParams encryptionParams);
 
源代码3 项目: AndroidComponentPlugin   文件: PackageManager.java
/**
 * Similar to
 * {@link #installPackage(Uri, IPackageInstallObserver, int, String)} but
 * with an extra verification information provided.
 *
 * @param packageURI The location of the package file to install. This can
 *            be a 'file:' or a 'content:' URI.
 * @param observer An observer callback to get notified when the package installation is
 * complete. {@link PackageInstallObserver#packageInstalled(String, Bundle, int)} will be
 * called when that happens. This parameter must not be null.
 * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK},
 *            {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}.
 * @param installerPackageName Optional package name of the application that
 *            is performing the installation. This identifies which market
 *            the package came from.
 * @param verificationParams an object that holds signal information to
 *            assist verification. May be {@code null}.
 * @param encryptionParams if the package to be installed is encrypted,
 *            these parameters describing the encryption and authentication
 *            used. May be {@code null}.
 *
 * @hide
 */
public abstract void installPackageWithVerificationAndEncryption(Uri packageURI,
        PackageInstallObserver observer, int flags, String installerPackageName,
        VerificationParams verificationParams, ContainerEncryptionParams encryptionParams);
 
源代码4 项目: AndroidComponentPlugin   文件: PackageManager.java
/**
 * @hide
 *
 * Install a package. Since this may take a little while, the result will
 * be posted back to the given observer.  An installation will fail if the calling context
 * lacks the {@link android.Manifest.permission#INSTALL_PACKAGES} permission, if the
 * package named in the package file's manifest is already installed, or if there's no space
 * available on the device.
 *
 * @param packageURI The location of the package file to install.  This can be a 'file:' or a
 * 'content:' URI.
 * @param observer An observer callback to get notified when the package installation is
 * complete. {@link PackageInstallObserver#packageInstalled(String, Bundle, int)} will be
 * called when that happens. This parameter must not be null.
 * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK},
 * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}.
 * @param installerPackageName Optional package name of the application that is performing the
 * installation. This identifies which market the package came from.
 */
public abstract void installPackage(
        Uri packageURI, PackageInstallObserver observer,
        int flags, String installerPackageName);
 
源代码5 项目: AndroidComponentPlugin   文件: PackageManager.java
/**
 * Similar to
 * {@link #installPackage(Uri, IPackageInstallObserver, int, String)} but
 * with an extra verification file provided.
 *
 * @param packageURI The location of the package file to install. This can
 *            be a 'file:' or a 'content:' URI.
 * @param observer An observer callback to get notified when the package installation is
 * complete. {@link PackageInstallObserver#packageInstalled(String, Bundle, int)} will be
 * called when that happens. This parameter must not be null.
 * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK},
 *            {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}.
 * @param installerPackageName Optional package name of the application that
 *            is performing the installation. This identifies which market
 *            the package came from.
 * @param verificationURI The location of the supplementary verification
 *            file. This can be a 'file:' or a 'content:' URI. May be
 *            {@code null}.
 * @param manifestDigest an object that holds the digest of the package
 *            which can be used to verify ownership. May be {@code null}.
 * @param encryptionParams if the package to be installed is encrypted,
 *            these parameters describing the encryption and authentication
 *            used. May be {@code null}.
 * @hide
 */
public abstract void installPackageWithVerification(Uri packageURI,
        PackageInstallObserver observer, int flags, String installerPackageName,
        Uri verificationURI, ManifestDigest manifestDigest,
        ContainerEncryptionParams encryptionParams);
 
源代码6 项目: AndroidComponentPlugin   文件: PackageManager.java
/**
 * Similar to
 * {@link #installPackage(Uri, IPackageInstallObserver, int, String)} but
 * with an extra verification information provided.
 *
 * @param packageURI The location of the package file to install. This can
 *            be a 'file:' or a 'content:' URI.
 * @param observer An observer callback to get notified when the package installation is
 * complete. {@link PackageInstallObserver#packageInstalled(String, Bundle, int)} will be
 * called when that happens. This parameter must not be null.
 * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK},
 *            {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}.
 * @param installerPackageName Optional package name of the application that
 *            is performing the installation. This identifies which market
 *            the package came from.
 * @param verificationParams an object that holds signal information to
 *            assist verification. May be {@code null}.
 * @param encryptionParams if the package to be installed is encrypted,
 *            these parameters describing the encryption and authentication
 *            used. May be {@code null}.
 *
 * @hide
 */
public abstract void installPackageWithVerificationAndEncryption(Uri packageURI,
        PackageInstallObserver observer, int flags, String installerPackageName,
        VerificationParams verificationParams, ContainerEncryptionParams encryptionParams);
 
 类所在包
 类方法
 同包方法