Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3c30c21 authored by Dario Freni's avatar Dario Freni Committed by Android (Google) Code Review
Browse files

Merge "Throw a checked exception on child session linkage"

parents b953577b 0966047e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1897,7 +1897,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
    }

    @Override
    public void addChildSessionId(int childSessionId) {
    public void addChildSessionId(int childSessionId) throws RemoteException {
        final PackageInstallerSession childSession = mSessionProvider.getSession(childSessionId);
        if (childSession == null) {
            throw new RemoteException("Unable to add child.",
@@ -1912,7 +1912,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
                    new PackageManagerException("Child session " + childSessionId
                            + " and parent session " + this.sessionId + " do not have consistent"
                            + " staging session settings."),
                    false, true).rethrowAsRuntimeException();
                    false, true);
        }
        synchronized (mLock) {
            assertCallerIsOwnerOrRootLocked();
+6 −1
Original line number Diff line number Diff line
@@ -419,7 +419,12 @@ public class StagingManager {
                if (apkChildSession == null) {
                    return false;
                }
                try {
                    apkParentSession.addChildSessionId(apkChildSession.sessionId);
                } catch (RemoteException e) {
                    Slog.e(TAG, "Failed to add a child session for installing the APK files", e);
                    return false;
                }
            }
            return commitApkSession(apkParentSession, session.sessionId);
        }