@@ -256,7 +256,7 @@ impl DiscoveryServer for DiscoveryImpl {
256256 DiscoveryImpl :: get_content_policy ( & ctx, & self . state , & ctx. app_id ) . await
257257 }
258258
259- async fn launch ( & self , ctx : CallContext , request : LaunchRequest ) -> RpcResult < bool > {
259+ async fn launch ( & self , _ctx : CallContext , request : LaunchRequest ) -> RpcResult < bool > {
260260 let app_defaults_configuration = self . state . get_device_manifest ( ) . applications . defaults ;
261261
262262 let intent_validation_config = self
@@ -265,11 +265,6 @@ impl DiscoveryServer for DiscoveryImpl {
265265 . get_features ( )
266266 . intent_validation ;
267267 validate_navigation_intent ( intent_validation_config, request. intent . clone ( ) ) . await ?;
268- let req_updated_source = update_intent ( ctx. app_id . clone ( ) , request. clone ( ) ) ;
269- info ! (
270- "Discovery.launch: req_updated_source: {:?}" ,
271- & req_updated_source
272- ) ;
273268
274269 if let Some ( reserved_app_id) =
275270 app_defaults_configuration. get_reserved_application_id ( & request. app_id )
@@ -287,7 +282,7 @@ impl DiscoveryServer for DiscoveryImpl {
287282 match BrokerUtils :: process_internal_main_request (
288283 & self . state . clone ( ) ,
289284 "discovery.launch.internal" ,
290- Some ( serde_json:: to_value ( req_updated_source ) . map_err ( |e| {
285+ Some ( serde_json:: to_value ( request ) . map_err ( |e| {
291286 error ! ( "Serialization error: {:?}" , e) ;
292287 rpc_err ( "Failed to serialize SectionIntent" )
293288 } ) ?) ,
@@ -303,47 +298,7 @@ impl DiscoveryServer for DiscoveryImpl {
303298 return Err ( rpc_err ( "Internal subscription launch failed" ) ) ;
304299 }
305300 }
306-
307- // Not validating the intent, pass-through to app as is.
308- // if !AppEvents::is_app_registered_for_event(
309- // &self.state,
310- // reserved_app_id.to_string(),
311- // DISCOVERY_EVENT_ON_NAVIGATE_TO,
312- // ) {
313- // return Err(rpc_navigate_reserved_app_err(
314- // format!("Discovery.launch: reserved app id {} is not registered for discovery.onNavigateTo event",
315- // reserved_app_id).as_str(),
316- // ));
317- // }
318- // emit EVENT_ON_NAVIGATE_TO to the reserved app.
319- // AppEvents::emit_to_app(
320- // &self.state,
321- // reserved_app_id.to_string(),
322- // DISCOVERY_EVENT_ON_NAVIGATE_TO,
323- // &serde_json::to_value(req_updated_source.intent).unwrap(),
324- // )
325- // .await;
326- // info!(
327- // "emit_to_app called for app {} event {}",
328- // reserved_app_id.to_string(),
329- // DISCOVERY_EVENT_ON_NAVIGATE_TO
330- // );
331- // return Ok(true);
332301 }
333- // let (app_resp_tx, app_resp_rx) = oneshot::channel::<AppResponse>();
334-
335- // let app_request =
336- // AppRequest::new(AppMethod::Launch(req_updated_source.clone()), app_resp_tx);
337-
338- // if self
339- // .state
340- // .get_client()
341- // .send_app_request(app_request)
342- // .is_ok()
343- // && app_resp_rx.await.is_ok()
344- // {
345- // return Ok(true);
346- // }
347302
348303 Err ( jsonrpsee:: core:: Error :: Custom ( String :: from (
349304 "Discovery.launch: some failure" ,
@@ -521,69 +476,70 @@ impl DiscoveryServer for DiscoveryImpl {
521476 Ok ( true )
522477 }
523478}
524- fn update_intent ( source : String , request : LaunchRequest ) -> LaunchRequest {
525- match request. intent . clone ( ) {
526- Some ( NavigationIntent :: NavigationIntentStrict ( navigation_intent) ) => {
527- let updated_navigation_intent = match navigation_intent {
528- NavigationIntentStrict :: Home ( mut home_intent) => {
529- home_intent. context . source = source;
530- NavigationIntentStrict :: Home ( home_intent)
531- }
532- NavigationIntentStrict :: Launch ( mut launch_intent) => {
533- launch_intent. context . source = source;
534- NavigationIntentStrict :: Launch ( launch_intent)
535- }
536- NavigationIntentStrict :: Entity ( mut entity_intent) => {
537- entity_intent. context . source = source;
538- NavigationIntentStrict :: Entity ( entity_intent)
539- }
540- NavigationIntentStrict :: Playback ( mut playback_intent) => {
541- playback_intent. context . source = source;
542- NavigationIntentStrict :: Playback ( playback_intent)
543- }
544- NavigationIntentStrict :: Search ( mut search_intent) => {
545- search_intent. context . source = source;
546- NavigationIntentStrict :: Search ( search_intent)
547- }
548- NavigationIntentStrict :: Section ( mut section_intent) => {
549- section_intent. context . source = source;
550- NavigationIntentStrict :: Section ( section_intent)
551- }
552- NavigationIntentStrict :: Tune ( mut tune_intent) => {
553- tune_intent. context . source = source;
554- NavigationIntentStrict :: Tune ( tune_intent)
555- }
556- NavigationIntentStrict :: ProviderRequest ( mut provider_request_intent) => {
557- provider_request_intent. context . source = source;
558- NavigationIntentStrict :: ProviderRequest ( provider_request_intent)
559- }
560- NavigationIntentStrict :: PlayEntity ( mut p) => {
561- p. context . source = source;
562- NavigationIntentStrict :: PlayEntity ( p)
563- }
564- NavigationIntentStrict :: PlayQuery ( mut p) => {
565- p. context . source = source;
566- NavigationIntentStrict :: PlayQuery ( p)
567- }
568- } ;
569479
570- LaunchRequest {
571- app_id : request. app_id ,
572- intent : Some ( NavigationIntent :: NavigationIntentStrict (
573- updated_navigation_intent,
574- ) ) ,
575- }
576- }
577- Some ( NavigationIntent :: NavigationIntentLoose ( mut loose_intent) ) => {
578- loose_intent. context . source = source;
579- LaunchRequest {
580- app_id : request. app_id ,
581- intent : Some ( NavigationIntent :: NavigationIntentLoose ( loose_intent) ) ,
582- }
583- }
584- _ => request,
585- }
586- }
480+ // fn update_intent(source: String, request: LaunchRequest) -> LaunchRequest {
481+ // match request.intent.clone() {
482+ // Some(NavigationIntent::NavigationIntentStrict(navigation_intent)) => {
483+ // let updated_navigation_intent = match navigation_intent {
484+ // NavigationIntentStrict::Home(mut home_intent) => {
485+ // home_intent.context.source = source;
486+ // NavigationIntentStrict::Home(home_intent)
487+ // }
488+ // NavigationIntentStrict::Launch(mut launch_intent) => {
489+ // launch_intent.context.source = source;
490+ // NavigationIntentStrict::Launch(launch_intent)
491+ // }
492+ // NavigationIntentStrict::Entity(mut entity_intent) => {
493+ // entity_intent.context.source = source;
494+ // NavigationIntentStrict::Entity(entity_intent)
495+ // }
496+ // NavigationIntentStrict::Playback(mut playback_intent) => {
497+ // playback_intent.context.source = source;
498+ // NavigationIntentStrict::Playback(playback_intent)
499+ // }
500+ // NavigationIntentStrict::Search(mut search_intent) => {
501+ // search_intent.context.source = source;
502+ // NavigationIntentStrict::Search(search_intent)
503+ // }
504+ // NavigationIntentStrict::Section(mut section_intent) => {
505+ // section_intent.context.source = source;
506+ // NavigationIntentStrict::Section(section_intent)
507+ // }
508+ // NavigationIntentStrict::Tune(mut tune_intent) => {
509+ // tune_intent.context.source = source;
510+ // NavigationIntentStrict::Tune(tune_intent)
511+ // }
512+ // NavigationIntentStrict::ProviderRequest(mut provider_request_intent) => {
513+ // provider_request_intent.context.source = source;
514+ // NavigationIntentStrict::ProviderRequest(provider_request_intent)
515+ // }
516+ // NavigationIntentStrict::PlayEntity(mut p) => {
517+ // p.context.source = source;
518+ // NavigationIntentStrict::PlayEntity(p)
519+ // }
520+ // NavigationIntentStrict::PlayQuery(mut p) => {
521+ // p.context.source = source;
522+ // NavigationIntentStrict::PlayQuery(p)
523+ // }
524+ // };
525+
526+ // LaunchRequest {
527+ // app_id: request.app_id,
528+ // intent: Some(NavigationIntent::NavigationIntentStrict(
529+ // updated_navigation_intent,
530+ // )),
531+ // }
532+ // }
533+ // Some(NavigationIntent::NavigationIntentLoose(mut loose_intent)) => {
534+ // loose_intent.context.source = source;
535+ // LaunchRequest {
536+ // app_id: request.app_id,
537+ // intent: Some(NavigationIntent::NavigationIntentLoose(loose_intent)),
538+ // }
539+ // }
540+ // _ => request,
541+ // }
542+ // }
587543
588544pub async fn validate_navigation_intent (
589545 intent_validation_config : IntentValidation ,
0 commit comments