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

Commit c1311ae4 authored by Chun-Wei Wang's avatar Chun-Wei Wang Committed by Android (Google) Code Review
Browse files

Merge "Send the intent after verification completed (6/n)"

parents dda72399 47ef1e92
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -2264,10 +2264,6 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
        }

        if (params.isStaged) {
            // TODO(b/136257624): CTS test fails if we don't send session finished broadcast, even
            //  though ideally, we just need to send session committed broadcast.
            sendUpdateToRemoteStatusReceiver(INSTALL_SUCCEEDED, "Session staged", null);

            mStagedSession.verifySession();
        } else {
            verify();
@@ -2514,6 +2510,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
                mStagedSession.notifyEndPreRebootVerification();
                if (error == SessionInfo.SESSION_NO_ERROR) {
                    mStagingManager.commitSession(mStagedSession);
                    sendUpdateToRemoteStatusReceiver(INSTALL_SUCCEEDED, "Session staged", null);
                } else {
                    dispatchSessionFinished(INSTALL_FAILED_VERIFICATION_FAILURE, msg, null);
                    maybeFinishChildSessions(INSTALL_FAILED_VERIFICATION_FAILURE, msg);
+17 −8
Original line number Diff line number Diff line
@@ -3563,6 +3563,7 @@ class PackageManagerShellCommand extends ShellCommand {
            }
            final LocalIntentReceiver receiver = new LocalIntentReceiver();
            session.commit(receiver.getIntentSender());
            if (!session.isStaged()) {
                final Intent result = receiver.getResult();
                final int status = result.getIntExtra(PackageInstaller.EXTRA_STATUS,
                        PackageInstaller.STATUS_FAILURE);
@@ -3575,6 +3576,14 @@ class PackageManagerShellCommand extends ShellCommand {
                            + result.getStringExtra(PackageInstaller.EXTRA_STATUS_MESSAGE) + "]");
                }
                return status;
            } else {
                // Return immediately without retrieving the result. The caller will decide
                // whether to wait for the session to become ready.
                if (logSuccess) {
                    pw.println("Success");
                }
                return PackageInstaller.STATUS_SUCCESS;
            }
        } finally {
            IoUtils.closeQuietly(session);
        }