Loading api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -8670,6 +8670,7 @@ package android.content.pm { } } public class PackageInstaller { public class PackageInstaller { method public void abandonSession(int); method public void addSessionCallback(android.content.pm.PackageInstaller.SessionCallback); method public void addSessionCallback(android.content.pm.PackageInstaller.SessionCallback); method public void addSessionCallback(android.content.pm.PackageInstaller.SessionCallback, android.os.Handler); method public void addSessionCallback(android.content.pm.PackageInstaller.SessionCallback, android.os.Handler); method public int createSession(android.content.pm.PackageInstaller.SessionParams) throws java.io.IOException; method public int createSession(android.content.pm.PackageInstaller.SessionParams) throws java.io.IOException; core/java/android/content/pm/IPackageInstaller.aidl +2 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,8 @@ import android.content.IntentSender; /** {@hide} */ /** {@hide} */ interface IPackageInstaller { interface IPackageInstaller { int createSession(in PackageInstaller.SessionParams params, String installerPackageName, int userId); int createSession(in PackageInstaller.SessionParams params, String installerPackageName, int userId); void abandonSession(int sessionId); IPackageInstallerSession openSession(int sessionId); IPackageInstallerSession openSession(int sessionId); PackageInstaller.SessionInfo getSessionInfo(int sessionId); PackageInstaller.SessionInfo getSessionInfo(int sessionId); Loading core/java/android/content/pm/PackageInstaller.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -312,6 +312,14 @@ public class PackageInstaller { } } } } public void abandonSession(int sessionId) { try { mInstaller.abandonSession(sessionId); } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } } /** /** * Return details for a specific session. To succeed, the caller must either * Return details for a specific session. To succeed, the caller must either * own this session, or be the current home app. * own this session, or be the current home app. Loading services/core/java/com/android/server/pm/PackageInstallerService.java +14 −4 Original line number Original line Diff line number Diff line Loading @@ -456,6 +456,8 @@ public class PackageInstallerService extends IPackageInstaller.Stub { throw new SecurityException("User restriction prevents installing"); throw new SecurityException("User restriction prevents installing"); } } // TODO: double check all possible install flags if ((callingUid == Process.SHELL_UID) || (callingUid == Process.ROOT_UID)) { if ((callingUid == Process.SHELL_UID) || (callingUid == Process.ROOT_UID)) { installerPackageName = "com.android.shell"; installerPackageName = "com.android.shell"; Loading Loading @@ -578,6 +580,17 @@ public class PackageInstallerService extends IPackageInstaller.Stub { return sessionId; return sessionId; } } @Override public void abandonSession(int sessionId) { 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(); } } private void checkInternalStorage(long sizeBytes) throws IOException { private void checkInternalStorage(long sizeBytes) throws IOException { if (sizeBytes <= 0) return; if (sizeBytes <= 0) return; Loading Loading @@ -606,10 +619,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub { public IPackageInstallerSession openSession(int sessionId) { public IPackageInstallerSession openSession(int sessionId) { synchronized (mSessions) { synchronized (mSessions) { final PackageInstallerSession session = mSessions.get(sessionId); final PackageInstallerSession session = mSessions.get(sessionId); if (session == null) { if (session == null || !isCallingUidOwner(session)) { throw new IllegalStateException("Missing session " + sessionId); } if (!isCallingUidOwner(session)) { throw new SecurityException("Caller has no access to session " + sessionId); throw new SecurityException("Caller has no access to session " + sessionId); } } session.open(); session.open(); Loading services/core/java/com/android/server/pm/PackageManagerService.java +232 −526 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -8670,6 +8670,7 @@ package android.content.pm { } } public class PackageInstaller { public class PackageInstaller { method public void abandonSession(int); method public void addSessionCallback(android.content.pm.PackageInstaller.SessionCallback); method public void addSessionCallback(android.content.pm.PackageInstaller.SessionCallback); method public void addSessionCallback(android.content.pm.PackageInstaller.SessionCallback, android.os.Handler); method public void addSessionCallback(android.content.pm.PackageInstaller.SessionCallback, android.os.Handler); method public int createSession(android.content.pm.PackageInstaller.SessionParams) throws java.io.IOException; method public int createSession(android.content.pm.PackageInstaller.SessionParams) throws java.io.IOException;
core/java/android/content/pm/IPackageInstaller.aidl +2 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,8 @@ import android.content.IntentSender; /** {@hide} */ /** {@hide} */ interface IPackageInstaller { interface IPackageInstaller { int createSession(in PackageInstaller.SessionParams params, String installerPackageName, int userId); int createSession(in PackageInstaller.SessionParams params, String installerPackageName, int userId); void abandonSession(int sessionId); IPackageInstallerSession openSession(int sessionId); IPackageInstallerSession openSession(int sessionId); PackageInstaller.SessionInfo getSessionInfo(int sessionId); PackageInstaller.SessionInfo getSessionInfo(int sessionId); Loading
core/java/android/content/pm/PackageInstaller.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -312,6 +312,14 @@ public class PackageInstaller { } } } } public void abandonSession(int sessionId) { try { mInstaller.abandonSession(sessionId); } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } } /** /** * Return details for a specific session. To succeed, the caller must either * Return details for a specific session. To succeed, the caller must either * own this session, or be the current home app. * own this session, or be the current home app. Loading
services/core/java/com/android/server/pm/PackageInstallerService.java +14 −4 Original line number Original line Diff line number Diff line Loading @@ -456,6 +456,8 @@ public class PackageInstallerService extends IPackageInstaller.Stub { throw new SecurityException("User restriction prevents installing"); throw new SecurityException("User restriction prevents installing"); } } // TODO: double check all possible install flags if ((callingUid == Process.SHELL_UID) || (callingUid == Process.ROOT_UID)) { if ((callingUid == Process.SHELL_UID) || (callingUid == Process.ROOT_UID)) { installerPackageName = "com.android.shell"; installerPackageName = "com.android.shell"; Loading Loading @@ -578,6 +580,17 @@ public class PackageInstallerService extends IPackageInstaller.Stub { return sessionId; return sessionId; } } @Override public void abandonSession(int sessionId) { 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(); } } private void checkInternalStorage(long sizeBytes) throws IOException { private void checkInternalStorage(long sizeBytes) throws IOException { if (sizeBytes <= 0) return; if (sizeBytes <= 0) return; Loading Loading @@ -606,10 +619,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub { public IPackageInstallerSession openSession(int sessionId) { public IPackageInstallerSession openSession(int sessionId) { synchronized (mSessions) { synchronized (mSessions) { final PackageInstallerSession session = mSessions.get(sessionId); final PackageInstallerSession session = mSessions.get(sessionId); if (session == null) { if (session == null || !isCallingUidOwner(session)) { throw new IllegalStateException("Missing session " + sessionId); } if (!isCallingUidOwner(session)) { throw new SecurityException("Caller has no access to session " + sessionId); throw new SecurityException("Caller has no access to session " + sessionId); } } session.open(); session.open(); Loading
services/core/java/com/android/server/pm/PackageManagerService.java +232 −526 File changed.Preview size limit exceeded, changes collapsed. Show changes