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
This commit is contained in:
@@ -1059,6 +1059,7 @@ public class StagingManager {
|
|||||||
onPreRebootVerificationComplete(session);
|
onPreRebootVerificationComplete(session);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
switch (msg.what) {
|
switch (msg.what) {
|
||||||
case MSG_PRE_REBOOT_VERIFICATION_START:
|
case MSG_PRE_REBOOT_VERIFICATION_START:
|
||||||
handlePreRebootVerification_Start(session);
|
handlePreRebootVerification_Start(session);
|
||||||
@@ -1073,6 +1074,12 @@ public class StagingManager {
|
|||||||
handlePreRebootVerification_End(session);
|
handlePreRebootVerification_End(session);
|
||||||
break;
|
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.
|
// Notify the handler that system is ready, and reschedule the pre-reboot verifications.
|
||||||
|
|||||||
Reference in New Issue
Block a user