Search in sources :

Example 11 with InstallerException

use of com.android.internal.os.InstallerConnection.InstallerException in project android_frameworks_base by ResurrectionRemix.

the class PackageInstallerSession method destroyInternal.

private void destroyInternal() {
    synchronized (mLock) {
        mSealed = true;
        mDestroyed = true;
        // Force shut down all bridges
        for (FileBridge bridge : mBridges) {
            bridge.forceClose();
        }
    }
    if (stageDir != null) {
        try {
            mPm.mInstaller.rmPackageDir(stageDir.getAbsolutePath());
        } catch (InstallerException ignored) {
        }
    }
    if (stageCid != null) {
        PackageHelper.destroySdDir(stageCid);
    }
}
Also used : FileBridge(android.os.FileBridge) InstallerException(com.android.internal.os.InstallerConnection.InstallerException)

Example 12 with InstallerException

use of com.android.internal.os.InstallerConnection.InstallerException in project android_frameworks_base by ResurrectionRemix.

the class Installer method getAppSize.

public void getAppSize(String uuid, String pkgname, int userid, int flags, long ceDataInode, String codePath, PackageStats stats) throws InstallerException {
    final String[] res = mInstaller.execute("get_app_size", uuid, pkgname, userid, flags, ceDataInode, codePath);
    try {
        stats.codeSize += Long.parseLong(res[1]);
        stats.dataSize += Long.parseLong(res[2]);
        stats.cacheSize += Long.parseLong(res[3]);
    } catch (ArrayIndexOutOfBoundsException | NumberFormatException e) {
        throw new InstallerException("Invalid size result: " + Arrays.toString(res));
    }
}
Also used : InstallerException(com.android.internal.os.InstallerConnection.InstallerException)

Aggregations

InstallerException (com.android.internal.os.InstallerConnection.InstallerException)12 FileBridge (android.os.FileBridge)4 ApplicationInfo (android.content.pm.ApplicationInfo)2 EphemeralApplicationInfo (android.content.pm.EphemeralApplicationInfo)2 PendingIntent (android.app.PendingIntent)1 BroadcastReceiver (android.content.BroadcastReceiver)1 Context (android.content.Context)1 IIntentReceiver (android.content.IIntentReceiver)1 Intent (android.content.Intent)1 IntentFilter (android.content.IntentFilter)1 PackageParser.isApkFile (android.content.pm.PackageParser.isApkFile)1 Point (android.graphics.Point)1 Bundle (android.os.Bundle)1 Message (android.os.Message)1 PersistableBundle (android.os.PersistableBundle)1 ArraySet (android.util.ArraySet)1 StrictJarFile (android.util.jar.StrictJarFile)1 DexFile (dalvik.system.DexFile)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1