I can understand your frustration with the issue. To detect if the Android device is running GrapheneOS programmatically in Kotlin, you can try checking the "ro.build.version.release" system property. GrapheneOS usually includes the term "GrapheneOS" in the build version release.
Here's a Kotlin function that checks for GrapheneOS:
fun isGrapheneOS(): Boolean { val buildVersion = System.getProperty("ro.build.version.release") return buildVersion.contains("GrapheneOS", ignoreCase = true) }
You can use this function to conditionally handle the AndroidAuto APIs based on whether the device is running GrapheneOS or not.
Please note that relying solely on the build version release might not be completely foolproof as manufacturers can customize this information. However, it can be a good starting point to identify GrapheneOS in most cases.
I hope this helps you resolve the issue. Good luck! 🍀