Skip to content

RegisterAppInterfaceResponse failures not handled #1872

@joeygrover

Description

@joeygrover

Bug Summary

The current library does not handle RAI responses failures. It has an assumption that all responses for the RAI request will be successful. This leads to strange states where the library is still connected at a transport and protocol level but nothing for RPCs. Future transport connection events won't be recognized either because the app's SdlService won't close.

The observed failure was difficult to reproduce but is clear why a failure of this type would cause the library to be in a bad state.

Reproduction Steps

  1. Connect phone over BT and allow SDL to connect
  2. Observe SDL apps registered on IVI
  3. Connect USB, select SDL app to handle USB device
  4. Observe USB transport is connected
  5. Disconnect BT

Expected Behavior:
Apps that don't need audio will reconnect over USB.

Observed Behavior:
Intermittent failures where the app would not register due to different reasons including: DUPLICATE_NAME

Which projects have you seen this bug on?

No response

Android Version(s)

14.0.0

Android Device(s)

Pixel 5a

sdl_java_suite Version

5.x.0 (develop)

Testing Environment(s)

Ford TDK

Relevant log output

2023-11-28 11:36:27.525 16662-16662 SdlTransportBroker      com.sdl.hellosdlandroid              I  5.6.1: Hardware disconnected
2023-11-28 11:36:27.525 16662-16662 TransportManager        com.sdl.hellosdlandroid              I  5.6.1: Transport disconnected - Transport Type: BLUETOOTH Address: 50:65:83:39:BB:15
2023-11-28 11:36:27.525 16662-16662 SdlProtocol             com.sdl.hellosdlandroid              I  5.6.1: onTransportDisconnected - BLUETOOTH
2023-11-28 11:36:27.525 16662-16662 SdlProtocol             com.sdl.hellosdlandroid              I  5.6.1: Checking USB
2023-11-28 11:36:27.525 16662-16662 SdlTransportBroker      com.sdl.hellosdlandroid              I  5.6.1: Stopping transport broker for com.sdl.android.8678309.11330020
2023-11-28 11:36:27.525 16662-16662 SdlTransportBroker      com.sdl.hellosdlandroid              I  5.6.1: Attempting to unregister with Sdl Router Service
2023-11-28 11:36:27.535 16662-16662 Lifecycle Manager       com.sdl.hellosdlandroid              I  5.6.1: notifying RPC session ended, but potential primary transport available
2023-11-28 11:36:27.535 16662-16662 Lifecycle Manager       com.sdl.hellosdlandroid              I  5.6.1: Requesting to unregister from device
2023-11-28 11:36:27.536 16662-16662 RSVP                    com.sdl.hellosdlandroid              I  5.6.1: Supplied service name of com.sdl.hellosdlandroid.SdlRouterService
2023-11-28 11:36:27.536 16662-16662 TransportManager        com.sdl.hellosdlandroid              I  5.6.1: onFinishedValidation valid=true; name=com.sdl.hellosdlandroid
2023-11-28 11:36:27.538 16662-16662 TransportManager        com.sdl.hellosdlandroid              I  5.6.1: TransportManager start was called; transport=com.smartdevicelink.transport.TransportManager$TransportBrokerImpl@c468961
2023-11-28 11:36:27.539 16662-16662 SdlTransportBroker      com.sdl.hellosdlandroid              I  5.6.1: Sending bind request to com.sdl.hellosdlandroid - com.sdl.hellosdlandroid.SdlRouterService
2023-11-28 11:36:27.544 16662-16662 SdlTransportBroker      com.sdl.hellosdlandroid              I  5.6.1: Bound to service ComponentInfo{com.sdl.hellosdlandroid/com.sdl.hellosdlandroid.SdlRouterService}
2023-11-28 11:36:27.568 16662-16662 TransportManager        com.sdl.hellosdlandroid              I  5.6.1: OnHardwareConnected
2023-11-28 11:36:27.568 16662-16662 SdlProtocol             com.sdl.hellosdlandroid              I  5.6.1: onTransportConnected
2023-11-28 11:36:27.568 16662-16662 SdlProtocol             com.sdl.hellosdlandroid              I  5.6.1: Active transports --- 
2023-11-28 11:36:27.581 16662-16662 SdlSession              com.sdl.hellosdlandroid              I  5.6.1: RPC service started
2023-11-28 11:36:27.581 16662-16662 Lifecycle Manager       com.sdl.hellosdlandroid              I  5.6.1: on protocol session started
2023-11-28 11:36:27.604 16662-16662 RpcConverter            com.sdl.hellosdlandroid              I  5.6.1: name  -  RegisterAppInterface
2023-11-28 11:36:27.604 16662-16662 RpcConverter            com.sdl.hellosdlandroid              I  5.6.1: parameters  -  {resultCode=DUPLICATE_NAME, success=false}
2023-11-28 11:36:27.604 16662-16662 RpcConverter            com.sdl.hellosdlandroid              I  5.6.1: correlationID  -  65529
2023-11-28 11:36:27.604 16662-16662 RpcConverter            com.sdl.hellosdlandroid              I  5.6.1:  Attempting to create com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse
2023-11-28 11:36:27.605 16662-16662 Lifecycle Manager       com.sdl.hellosdlandroid              I  5.6.1: RPC received - response
2023-11-28 11:36:27.605 16662-16662 Lifecycle Manager       com.sdl.hellosdlandroid              I  5.6.1: RAI Response
2023-11-28 11:36:27.605 16662-16662 Lifecycle Manager       com.sdl.hellosdlandroid              I  5.6.1: on protocol session ended

Metadata

Metadata

Assignees

Labels

bugA defect in the library

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions