fn change_login_override(
    context: RequestContext<SystemSettings, SystemWatchResponder>,
    mode: SystemLoginOverrideMode,
    responder: SystemSetResponder,
) {
    fasync::spawn(async move {
        let login_override_result = request(
            context.switchboard.clone(),
            SettingType::System,
            SettingRequest::SetLoginOverrideMode(mode),
            "set login override",
        )
        .await;
        if login_override_result.is_err() {
            responder.send(&mut Err(fidl_fuchsia_settings::Error::Failed)).ok();
            return;
        }

        let schedule_account_clear_result = request(
            context.switchboard.clone(),
            SettingType::Account,
            SettingRequest::ScheduleClearAccounts,
            "clear accounts",
        )
        .await;

        if schedule_account_clear_result.is_err() {
            responder.send(&mut Err(fidl_fuchsia_settings::Error::Failed)).ok();
            return;
        }

        let restart_result = request(
            context.switchboard.clone(),
            SettingType::Power,
            SettingRequest::Reboot,
            "rebooting",
        )
        .await;

        if restart_result.is_err() {
            responder.send(&mut Err(fidl_fuchsia_settings::Error::Failed)).ok();
            return;
        }

        responder.send(&mut Ok(())).ok();
    });
}
/// Sets the login mode and schedules accounts to be cleared. Upon success, the
/// device is scheduled to reboot so the change will take effect.
Sets the login mode and schedules accounts to be cleared. Upon success, the
device is scheduled to reboot so the change will take effect.
Sets the login mode and schedules accounts to be cleared . Upon success the device is scheduled to reboot so the change will take effect .
fn change_login_override(
    context: RequestContext<SystemSettings, SystemWatchResponder>,
    mode: SystemLoginOverrideMode,
    responder: SystemSetResponder,
) {
    fasync::spawn(async move {
        let login_override_result = request(
            context.switchboard.clone(),
            SettingType::System,
            SettingRequest::SetLoginOverrideMode(mode),
            "set login override",
        )
        .await;
        if login_override_result.is_err() {
            responder.send(&mut Err(fidl_fuchsia_settings::Error::Failed)).ok();
            return;
        }
        let schedule_account_clear_result = request(
            context.switchboard.clone(),
            SettingType::Account,
            SettingRequest::ScheduleClearAccounts,
            "clear accounts",
        )
        .await;
        if schedule_account_clear_result.is_err() {
            responder.send(&mut Err(fidl_fuchsia_settings::Error::Failed)).ok();
            return;
        }
        let restart_result = request(
            context.switchboard.clone(),
            SettingType::Power,
            SettingRequest::Reboot,
            "rebooting",
        )
        .await;
        if restart_result.is_err() {
            responder.send(&mut Err(fidl_fuchsia_settings::Error::Failed)).ok();
            return;
        }
        responder.send(&mut Ok(())).ok();
    });
}
fn change_login_override ( context : RequestContext < SystemSettings , SystemWatchResponder > , mode : SystemLoginOverrideMode , responder : SystemSetResponder , ) { fasync :: spawn ( async move { let login_override_result = request ( context . switchboard . clone ( ) , SettingType :: System , SettingRequest :: SetLoginOverrideMode ( mode ) , " " , ) . await ; if login_override_result . is_err ( ) { responder . send ( & mut Err ( fidl_fuchsia_settings :: Error :: Failed ) ) . ok ( ) ; return ; } let schedule_account_clear_result = request ( context . switchboard . clone ( ) , SettingType :: Account , SettingRequest :: ScheduleClearAccounts , " " , ) . await ; if schedule_account_clear_result . is_err ( ) { responder . send ( & mut Err ( fidl_fuchsia_settings :: Error :: Failed ) ) . ok ( ) ; return ; } let restart_result = request ( context . switchboard . clone ( ) , SettingType :: Power , SettingRequest :: Reboot , " " , ) . await ; if restart_result . is_err ( ) { responder . send ( & mut Err ( fidl_fuchsia_settings :: Error :: Failed ) ) . ok ( ) ; return ; } responder . send ( & mut Ok ( ( ) ) ) . ok ( ) ; } ) ; }
Sets the login mode and schedules accounts to be cleared.
Sets the login mode and schedules accounts to be cleared .
context
RequestContext<SystemSettings, SystemWatchResponder>
mode
SystemLoginOverrideMode
responder
SystemSetResponder