Java 类android.content.pm.IPackageInstallObserver2 实例源码

项目:VirtualHook    文件:PackageInstallerSession.java   
@Override
public boolean handleMessage(Message msg) {
    synchronized (mLock) {
        if (msg.obj != null) {
            mRemoteObserver = (IPackageInstallObserver2) msg.obj;
        }
        try {
            commitLocked();
        } catch (PackageManagerException e) {
            final String completeMsg = getCompleteMessage(e);
            VLog.e(TAG, "Commit of session " + sessionId + " failed: " + completeMsg);
            destroyInternal();
            dispatchSessionFinished(e.error, completeMsg, null);
        }

        return true;
    }
}
项目:TPlayer    文件:PackageInstallerSession.java   
@Override
public boolean handleMessage(Message msg) {
    synchronized (mLock) {
        if (msg.obj != null) {
            mRemoteObserver = (IPackageInstallObserver2) msg.obj;
        }
        try {
            commitLocked();
        } catch (PackageManagerException e) {
            final String completeMsg = getCompleteMessage(e);
            VLog.e(TAG, "Commit of session " + sessionId + " failed: " + completeMsg);
            destroyInternal();
            dispatchSessionFinished(e.error, completeMsg, null);
        }

        return true;
    }
}
项目:container    文件:PackageInstallerSession.java   
@Override
public boolean handleMessage(Message msg) {
    synchronized (mLock) {
        if (msg.obj != null) {
            mRemoteObserver = (IPackageInstallObserver2) msg.obj;
        }
        try {
            commitLocked();
        } catch (PackageManagerException e) {
            final String completeMsg = getCompleteMessage(e);
            VLog.e(TAG, "Commit of session " + sessionId + " failed: " + completeMsg);
            destroyInternal();
            dispatchSessionFinished(e.error, completeMsg, null);
        }

        return true;
    }
}
项目:VirtualHook    文件:PackageInstallerSession.java   
private void commitLocked() throws PackageManagerException {
    if (mDestroyed) {
        throw new PackageManagerException(INSTALL_FAILED_INTERNAL_ERROR, "Session destroyed");
    }
    if (!mSealed) {
        throw new PackageManagerException(INSTALL_FAILED_INTERNAL_ERROR, "Session not sealed");
    }
    try {
        resolveStageDir();
    } catch (IOException e) {
        e.printStackTrace();
    }
    validateInstallLocked();
    mInternalProgress = 0.5f;
    computeProgressLocked(true);
    // We've reached point of no return; call into PMS to install the stage.
    // Regardless of success or failure we always destroy session.
    final IPackageInstallObserver2 localObserver = new IPackageInstallObserver2.Stub() {
        @Override
        public void onUserActionRequired(Intent intent) {
            throw new IllegalStateException();
        }

        @Override
        public void onPackageInstalled(String basePackageName, int returnCode, String msg,
                                       Bundle extras) {
            destroyInternal();
            dispatchSessionFinished(returnCode, msg, extras);
        }
    };
}
项目:TPlayer    文件:PackageInstallerSession.java   
private void commitLocked() throws PackageManagerException {
    if (mDestroyed) {
        throw new PackageManagerException(INSTALL_FAILED_INTERNAL_ERROR, "Session destroyed");
    }
    if (!mSealed) {
        throw new PackageManagerException(INSTALL_FAILED_INTERNAL_ERROR, "Session not sealed");
    }
    try {
        resolveStageDir();
    } catch (IOException e) {
        e.printStackTrace();
    }
    validateInstallLocked();
    mInternalProgress = 0.5f;
    computeProgressLocked(true);
    // We've reached point of no return; call into PMS to install the stage.
    // Regardless of success or failure we always destroy session.
    final IPackageInstallObserver2 localObserver = new IPackageInstallObserver2.Stub() {
        @Override
        public void onUserActionRequired(Intent intent) {
            throw new IllegalStateException();
        }

        @Override
        public void onPackageInstalled(String basePackageName, int returnCode, String msg,
                                       Bundle extras) {
            destroyInternal();
            dispatchSessionFinished(returnCode, msg, extras);
        }
    };
}
项目:container    文件:PackageInstallerSession.java   
private void commitLocked() throws PackageManagerException {
    if (mDestroyed) {
        throw new PackageManagerException(INSTALL_FAILED_INTERNAL_ERROR, "Session destroyed");
    }
    if (!mSealed) {
        throw new PackageManagerException(INSTALL_FAILED_INTERNAL_ERROR, "Session not sealed");
    }
    try {
        resolveStageDir();
    } catch (IOException e) {
        e.printStackTrace();
    }
    validateInstallLocked();
    mInternalProgress = 0.5f;
    computeProgressLocked(true);
    // We've reached point of no return; call into PMS to install the stage.
    // Regardless of success or failure we always destroy session.
    final IPackageInstallObserver2 localObserver = new IPackageInstallObserver2.Stub() {
        @Override
        public void onUserActionRequired(Intent intent) {
            throw new IllegalStateException();
        }

        @Override
        public void onPackageInstalled(String basePackageName, int returnCode, String msg,
                                       Bundle extras) {
            destroyInternal();
            dispatchSessionFinished(returnCode, msg, extras);
        }
    };
}
项目:VirtualHook    文件:PackageInstallObserver.java   
/**
 * {@hide}
 */
public IPackageInstallObserver2 getBinder() {
    return mBinder;
}
项目:TPlayer    文件:PackageInstallObserver.java   
/**
 * {@hide}
 */
public IPackageInstallObserver2 getBinder() {
    return mBinder;
}
项目:container    文件:PackageInstallObserver.java   
/**
 * {@hide}
 */
public IPackageInstallObserver2 getBinder() {
    return mBinder;
}