nisargjhaveri / AAWirelessGateway

11 stars 1 forks source link

Compability as Android Auto App #3

Open AbhishekMore-1 opened 2 weeks ago

AbhishekMore-1 commented 2 weeks ago

Can we make this app Android Auto Compatible ? Usecase: Use old phone's android auto as usual. Whenever I need to connect wirelessly from other phone, I will connect it from Android Auto without touching old phone. I will pair new device, connect with existing device and control gateway settings from Android Auto Screen.

nisargjhaveri commented 2 weeks ago

The "Fallback to USB Android Auto" does something similar. If a wireless connection is not made, it'd fallback to the phone's own Android Auto. Maybe that can help?

AbhishekMore-1 commented 2 weeks ago

No, if once it starts its wired andriod auto connection then I can't connect wireless android auto. Either this is happeng due to android auto taking control of usb and not allowing aagateway to control it or aagateway is failing to connect with master phone wirelessly. One observation, if I reconnect usb and try to connect then it get paired easily but if wireless phone got disconnected from wired phone for long period and then try to connect, it fails

nisargjhaveri commented 2 weeks ago

For this to happen, you need to make multiple changes. You need to keep the bluetooth advertisement and TCP server running. And when phone connects, you somehow need to reset usb to restart the connection. There are no public apis in Android for that, but I remember seeing some private apis which might be useful.

AbhishekMore-1 commented 2 weeks ago

We can do the same thing differently, let aagateway only control usb (same as of now) but if there is no wireless connection then fallback to read stream from android auto headunit server (can make it up by using android auto developer mode). Now aagateway have control on what is being sent to physical head unit and whenever it successfully pair with wireless device then it can read stream from wireless device. Also, if we make this app android auto compatible then we can operate this app from physical head unit and there we can give option to start Bluetooth advertisement and TCP server, so we can connect to it even after long time after disconnection