@Override public IPackageInstallerSession openSession(int sessionId) throws RemoteException { try { return openSessionInternal(sessionId); } catch (IOException e) { throw new IllegalStateException(e); } }
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; } }