Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8b718c2 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Initial support for split APKs, PackageInstaller."

parents 9edfec8b 3a44f3f1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -127,6 +127,8 @@ LOCAL_SRC_FILES += \
	core/java/android/content/pm/IPackageDeleteObserver.aidl \
	core/java/android/content/pm/IPackageInstallObserver.aidl \
	core/java/android/content/pm/IPackageInstallObserver2.aidl \
	core/java/android/content/pm/IPackageInstaller.aidl \
	core/java/android/content/pm/IPackageInstallerSession.aidl \
	core/java/android/content/pm/IPackageManager.aidl \
	core/java/android/content/pm/IPackageMoveObserver.aidl \
	core/java/android/content/pm/IPackageStatsObserver.aidl \
+14 −3
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.content.pm.IPackageMoveObserver;
import android.content.pm.IPackageStatsObserver;
import android.content.pm.InstrumentationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageInstaller;
import android.content.pm.PackageManager;
import android.content.pm.ParceledListSlice;
import android.content.pm.PermissionGroupInfo;
@@ -1127,7 +1128,7 @@ final class ApplicationPackageManager extends PackageManager {
    public void installPackage(Uri packageURI, PackageInstallObserver observer,
            int flags, String installerPackageName) {
        try {
            mPM.installPackageEtc(packageURI, null, observer.mObserver,
            mPM.installPackageEtc(packageURI, null, observer.getBinder(),
                    flags, installerPackageName);
        } catch (RemoteException e) {
            // Should never happen!
@@ -1140,7 +1141,7 @@ final class ApplicationPackageManager extends PackageManager {
            Uri verificationURI, ManifestDigest manifestDigest,
            ContainerEncryptionParams encryptionParams) {
        try {
            mPM.installPackageWithVerificationEtc(packageURI, null, observer.mObserver, flags,
            mPM.installPackageWithVerificationEtc(packageURI, null, observer.getBinder(), flags,
                    installerPackageName, verificationURI, manifestDigest, encryptionParams);
        } catch (RemoteException e) {
            // Should never happen!
@@ -1153,7 +1154,7 @@ final class ApplicationPackageManager extends PackageManager {
            VerificationParams verificationParams, ContainerEncryptionParams encryptionParams) {
        try {
            mPM.installPackageWithVerificationAndEncryptionEtc(packageURI, null,
                    observer.mObserver, flags, installerPackageName, verificationParams,
                    observer.getBinder(), flags, installerPackageName, verificationParams,
                    encryptionParams);
        } catch (RemoteException e) {
            // Should never happen!
@@ -1440,6 +1441,16 @@ final class ApplicationPackageManager extends PackageManager {
        return null;
    }

    @Override
    public PackageInstaller getPackageInstaller() {
        try {
            return new PackageInstaller(this, mPM.getPackageInstaller(), mContext.getUserId(),
                    mContext.getPackageName());
        } catch (RemoteException e) {
            throw e.rethrowAsRuntimeException();
        }
    }

    /**
     * @hide
     */
+22 −18
Original line number Diff line number Diff line
@@ -18,32 +18,36 @@ package android.app;

import android.content.pm.IPackageInstallObserver2;
import android.os.Bundle;
import android.os.RemoteException;

/**
 * @hide
 *
 * New-style observer for package installers to use.
 */
/** {@hide} */
public class PackageInstallObserver {
    IPackageInstallObserver2.Stub mObserver = new IPackageInstallObserver2.Stub() {
    private final IPackageInstallObserver2.Stub mBinder = new IPackageInstallObserver2.Stub() {
        @Override
        public void packageInstalled(String pkgName, Bundle extras, int result)
                throws RemoteException {
            PackageInstallObserver.this.packageInstalled(pkgName, extras, result);
        public void packageInstalled(String basePackageName, Bundle extras, int returnCode) {
            PackageInstallObserver.this.packageInstalled(basePackageName, extras, returnCode);
        }
    };

    /** {@hide} */
    public IPackageInstallObserver2.Stub getBinder() {
        return mBinder;
    }

    /**
     * This method will be called to report the result of the package installation attempt.
     * This method will be called to report the result of the package
     * installation attempt.
     *
     * @param pkgName Name of the package whose installation was attempted
     * @param extras If non-null, this Bundle contains extras providing additional information
     *        about an install failure.  See {@link android.content.pm.PackageManager} for
     *        documentation about which extras apply to various failures; in particular the
     *        strings named EXTRA_FAILURE_*.
     * @param result The numeric success or failure code indicating the basic outcome
     * @param basePackageName Name of the package whose installation was
     *            attempted
     * @param extras If non-null, this Bundle contains extras providing
     *            additional information about an install failure. See
     *            {@link android.content.pm.PackageManager} for documentation
     *            about which extras apply to various failures; in particular
     *            the strings named EXTRA_FAILURE_*.
     * @param returnCode The numeric success or failure code indicating the
     *            basic outcome
     * @hide
     */
    public void packageInstalled(String pkgName, Bundle extras, int result) {
    public void packageInstalled(String basePackageName, Bundle extras, int returnCode) {
    }
}
+37 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.app;

import android.content.pm.IPackageDeleteObserver;

/** {@hide} */
public class PackageUninstallObserver {
    private final IPackageDeleteObserver.Stub mBinder = new IPackageDeleteObserver.Stub() {
        @Override
        public void packageDeleted(String basePackageName, int returnCode) {
            PackageUninstallObserver.this.onUninstallFinished(basePackageName, returnCode);
        }
    };

    /** {@hide} */
    public IPackageDeleteObserver.Stub getBinder() {
        return mBinder;
    }

    public void onUninstallFinished(String basePackageName, int returnCode) {
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -32,9 +32,11 @@ import javax.crypto.spec.IvParameterSpec;
/**
 * Represents encryption parameters used to read a container.
 *
 * @deprecated encrypted containers are legacy.
 * @hide
 */
@PrivateApi
@Deprecated
public class ContainerEncryptionParams implements Parcelable {
    protected static final String TAG = "ContainerEncryptionParams";

Loading