[Android Auto General] candiesdoodle:
Hello

Background

I have a OnePlus 3 since Nov 2016. The phone is awesome. But doesnt play well with Android auto when using with custom roms. Atleast on my car, a Mahindra XUV 500.

In the initial few months, there was an issue with stock rom too, but OnePlus solved it and the stock rom works brilliantly with Android Auto.

What is the problem?

On custom roms - every time i connect my phone using the stock OEM cable to my car, android auto is detected and the headunit displays the interface. This lasts for a few seconds to a few minutes and Android Auto disconnects.It re initiates and the interface displays once again, only to disconnect once again. This goes on and on in an endless loop.

On stock rom - no problems. It stays on rock solid.

What have I explored so far

I have tried to triangulate the issue using circumstantial evidence. But there is nothing that consistently triggers this issue. I have tried:

- changing Roms [have tried 8-10 roms, all have this exact issue]

- changing cables [stock, aftermarket, et al. no luck]

- allowing all wakelocks in custom kernels

- disabling USB fast charge

- disabling charging all together

- enabling disabling various usb modes - debugging, mtp, ptp etc.

- upgrading/ downgrading Google play services and other google apps

- various quirky tweaks - with sim, without sim, display always on, etc etc.

There is no trend noticed whatsover

What works?

The only time the connection is stable is when there is activity happening on the screen. Which means, if there is active navigation through maps or music is playing or notifications are flowing. This is the only time when android auto does not disconnect.

My Theories

My conclusion is that there either some form of communication that is happening which keeps the connection going or there is some wakelock that is preventing the connecting from disconnecting.

It could also be something to do with the charging current. Stock rom usually forces the permissible limits but custom kernels push the limit on the amperage. But note that disabling USB fastcharge has no impact. So it could even be the normal USB current as included in the kernel.

Proposition

I am willing to offer a bounty to any developer who could help me by pin pointing the commits that are required to make custom roms/ kernels work. I am very confident this is possible because stock rom already has made it work long back.

Since the demand for android auto on custom roms is quite low, i dont find too many users talking about this. But i use AA extensively - couple of hours each way on my commute and i want to stick with custom roms. Hence this request and offer.

My initial offer is for USD 50 to whoever can help do it first.

Resources

the oneplus commit that they claim made AA work back in the days of N:

https://github.com/OnePlusOSS/andro...mmit/33a109bb360e89182a0db0b00e0650b1b915f4a2

look for the description that says "usb: change product name to OnePlus for Android Auto". After this the stock rom has been rock solid. Also note that this change did not find its way into the Oreo source code. No clue why. This only points to the fact the problem is elsewhere.

Example custom rom source, for reference, which doesnt work:

https://xdaforums.com/oneplus-3/oneplus-3--3t-cross-device-development/rom-nitrogen-os-beta-t3737654

https://github.com/nitrogen-project/android_kernel_oneplus_msm8996

PS: I hope this finds some takers. Really hoping!!

Will try to post a video later today.

Cheers!