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

Commit b560b645 authored by Mohammad Samiul Islam's avatar Mohammad Samiul Islam
Browse files

Prevent exceptions in pre-reboot verification from crashing system server

An unhandled exception during pre-reboot verification will cause system
server to crash and restart.

Instead of allowing the exception to crash the system server, we now
catch it and fail the corresponding staged session with appropriate
message.

Bug: 170784748
Test: manual
Test: verified that without this fix, any unhandled exception crashes
the system server.

Change-Id: If100796687906be67bc02ea63a78e1b6e291ce7a
parent df1d9b98
Loading
Loading
Loading
Loading
+20 −13
Original line number Diff line number Diff line
@@ -1059,6 +1059,7 @@ public class StagingManager {
                onPreRebootVerificationComplete(session);
                return;
            }
            try {
                switch (msg.what) {
                    case MSG_PRE_REBOOT_VERIFICATION_START:
                        handlePreRebootVerification_Start(session);
@@ -1073,6 +1074,12 @@ public class StagingManager {
                        handlePreRebootVerification_End(session);
                        break;
                }
            } catch (Exception e) {
                Slog.e(TAG, "Pre-reboot verification failed due to unhandled exception", e);
                onPreRebootVerificationFailure(session,
                        SessionInfo.STAGED_SESSION_ACTIVATION_FAILED,
                        "Pre-reboot verification failed due to unhandled exception: " + e);
            }
        }

        // Notify the handler that system is ready, and reschedule the pre-reboot verifications.