Skip to content

Commit 721fa3e

Browse files
jamesarichCopilot
andcommitted
refactor: remove ServiceBroadcasts + CommonParcelable infrastructure
Remove the entire ATAK broadcast intent and CommonParcelable infrastructure, as TAK integration now uses the built-in TAK server. Deleted files: - Parcelable expect/actual declarations (common, android, jvm) - ServiceBroadcasts interface and Android implementation - Constants.kt broadcast action constants - ServiceBroadcastsTest.kt Model changes: - Strip @CommonParcelize/@CommonParcelable from MeshUser, Position, DeviceMetrics, EnvironmentMetrics, MessageStatus, DataPacket - Remove ByteStringParceler and CommonTypeParceler annotations - Delete NodeInfo data class (zero external callers) - Remove NodeEntity.toNodeInfo() conversion method - Remove iOS CommonParcelable stubs from NoopStubs.kt Data layer: - Remove serviceBroadcasts constructor param from 8 manager classes - Remove withBroadcast parameter from NodeManager.updateNode/installNodeInfo - Simplify handleDataPacket/handleSpecializedDataPacket to Unit return - Remove dead MeshService.actionReceived() companion function Infrastructure: - Remove NoopServiceBroadcasts from desktop stub and DI - Remove kotlin.parcelize plugin from core:common and core:model - Clean up all test mocks and verify calls Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e167b58 commit 721fa3e

81 files changed

Lines changed: 141 additions & 2473 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agent_memory/session_context.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
# Do NOT edit or remove previous entries — stale state claims cause agent confusion.
44
# Format: ## YYYY-MM-DD — <summary>
55

6+
## 2026-05-23 — Removed deprecated AIDL/API surface and switched Android to direct service control
7+
- Removed the entire `:core:api` module (AIDL files, published API build config, and module docs) and all build wiring to it (`settings.gradle.kts`, root convention module lists, CI publish/check workflows, `jitpack.yml`).
8+
- Re-architected Android service interaction away from binder binding:
9+
- Deleted `MeshServiceClient`, generic `ServiceClient`, AIDL fake/contract test harness, and AIDL exception wrapper utility.
10+
- Simplified `MeshService` into started-only foreground service (`onBind` now returns null) while preserving orchestrator lifecycle, notification updates, and wake-lock behavior.
11+
- Kept Android-specific `AndroidRadioControllerImpl` as a thin extension of `DirectRadioControllerImpl` that still restarts `MeshService` after `setDeviceAddress(...)` to preserve address-change behavior.
12+
- Removed `core:service` dependency on `projects.core.api`; inlined intent/broadcast constants directly in `core/service/Constants.kt` to preserve action/extra string compatibility without the API module.
13+
- Hardened app manifest by making `MeshService` non-exported and removing the external service intent-filter action.
14+
- Updated app startup behavior: `MainActivity` now starts `MeshService` in `onStart()` directly instead of creating a binder client.
15+
- Cleaned active documentation/instructions to remove `core:api`/AIDL references (`README.md`, `core/service/README.md`, `core/model/README.md`, `.github/copilot-instructions.md`, `.skills/project-overview/SKILL.md`, `.skills/testing-ci/SKILL.md`, `codecov.yml`).
16+
- Validation run succeeded with full baseline command:
17+
`./gradlew spotlessApply spotlessCheck detekt assembleDebug test allTests -Pci=true --continue`
18+
619
## 2026-05-21 — Upgraded Chirpy to a fully-personalized Live Diagnostic Node & Mesh Assistant
720
- Integrated `NodeRepository` into `GeminiNanoDocAssistant.kt` and the Google AI Koin dependency injection module (`GoogleAiModule.kt`).
821
- Developed a dynamic live-state prompt formatting block within `buildPrompt(...)` that queries current hardware model, firmware version, connection status, GPS capability, channel utilization, airtime, battery level/voltage, user profile long/short names, and total registered mesh peer counts & active online peers directly from `NodeRepository`'s reactive flows.

.github/copilot-instructions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ git submodule update --init
3333

3434
KMP modules have different task names than pure-Android modules. Using the wrong name silently skips tests or fails resolution.
3535

36-
| Intent | KMP modules (`core:*`, `feature:*`) | Android-only (`app`, `core:api`, `core:barcode`) |
36+
| Intent | KMP modules (`core:*`, `feature:*`) | Android-only (`app`, `core:barcode`) |
3737
|--------|--------------------------------------|--------------------------------------------------|
3838
| Run tests | `:module:allTests` | `:module:testFdroidDebugUnitTest` |
3939
| Detekt | `:module:detekt` (lifecycle task) | `:module:detekt` |
@@ -56,4 +56,3 @@ KMP modules have different task names than pure-Android modules. Using the wrong
5656
For additional context about technologies to be used, project structure,
5757
shell commands, and other important information, read the current plan
5858
<!-- SPECKIT END -->
59-

.skills/project-overview/SKILL.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Module directory, namespacing conventions, environment setup, and troubleshootin
55

66
- **Build System:** Gradle (Kotlin DSL). JDK 21 REQUIRED. Target SDK: API 36. Min SDK: API 26.
77
- **Flavors:** `fdroid` (OSS only) · `google` (Maps + DataDog analytics)
8-
- **Android-only Modules:** `core:api` (AIDL), `core:barcode` (CameraX). Shared contracts abstracted into `core:ui/commonMain`.
8+
- **Android-only Modules:** `core:barcode` (CameraX). Shared contracts abstracted into `core:ui/commonMain`.
99

1010
## Codebase Map
1111

@@ -28,7 +28,6 @@ Module directory, namespacing conventions, environment setup, and troubleshootin
2828
| `core:navigation` | Shared navigation keys/routes for Navigation 3 using `@Serializable sealed interface` hierarchies. `DeepLinkRouter` for typed backstack synthesis, and `MeshtasticNavSavedStateConfig` with `subclassesOfSealed()` for automatic polymorphic backstack persistence. |
2929
| `core:ui` | Shared Compose UI components (`MeshtasticAppShell`, `MeshtasticNavDisplay`, `MeshtasticNavigationSuite`, `AlertHost`, `SharedDialogs`, `PlaceholderScreen`, `MainAppBar`, dialogs, preferences) and platform abstractions. |
3030
| `core:service` | KMP service layer; Android bindings stay in `androidMain`. |
31-
| `core:api` | Public AIDL/API integration module for external clients. |
3231
| `core:prefs` | KMP preferences layer built on DataStore abstractions. |
3332
| `core:barcode` | Barcode scanning (Android-only). |
3433
| `core:nfc` | NFC abstractions (KMP). Android NFC hardware implementation in `androidMain`. |

.skills/testing-ci/SKILL.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Run in a single invocation for routine changes to ensure code formatting, analys
1717
> In KMP modules, the `test` task name is **ambiguous**. Gradle matches both `testAndroid` and
1818
> `testAndroidHostTest` and refuses to run either, silently skipping KMP modules.
1919
> `allTests` is the `KotlinTestReport` lifecycle task registered by the KMP plugin.
20-
> Conversely, `allTests` does **not** cover pure-Android modules (`:androidApp`, `:core:api`, etc.), which is why both `test` and `allTests` are needed.
20+
> Conversely, `allTests` does **not** cover pure-Android modules (`:androidApp`, `:core:barcode`, etc.), which is why both `test` and `allTests` are needed.
2121
2222
*Note: If testing Compose UI on the JVM (Robolectric) with Java 21, pin tests to `@Config(sdk = [34])` to avoid SDK 35 compatibility crashes.*
2323

@@ -104,4 +104,3 @@ CI is defined in `.github/workflows/reusable-check.yml` and structured as four p
104104
- **Cache writes:** Trusted on `main` and merge queue runs; other refs use read-only cache.
105105
- **Path filtering:** `check-changes` in `pull-request.yml` must include module dirs plus build/workflow entrypoints (`build-logic/**`, `gradle/**`, `.github/workflows/**`, `gradlew`, `settings.gradle.kts`, etc.).
106106
- **AboutLibraries:** Runs in `offlineMode` by default (no GitHub/SPDX API calls). Release builds pass `-PaboutLibraries.release=true` via Fastlane/Gradle CLI to enable remote license fetching. Do NOT re-gate on `CI` or `GITHUB_TOKEN` alone.
107-

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ Each module has its own README with details on its responsibilities, API surface
8787

8888
| Module | Description |
8989
|---|---|
90-
| [core/api](core/api/README.md) | AIDL service API for third-party integrations |
9190
| [core/domain](core/domain/README.md) | Business-logic use cases (radio config, sessions, exports) |
9291
| [core/repository](core/repository/README.md) | Data & infrastructure contracts (RadioTransport, NodeRepository, ServiceRepository) |
9392
| [core/takserver](core/takserver/README.md) | Meshtastic ↔ TAK (ATAK/iTAK) bridge — CoT server & conversion |
@@ -123,13 +122,9 @@ Each module has its own README with details on its responsibilities, API surface
123122

124123
You can help translate the app into your native language using [Crowdin](https://crowdin.meshtastic.org/android).
125124

126-
## API & Integration
125+
## Integration
127126

128-
Developers can integrate with the Meshtastic Android app using our published API library via **JitPack**. This allows third-party applications (like the ATAK plugin) to communicate with the mesh service via AIDL.
129-
130-
For detailed integration instructions, see [core/api/README.md](core/api/README.md).
131-
132-
Additionally, the app includes a built-in **Local TAK Server** feature that can be enabled in settings. This runs a local TCP server on port 8089 to allow ATAK clients to connect directly and route their traffic over the mesh.
127+
The app includes a built-in **Local TAK Server** feature that can be enabled in settings. This runs a local TCP server on port 8089 to allow ATAK clients to connect directly and route their traffic over the mesh.
133128

134129
## Building the Android App
135130
> [!WARNING]

androidApp/src/main/AndroidManifest.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,12 @@
161161
android:name="google_analytics_default_allow_analytics_storage"
162162
android:value="false" />
163163

164-
<!-- This is the public API for doing mesh radio operations from android apps -->
164+
<!-- In-app mesh foreground service -->
165165
<service
166166
android:name="org.meshtastic.core.service.MeshService"
167167
android:enabled="true"
168168
android:foregroundServiceType="connectedDevice|location"
169-
android:exported="true" tools:ignore="ExportedActivity">
170-
<intent-filter>
171-
<action android:name="com.geeksville.mesh.Service" />
172-
</intent-filter>
173-
</service>
169+
android:exported="false" />
174170

175171
<service
176172
android:name="androidx.appcompat.app.AppLocalesMetadataHolderService"

androidApp/src/main/kotlin/org/meshtastic/app/MainActivity.kt

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ import org.meshtastic.core.network.repository.UsbRepository
6363
import org.meshtastic.core.nfc.NfcScannerEffect
6464
import org.meshtastic.core.resources.Res
6565
import org.meshtastic.core.resources.channel_invalid
66-
import org.meshtastic.core.service.MeshServiceClient
66+
import org.meshtastic.core.service.MeshService
67+
import org.meshtastic.core.service.startService
6768
import org.meshtastic.core.ui.theme.AppTheme
6869
import org.meshtastic.core.ui.theme.MODE_DYNAMIC
6970
import org.meshtastic.core.ui.util.LocalAnalyticsIntroProvider
@@ -95,18 +96,9 @@ class MainActivity : AppCompatActivity() {
9596

9697
private val usbRepository: UsbRepository by inject()
9798

98-
/**
99-
* Activity-lifecycle-aware client that binds to the mesh service. Note: This is used implicitly as it registers
100-
* itself as a LifecycleObserver in its init block.
101-
*/
102-
internal val meshServiceClient: MeshServiceClient by inject { parametersOf(this) }
103-
10499
override fun onCreate(savedInstanceState: Bundle?) {
105100
installSplashScreen()
106101

107-
// Eagerly evaluate lazy Koin dependency so it registers its LifecycleObserver
108-
meshServiceClient.hashCode()
109-
110102
super.onCreate(savedInstanceState)
111103

112104
enableEdgeToEdge()
@@ -168,6 +160,11 @@ class MainActivity : AppCompatActivity() {
168160
handleIntent(intent)
169161
}
170162

163+
override fun onStart() {
164+
super.onStart()
165+
MeshService.startService(this)
166+
}
167+
171168
override fun onResume() {
172169
super.onResume()
173170
// Belt-and-suspenders for the Android 12+ attach-intent quirk: if the activity is

build-logic/convention/src/main/kotlin/RootConventionPlugin.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ private val DEVICE_TEST_MODULES = listOf(":core:database", ":core:model")
8181
private val ALL_MODULES_FULL =
8282
listOf(
8383
":androidApp",
84-
":core:api",
8584
":core:barcode",
8685
":core:ble",
8786
":core:common",
@@ -115,7 +114,7 @@ private val ALL_MODULES_FULL =
115114
)
116115

117116
/** Android-only modules that don't apply the KMP plugin. */
118-
private val ANDROID_ONLY_MODULES = setOf(":androidApp", ":core:api", ":core:barcode", ":feature:widget")
117+
private val ANDROID_ONLY_MODULES = setOf(":androidApp", ":core:barcode", ":feature:widget")
119118

120119
/**
121120
* Modules excluded from Dokka aggregation. :core:proto contains only auto-generated Wire classes (no KDoc value) and
@@ -128,6 +127,6 @@ private fun allModules(): List<String> = ALL_MODULES_FULL
128127

129128
/**
130129
* Modules that apply the KMP plugin and should be compiled for JVM + iOS targets. Excludes pure-Android modules
131-
* (:androidApp, :core:api, :core:barcode, :feature:widget) and the desktop JVM-only module.
130+
* (:androidApp, :core:barcode, :feature:widget) and the desktop JVM-only module.
132131
*/
133132
private fun kmpModules(): List<String> = allModules().filter { it !in ANDROID_ONLY_MODULES + ":desktopApp" }

codecov.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ component_management:
6161
ignore:
6262
- "**/build/**"
6363
- "**/*.pb.kt" # Generated Protobuf code
64-
- "**/*.aidl" # AIDL interface files
65-
- "**/aidl/**" # Generated AIDL code
6664
- "core/resources/**" # Centralized resources
6765
- "**/test/**" # Unit tests
6866
- "**/androidTest/**" # Instrumented tests

core/api/README.md

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)