From fe7e72a4218cf314f2ca106e83041d400f9b6a20 Mon Sep 17 00:00:00 2001 From: zjs81 Date: Sat, 24 Oct 2026 20:22:12 -0700 Subject: [PATCH] Make Android Auto an opt-in build flag Android Auto support is now merged into the app only when building with -PandroidAuto=true (flutter build apk --android-project-arg=androidAuto=true). The car application meta-data and automotive_app_desc.xml move to android/app/src/androidAuto/, so default builds no longer declare Android Auto. Notification replies from the shade and watches are unchanged. --- README.md | 6 +++--- android/app/build.gradle.kts | 18 ++++++++++++++++++ .../app/src/androidAuto/AndroidManifest.xml | 9 +++++++++ .../res/xml/automotive_app_desc.xml | 0 android/app/src/main/AndroidManifest.xml | 4 ---- documentation/notifications.md | 8 ++++++++ 6 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 android/app/src/androidAuto/AndroidManifest.xml rename android/app/src/{main => androidAuto}/res/xml/automotive_app_desc.xml (100%) diff --git a/README.md b/README.md index 92d60fe4..1ca9ba29 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ See the [user documentation](documentation/README.md), [connection guide](docume - **Contact Groups**: Create custom groups to organize your mesh network contacts - **Message Reactions**: React to messages with emoji responses - **Message Replies**: Thread conversations with inline reply functionality -- **Android Auto & Watches**: Hear messages and reply by voice in Android Auto, or reply from the notification shade and Wear OS/Galaxy watches ([guide](documentation/notifications.md#android-auto)) +- **Android Auto & Watches**: Reply from the notification shade and Wear OS/Galaxy watches, or hear messages and reply by voice in Android Auto (optional build flag) ([guide](documentation/notifications.md#android-auto)) - **Channel Muting**: Mute a channel from its chat screen, the channel list, or its notification ### Mesh Network @@ -103,7 +103,7 @@ See the [user documentation](documentation/README.md), [connection guide](docume | Map & Location | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | Device Management | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | Repeater Hub | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| Notification replies | ✅
(incl. Android Auto, watches) | ❌ | ❌ | ❌ | ❌ | ❌ | +| Notification replies | ✅
(incl. watches; Android Auto optional) | ❌ | ❌ | ❌ | ❌ | ❌ | The matrix describes implemented functionality, not a guarantee that every feature has been tested on every device. Web device connections use Web Serial and require Chrome and a secure origin. Image inference and translation require native runtimes and are unavailable on web. Android APKs currently include only `arm64-v8a`; the minimum Android API follows the Flutter SDK used to build. @@ -228,7 +228,7 @@ Messages are transmitted as binary frames using a custom protocol optimized for - **Theme**: System default, light, or dark mode - **Language**: Use one of 18 languages (English, Chinese, French, Spanish, Portuguese, German, Dutch, Polish, Swedish, Italian, Slovak, Slovenian, Bulgarian, Russian, Ukrainian, Hungarian, Japanese, Korean) -- **Notifications**: Configurable for messages, channels, and node advertisements; per-channel muting; reply, mark-as-read, and mute actions on Android notifications and watches (reply and mark-as-read in Android Auto) +- **Notifications**: Configurable for messages, channels, and node advertisements; per-channel muting; reply, mark-as-read, and mute actions on Android notifications and watches (reply and mark-as-read in Android Auto when built with `--android-project-arg=androidAuto=true`) - **Battery Chemistry**: Support for NMC, LiFePO4, LiPo, and LiPo HV battery types - **Message Retry**: Automatic retry with configurable path clearing diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 8aa73ce6..24b5883c 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -98,6 +98,24 @@ android { // } } +// Android Auto (notification read-aloud and voice reply) is opt-in, because +// declaring it puts the app through Play's separate Android Auto review. +// Enable it with `flutter build apk --android-project-arg=androidAuto=true` +// or `./gradlew -PandroidAuto=true ...`. +val androidAutoEnabled = (findProperty("androidAuto") as String?)?.toBoolean() == true + +if (androidAutoEnabled) { + android.sourceSets.getByName("main").res.srcDir("src/androidAuto/res") +} + +androidComponents { + onVariants { variant -> + if (androidAutoEnabled) { + variant.sources.manifests.addStaticManifestFile("src/androidAuto/AndroidManifest.xml") + } + } +} + flutter { source = "../.." } diff --git a/android/app/src/androidAuto/AndroidManifest.xml b/android/app/src/androidAuto/AndroidManifest.xml new file mode 100644 index 00000000..4c5db2aa --- /dev/null +++ b/android/app/src/androidAuto/AndroidManifest.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/android/app/src/main/res/xml/automotive_app_desc.xml b/android/app/src/androidAuto/res/xml/automotive_app_desc.xml similarity index 100% rename from android/app/src/main/res/xml/automotive_app_desc.xml rename to android/app/src/androidAuto/res/xml/automotive_app_desc.xml diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 3bb75c69..27d9692a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -34,10 +34,6 @@ - -