@Override protected VPackageInstallerService create() { return new VPackageInstallerService(); } };
private int createSessionInternal(SessionParams params, String installerPackageName, int userId) throws IOException { final int callingUid = VBinder.getCallingUid(); final int sessionId; final PackageInstallerSession session; synchronized (mSessions) { // Sanity check that installer isn't going crazy final int activeCount = getSessionCount(mSessions, callingUid); if (activeCount >= MAX_ACTIVE_SESSIONS) { throw new IllegalStateException( "Too many active sessions for UID " + callingUid); } sessionId = allocateSessionIdLocked(); session = new PackageInstallerSession(mInternalCallback, mContext, mInstallHandler.getLooper(), installerPackageName, sessionId, userId, callingUid, params, VEnvironment.getPackageInstallerStageDir()); } mCallbacks.notifySessionCreated(session.sessionId, session.userId); return sessionId; }
@Override public int createSession(SessionParams params, String installerPackageName, int userId) throws RemoteException { try { return createSessionInternal(params, installerPackageName, userId); } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public void updateSessionAppIcon(int sessionId, Bitmap appIcon) { synchronized (mSessions) { final PackageInstallerSession session = mSessions.get(sessionId); if (session == null || !isCallingUidOwner(session)) { throw new SecurityException("Caller has no access to session " + sessionId); } session.params.appIcon = appIcon; session.params.appIconLastModified = -1; mInternalCallback.onSessionBadgingChanged(session); } }
@Override public IPackageInstallerSession openSession(int sessionId) throws RemoteException { try { return openSessionInternal(sessionId); } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public IPackageInstaller getPackageInstaller() { return VPackageInstallerService.get(); }
@Override public void abandonSession(int sessionId) throws RemoteException { synchronized (mSessions) { final PackageInstallerSession session = mSessions.get(sessionId); if (session == null || !isCallingUidOwner(session)) { throw new SecurityException("Caller has no access to session " + sessionId); } session.abandon(); } }
@Override public IPackageInstallerSession openSession(int sessionId) throws RemoteException { try { return openSessionInternal(sessionId); } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public IPackageInstaller getPackageInstaller() { return VPackageInstallerService.get(); }
private IPackageInstallerSession openSessionInternal(int sessionId) throws IOException { synchronized (mSessions) { final PackageInstallerSession session = mSessions.get(sessionId); if (session == null || !isCallingUidOwner(session)) { throw new SecurityException("Caller has no access to session " + sessionId); } session.open(); return session; } }
private int createSessionInternal(SessionParams params, String installerPackageName, int userId) throws IOException { final int callingUid = VBinder.getCallingUid(); final int sessionId; final PackageInstallerSession session; synchronized (mSessions) { // Sanity check that installer isn't going crazy final int activeCount = getSessionCount(mSessions, callingUid); if (activeCount >= MAX_ACTIVE_SESSIONS) { throw new IllegalStateException( "Too many active sessions for UID " + callingUid); } sessionId = allocateSessionIdLocked(); session = new PackageInstallerSession(mInternalCallback, mContext, mInstallHandler.getLooper(), installerPackageName, sessionId, userId, callingUid, params, VEnvironment.getPackageInstallerStageDir()); } mCallbacks.notifySessionCreated(session.sessionId, session.userId); return sessionId; }
@Override protected VPackageInstallerService create() { return new VPackageInstallerService(); } };
@Override public IPackageInstallerSession openSession(int sessionId) throws RemoteException { try { return openSessionInternal(sessionId); } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public int createSession(SessionParams params, String installerPackageName, int userId) throws RemoteException { try { return createSessionInternal(params, installerPackageName, userId); } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public IBinder getPackageInstaller() { return VPackageInstallerService.get(); }
@Override public void updateSessionAppLabel(int sessionId, String appLabel) throws RemoteException { synchronized (mSessions) { final PackageInstallerSession session = mSessions.get(sessionId); if (session == null || !isCallingUidOwner(session)) { throw new SecurityException("Caller has no access to session " + sessionId); } session.params.appLabel = appLabel; mInternalCallback.onSessionBadgingChanged(session); } }
private int createSessionInternal(SessionParams params, String installerPackageName, int userId) throws IOException { final int callingUid = VBinder.getCallingUid(); final int sessionId; final PackageInstallerSession session; synchronized (mSessions) { // Sanity check that installer isn't going crazy final int activeCount = getSessionCount(mSessions, callingUid); if (activeCount >= MAX_ACTIVE_SESSIONS) { throw new IllegalStateException( "Too many active sessions for UID " + callingUid); } sessionId = allocateSessionIdLocked(); session = new PackageInstallerSession(mInternalCallback, mContext, mInstallHandler.getLooper(), installerPackageName, sessionId, userId, callingUid, params, VEnvironment.getPackageInstallerStageDir()); } mCallbacks.notifySessionCreated(session.sessionId, session.userId); return sessionId; }
@Override protected VPackageInstallerService create() { return new VPackageInstallerService(); } };
@Override public int createSession(SessionParams params, String installerPackageName, int userId) throws RemoteException { try { return createSessionInternal(params, installerPackageName, userId); } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public void abandonSession(int sessionId) throws RemoteException { synchronized (mSessions) { final PackageInstallerSession session = mSessions.get(sessionId); if (session == null || !isCallingUidOwner(session)) { throw new SecurityException("Caller has no access to session " + sessionId); } session.abandon(); } }