implements PLN-0062 native shell lifecycle wiring
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use crate::firmware::firmware_state::{AppCrashesStep, FirmwareState, HubHomeStep};
|
||||
use crate::firmware::prometeu_context::PrometeuContext;
|
||||
use prometeu_hal::log::LogSource;
|
||||
use prometeu_system::CrashReport;
|
||||
use prometeu_system::task::{TaskId, TaskState};
|
||||
use prometeu_system::{CrashReport, SystemProfileAction};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ShellRunningStep {
|
||||
@@ -66,6 +66,16 @@ impl ShellRunningStep {
|
||||
return Some(FirmwareState::AppCrashes(AppCrashesStep { report }));
|
||||
}
|
||||
|
||||
if outcome.action == Some(SystemProfileAction::CloseShell) {
|
||||
if let Err(error) = ctx.os.lifecycle().close_task(self.task_id) {
|
||||
ctx.os.error(
|
||||
LogSource::Hub,
|
||||
format!("Failed to close shell task {:?}: {:?}", self.task_id, error),
|
||||
);
|
||||
}
|
||||
return Some(FirmwareState::HubHome(HubHomeStep));
|
||||
}
|
||||
|
||||
if !ctx.os.windows().focused_window_belongs_to_task(self.task_id) {
|
||||
ctx.os.info(
|
||||
LogSource::Hub,
|
||||
|
||||
Reference in New Issue
Block a user