Modern Apps git

← Modern-Apps.git

communicate: merge communicate-wear into the single communicate APK

Commit
7bf40b65df3fd9c507bfad345b519dc319f6c625
Author
Vayun Mathur <[email protected]>
When
2026-12-04 18:37 UTC (1 day ago)
Parents
a592fd3
Owner directive: singular apps that detect when they are on a watch
and adapt, instead of a separate *-wear APK per companion. This
follows the merged clock pilot (adec0c398 + 31a81d3c5).

The merged :communicate APK keeps applicationId
com.vayunmathur.communicate and the convention signing on both form
factors, as the WearLink handshake requires; neither side's identity
changed. Runtime detection is PackageManager.FEATURE_WATCH
(ui/FormFactor): MainActivity, the sole launcher entry, forwards
watches to ui/WearMainActivity before any phone state (phone
WearCommunicateSync, deep links, PiP) is touched, and phones keep
the existing tab UI. The phone SmsDeliverReceiver and
MmsDeliverReceiver early-return on a watch, which has no default-SMS
role and receives its messages over WearLink.

Manifest shape, verified against AGP lint: no
android.hardware.type.watch uses-feature is declared. required=true
would block phone installs and required=false is disallowed for
this feature (InvalidWearFeatureAttribute; Google's packaging
model does not support a single Wear/non-Wear APK through Play).
Distribution here is sideload/F-Droid, not Play's watch channel,
so installation on a watch needs no feature declaration; the
standalone=false meta-data and the watch activity are carried into
the phone application element, with WearMainActivity
exported=false and no launcher filter of its own.

All communicate-wear sources move into communicate's closed
package roots (wear/data -> data, wear/sync -> sync, wear/ui ->
ui), R references retarget to com.vayunmathur.communicate.R, and
wear strings merge as res/values/wear_strings.xml (duplicate
app_name dropped). The watch unit test moves with them; the wear
WearCommunicateProtocolTest copy is dropped because :communicate
already pins the same golden JSON byte-identically. Watch
screenshot previews become ui/WearMetadataPreviews with
group=wear, and the listing PNGs move to
metadata_data/photos/communicate/wear/. The communicate-wear
module and its settings include are deleted; :communicate-dev is
untouched. Root and communicate AGENTS.md describe the merged
state, as does the WearCommunicateProtocol header.

The added test classes shifted the batched Robolectric sandboxes
(forkEvery=20) in :communicate:testDevUnitTest and exposed two
pre-existing batch-sensitive classes: Y2RepositoryRcsSendTest
(MMS send against fake providers) and Y1RegistrationScreensTest
(AndroidKeyStore via Room/SQLCipher) fail in a shared sandbox but
pass isolated on both the base and this tree, and the base full
suite is itself nondeterministic (a different unrelated failure,
then a pass on rerun). Following the module's documented
isolatedClasses pattern for exactly this fallout, both classes
now keep forkEvery=1 in the quarantine companion.

Verified on devvm21958 in this worktree:
./gradlew :communicate:lint :communicate:lintVitalRelease
:communicate:testDevUnitTest green (1003 tests across the AGP and
quarantine tasks, 0 failures). Only a real watch can confirm
install, FEATURE_WATCH routing, and the Wear OS launcher surface.

Diff

AGENTS.md
diff --git a/AGENTS.md b/AGENTS.mdindex eb9114d577..bfdd71792d 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -49,7 +49,7 @@ Monorepo: ~100 Gradle modules + Rust workspace. Do scoped work only. ### Apps (Gradle key → dir) Reference: `backup/` satisfies every rule; `notes/` second + `intents/` demo. `camera` + `games/voxels` hand-commit screenshots. Full canonical index (Gradle key → dir + group + notes): `.llms/repo-map.md`.-`clock`, `notes`, `calendar`, `launcher`, `todo`, `maps`, `camera`, `findfamily`, `contacts`, `appstore` and `weather` are single merged APKs for phone and watch (watch experience inside the phone app's module; the remaining `*-wear` modules are separate companion APKs with the phone app's applicationId/signing).+`clock`, `notes`, `calendar`, `launcher`, `todo`, `maps`, `camera`, `findfamily`, `contacts`, `appstore`, `weather` and `communicate` are single merged APKs for phone and watch (watch experience inside the phone app's module; the remaining `*-wear` modules are separate companion APKs with the phone app's applicationId/signing). `appstore→appstore/` `astronomy→astronomy/` `auto→auto/,auto/protocol/` `backup→backup/` `calculator→calculator/` `calendar→calendar/` `camera→camera/` `cast→cast/,cast/protocol/,cast/tv/` `clock→clock/` `code→code/` `communicate→communicate/` `contacts→contacts/` `education→education/` `email→email/` `emergency→emergency/` `euicc→euicc/` `everysync→everysync/` `files→files/` `findfamily→findfamily/` `findfamily-ios→apple/FindFamily/` (SwiftPM/xtool, not Gradle) `flashcards→flashcards/` `fooddelivery→fooddelivery/` `health→health/` `keyboard→keyboard/` `launcher→launcher/` `logviewer→logviewer/` `maps→maps/` `measure→measure/` `music→music/` `networklocation→networklocation/` `news→news/` `notes→notes/` `office→office/` `openassistant→openassistant/` `passwords→passwords/` `pdf→pdf/` `photos→photos/` `parentalcontrols→parentalcontrols/` `screentime→screentime/` `setupwizard→setupwizard/` `share→share/` `speech→speech/` `taxi→taxi/` `things→things/` `todo→todo/` `translate→translate/` `travel→travel/` `tuner→tuner/` `updater→updater/` `vpn→vpn/` `weather→weather/` `watch→watch/,watch-wear/` `web→web/` `youpipe→youpipe/,youpipe/extractor/` `games-hub→games/hub/` `games-arrows→games/arrows/` `games-chess→games/chess/` `games-logicgate→games/logicgate/` `games-minesweeper→games/minesweeper/` `games-nonogram→games/nonogram/` `games-pipes→games/pipes/` `games-solitaire→games/solitaire/` `games-sudoku→games/sudoku/` `games-unblockjam→games/unblockjam/` `games-voxels→games/voxels/` `games-wordmaker→games/wordmaker/` Slash == colon for Gradle (`games/voxels` == `games:voxels`). 
communicate-wear/AGENTS.md
diff --git a/communicate-wear/AGENTS.md b/communicate-wear/AGENTS.mddeleted file mode 100644index 7e7ef1a1eb..0000000000--- a/communicate-wear/AGENTS.md+++ /dev/null@@ -1,54 +0,0 @@-# AGENTS.md — communicate-wear/ (':communicate-wear')--> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside-> `communicate-wear/` + `communicate/` (the phone side of the same feature).--- Gradle: :communicate-wear / dir: communicate-wear/ (convention: `common-conventions-wear`)-- Package roots present: ui, data, domain, sync-- Entry file: ui/WearMainActivity.kt--## Why this module exists (read before changing identity)-Wear OS companion of the phone Communicate (`:communicate`). This module-deliberately uses `applicationId = "com.vayunmathur.communicate"` (the-phone app's) with the shared dev/release signing from the convention-plugins: WearLink's handshake token requires the same signing certificate-on both sides, so changing either breaks phone<->watch sync. Bootstrap is-a one-time ADB sideload of this APK onto the watch.--## Protocol-The wire protocol lives in `:library:wearlink` at-`com.vayunmathur.library.wearlink.communicate.WearCommunicateProtocol`-(shared by `:communicate` and `:communicate-wear`; neither app module-depends on the other). Each side's `WearCommunicateProtocolTest` pins-the same golden JSON against that shared code.--- Snapshot: WearLink data item (`/communicate/snapshot`, phone -> watch);-  watch state back (`/communicate/watch-state`)-- Thread pages: message request (`/communicate/request-thread`) ->-  message page (`/communicate/thread-page`), cached on the watch-- Alerts: messages (`/communicate/new-message`, `/communicate/incoming-call`)-- Watch ops: message (`/communicate/op`) + phone verdict-  (`/communicate/op-result`); ops stay pending until a success verdict-- Transport: :library:wearlink (RFCOMM, no Play services); app-lifecycle-bound--## Page mapping (mirrors the phone, stated in the protocol file too)-- Phone Messages -> watch conversation list (all merged lines)-- Phone Conversation -> watch thread view (paged, cached offline)-- Phone CallLogs -> watch call log (read-only)-- Phone voicemail -> watch voicemail indicators (no audio/URIs/headers)-- Omitted: Dialer, Accounts/registration, calling setup, Call screen,-  voicemail playback, media viewing, full settings, archive/mute (the-  phone UI offers neither), and answer-on-watch (no guaranteed watch-  audio route — decline only)--## Privacy-Disappearing-flagged content never crosses in body/snippet form (empty +-`contentExcluded` marker). E2EE plaintext is decrypted on the phone and-only capped text crosses the cert-bound link; no keys, serviceData, media-URLs or attachment bytes ever cross (media is a label only).--## Verify (this module only)-```-./gradlew :communicate-wear:assembleDev-./gradlew :communicate-wear:testDebugUnitTest-```
communicate-wear/build.gradle.kts
diff --git a/communicate-wear/build.gradle.kts b/communicate-wear/build.gradle.ktsdeleted file mode 100644index c6d3f30068..0000000000--- a/communicate-wear/build.gradle.kts+++ /dev/null@@ -1,40 +0,0 @@-plugins {-    id("common-conventions-wear")-    id("common-conventions-preview-metadata")-}--launcherIcon {-    symbol = "call"-}--// Version shared with the phone app (root version.txt), read directly because-// common-conventions-wear inlines 1/"1.0" until a wear consumer wires the shared reader.-val wearVersionLines = file("../version.txt").readLines()-val wearVersionCode = wearVersionLines[0].trim().toInt()-val wearVersionName = wearVersionLines[1].trim()--android {-    // The WearLink handshake only connects apps that share a package name and-    // signing certificate, so this module MUST ship as the phone app's package:-    // same applicationId (below) and the same signing config the convention-    // plugins already apply to both (debug key for dev, release key for-    // release). The namespace only names this module's own R/resources.-    namespace = "com.vayunmathur.communicate.wear"-    defaultConfig {-        applicationId = "com.vayunmathur.communicate"-        // Convention defaults to 30, but :library:log (pulled in by the wear-        // convention) requires 31, so the watch floor is 31.-        minSdk = 31-        versionCode = wearVersionCode-        versionName = wearVersionName-    }-}--dependencies {-    // Watch side of the Wear OS sync (see domain/WearCommunicateProtocol.kt, the-    // copy of the phone protocol it must stay in step with).-    implementation(libs.kotlinx.coroutines.android)-    implementation(project(":library:wearlink"))-    testImplementation(libs.kotlin.test)-    testImplementation(libs.kotlin.test.junit)-}
communicate-wear/src/main/AndroidManifest.xml
diff --git a/communicate-wear/src/main/AndroidManifest.xml b/communicate-wear/src/main/AndroidManifest.xmldeleted file mode 100644index 7ccb8c3001..0000000000--- a/communicate-wear/src/main/AndroidManifest.xml+++ /dev/null@@ -1,40 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<manifest xmlns:android="http://schemas.android.com/apk/res/android">--    <!-- Wear OS form factor. Declaring the watch hardware makes this build-         installable on Wear OS; the touchscreen is not required there. -->-    <uses-feature-        android:name="android.hardware.type.watch"-        android:required="true" />-    <uses-feature-        android:name="android.hardware.touchscreen"-        android:required="false" />--    <uses-permission android:name="android.permission.WAKE_LOCK" />--    <application-        android:allowBackup="false"-        android:icon="@mipmap/ic_launcher"-        android:label="@string/app_name"-        android:roundIcon="@mipmap/ic_launcher"-        android:supportsRtl="true"-        android:theme="@android:style/Theme.Material.NoActionBar">--        <!-- Paired with the phone app, not a standalone watch app. -->-        <meta-data-            android:name="com.google.android.wearable.standalone"-            android:value="false" />--        <activity-            android:name=".ui.WearMainActivity"-            android:exported="true"-            android:taskAffinity="">-            <intent-filter>-                <action android:name="android.intent.action.MAIN" />-                <category android:name="android.intent.category.LAUNCHER" />-            </intent-filter>-        </activity>--        <!-- WearLink delivery is app-lifecycle-bound; no system listener service. -->-    </application>-</manifest>
communicate-wear/src/main/res/values/colors.xml
diff --git a/communicate-wear/src/main/res/values/colors.xml b/communicate-wear/src/main/res/values/colors.xmldeleted file mode 100644index bfc7025d71..0000000000--- a/communicate-wear/src/main/res/values/colors.xml+++ /dev/null@@ -1,5 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<!-- Background for the generated adaptive launcher icon (see LauncherIconGen). -->-<resources>-    <color name="ic_launcher_background">#FFFFFF</color>-</resources>
communicate-wear/src/test/java/com/vayunmathur/communicate/wear/domain/WearCommunicateProtocolTest.kt
diff --git a/communicate-wear/src/test/java/com/vayunmathur/communicate/wear/domain/WearCommunicateProtocolTest.kt b/communicate-wear/src/test/java/com/vayunmathur/communicate/wear/domain/WearCommunicateProtocolTest.ktdeleted file mode 100644index a85921c978..0000000000--- a/communicate-wear/src/test/java/com/vayunmathur/communicate/wear/domain/WearCommunicateProtocolTest.kt+++ /dev/null@@ -1,204 +0,0 @@-package com.vayunmathur.communicate.wear.domain---import com.vayunmathur.library.wearlink.communicate.WearCallEntry-import com.vayunmathur.library.wearlink.communicate.WearCommLine-import com.vayunmathur.library.wearlink.communicate.WearCommOp-import com.vayunmathur.library.wearlink.communicate.WearCommunicateProtocol-import com.vayunmathur.library.wearlink.communicate.WearCommunicateSnapshot-import com.vayunmathur.library.wearlink.communicate.WearMessage-import com.vayunmathur.library.wearlink.communicate.WearOpKind-import com.vayunmathur.library.wearlink.communicate.WearOpResult-import com.vayunmathur.library.wearlink.communicate.WearThread-import com.vayunmathur.library.wearlink.communicate.WearVoicemail-import com.vayunmathur.library.wearlink.communicate.buildWearCommunicateSnapshot-import com.vayunmathur.library.wearlink.communicate.buildWearNewMessageAlert-import com.vayunmathur.library.wearlink.communicate.buildWearThreadPage-import com.vayunmathur.library.wearlink.communicate.mergeWearThreadPage-import com.vayunmathur.library.wearlink.communicate.pendingAfterResult-import com.vayunmathur.library.wearlink.communicate.validWearReply-import com.vayunmathur.library.wearlink.communicate.wearThreadKey-import kotlinx.serialization.encodeToString-import kotlin.test.Test-import kotlin.test.assertEquals-import kotlin.test.assertFalse-import kotlin.test.assertTrue--class WearCommunicateProtocolTest {--    private fun thread(-        key: String = "WhatsApp:abc",-        snippet: String = "Hi there",-        timestamp: Long = 900L,-        disappearing: Boolean = false,-    ) = WearThread(-        key = key, threadId = 7L, line = WearCommLine.WhatsApp, address = "+1555",-        displayName = "Alice", snippet = snippet, timestampMillis = timestamp,-        unreadCount = 2, disappearing = disappearing,-    )--    private fun message(id: String, ts: Long, body: String = "msg $id", disappearing: Boolean = false) =-        WearMessage(-            messageKey = id, threadKey = "WhatsApp:abc", body = body,-            timestampMillis = ts, disappearing = disappearing,-        )--    @Test-    fun goldenSnapshotJson() {-        val snapshot = WearCommunicateSnapshot(-            generatedAtMillis = 1_000L,-            threads = listOf(thread()),-        )-        assertEquals(-            """{"generatedAtMillis":1000,"threads":[{"key":"WhatsApp:abc","threadId":7,""" +-                """"line":"WhatsApp","address":"+1555","displayName":"Alice","snippet":"Hi there",""" +-                """"timestampMillis":900,"unreadCount":2}]}""",-            WearCommunicateProtocol.json.encodeToString(snapshot),-        )-    }--    @Test-    fun goldenOpJson() {-        val op = WearCommOp(-            opId = "op1", kind = WearOpKind.QuickReply, threadKey = "WhatsApp:abc",-            line = WearCommLine.WhatsApp, body = "OK",-        )-        assertEquals(-            """{"opId":"op1","kind":"QuickReply","threadKey":"WhatsApp:abc","line":"WhatsApp","body":"OK"}""",-            WearCommunicateProtocol.json.encodeToString(op),-        )-    }--    @Test-    fun snapshotRoundTrip() {-        val snapshot = buildWearCommunicateSnapshot(-            threads = listOf(thread()),-            calls = listOf(-                WearCallEntry(key = "Sim:1", phoneNumber = "+1555", type = "Missed", timestampMillis = 5L),-            ),-            voicemails = listOf(-                WearVoicemail(key = "Sim:2", phoneNumber = "+1555", timestampMillis = 4L, isRead = false),-            ),-            generatedAtMillis = 10L,-        )-        assertEquals(-            snapshot,-            WearCommunicateProtocol.json.decodeFromString<WearCommunicateSnapshot>(-                WearCommunicateProtocol.json.encodeToString(snapshot),-            ),-        )-        assertEquals(1, snapshot.voicemailUnreadCount)-    }--    @Test-    fun buildCapsCountsFieldsAndBytes() {-        val threads = (1..(WearCommunicateProtocol.MAX_THREADS + 20)).map {-            thread(key = "Sim:$it", snippet = "s".repeat(500), timestamp = it.toLong())-        }-        val snapshot = buildWearCommunicateSnapshot(threads, emptyList(), emptyList(), 0L)-        assertTrue(snapshot.notesSize() <= WearCommunicateProtocol.MAX_THREADS)-        assertTrue(snapshot.truncated)-        assertTrue(snapshot.threads.all {-            it.snippet.length == WearCommunicateProtocol.MAX_SNIPPET_CHARS-        })-        val bytes = WearCommunicateProtocol.json.encodeToString(snapshot).encodeToByteArray().size-        assertTrue(bytes <= WearCommunicateProtocol.MAX_JSON_BYTES, "snapshot $bytes over cap")-        assertEquals("Sim:${WearCommunicateProtocol.MAX_THREADS + 20}", snapshot.threads.first().key)-    }--    private fun WearCommunicateSnapshot.notesSize() = threads.size--    @Test-    fun disappearingThreadExcludesSnippetEverywhere() {-        val snapshot = buildWearCommunicateSnapshot(-            threads = listOf(thread(snippet = "secret text", disappearing = true)),-            calls = emptyList(), voicemails = emptyList(), generatedAtMillis = 0L,-        )-        assertEquals("", snapshot.threads.single().snippet)-        assertTrue(snapshot.threads.single().contentExcluded)-        val alert = buildWearNewMessageAlert(snapshot.threads.single(), 1_000L)-        assertEquals("", alert.snippet)-        assertTrue(alert.contentExcluded)-        val encoded = WearCommunicateProtocol.json.encodeToString(snapshot)-        assertFalse(encoded.contains("secret text"), "disappearing snippet leaked: $encoded")-    }--    @Test-    fun disappearingMessageExcludesBodyAndMedia() {-        val page = buildWearThreadPage(-            threadKey = "WhatsApp:abc",-            messages = listOf(-                message("m1", 100L, body = "secret body", disappearing = true)-                    .copy(mediaLabel = "Photo"),-            ),-        )-        val only = page.messages.single()-        assertEquals("", only.body)-        assertEquals(null, only.mediaLabel)-        assertTrue(only.contentExcluded)-        assertFalse(WearCommunicateProtocol.json.encodeToString(page).contains("secret body"))-    }--    @Test-    fun pagingLatestThenOlderWithCursor() {-        val messages = (1..45).map { message("m$it", it * 10L) }-        val latest = buildWearThreadPage("WhatsApp:abc", messages)-        assertEquals(WearCommunicateProtocol.MAX_PAGE_MESSAGES, latest.messages.size)-        assertEquals("m26", latest.messages.first().messageKey)-        assertEquals("m45", latest.messages.last().messageKey)-        assertTrue(latest.hasMore)-        val older = buildWearThreadPage(-            "WhatsApp:abc", messages,-            beforeTimestampMillis = latest.oldestTimestampMillis,-        )-        assertEquals("m6", older.messages.first().messageKey)-        assertEquals("m25", older.messages.last().messageKey)-        assertTrue(older.hasMore)-        val oldest = buildWearThreadPage(-            "WhatsApp:abc", messages,-            beforeTimestampMillis = older.oldestTimestampMillis,-        )-        assertEquals(5, oldest.messages.size)-        assertFalse(oldest.hasMore)-    }--    @Test-    fun mergeDedupesAndCaps() {-        val first = buildWearThreadPage(-            "WhatsApp:abc", (1..20).map { message("m$it", it.toLong()) },-        )-        val merged = mergeWearThreadPage(first.messages, first)-        assertEquals(20, merged.size)-        val big = mergeWearThreadPage(-            merged, buildWearThreadPage("WhatsApp:abc", (21..200).map { message("m$it", it.toLong()) }),-        )-        assertTrue(big.size <= WearCommunicateProtocol.MAX_CACHED_MESSAGES_PER_THREAD)-        assertEquals("m200", big.last().messageKey)-    }--    @Test-    fun replyValidationAndResultHandling() {-        val good = WearCommOp(-            opId = "a", kind = WearOpKind.QuickReply, threadKey = "Sim:1", body = "  On my way  ",-        )-        assertEquals("On my way", validWearReply(good))-        assertEquals(null, validWearReply(good.copy(body = "   ")))-        assertEquals(null, validWearReply(good.copy(kind = WearOpKind.MarkRead)))-        val pending = listOf(good, good.copy(opId = "b"))-        assertEquals(-            listOf(pending[1]),-            pendingAfterResult(pending, WearOpResult("a", WearOpKind.QuickReply, success = true)),-        )-        assertEquals(-            pending,-            pendingAfterResult(pending, WearOpResult("a", WearOpKind.QuickReply, success = false)),-        )-    }--    @Test-    fun threadKeyPrefersRemoteId() {-        assertEquals("Signal:conv1", wearThreadKey(WearCommLine.Signal, "conv1", 42L))-        assertEquals("Sim:42", wearThreadKey(WearCommLine.Sim, null, 42L))-        assertEquals("Sim:42", wearThreadKey(WearCommLine.Sim, "", 42L))-    }-}
communicate/AGENTS.md
diff --git a/communicate/AGENTS.md b/communicate/AGENTS.mdindex 3efa56cb79..3c51d4096e 100644--- a/communicate/AGENTS.md+++ b/communicate/AGENTS.md@@ -4,9 +4,9 @@  _Install: ./install communicate (dev by default)._ - Gradle: :communicate / dir: communicate/-- Package roots present: ui, data, domain, intents, service, telephony, notifications-- Entry files: MainActivity.kt, Route.kt, Navigation.kt-- Deps: :library:network, :library:image, :library:room, :library:aosp-stubs (compileOnly), :library:wearlink+- Package roots present: ui, data, domain, intents, service, telephony, notifications, sync+- Entry files: MainActivity.kt (sole launcher; routes watches to WearMainActivity), Route.kt, Navigation.kt, ui/WearMainActivity.kt+- Deps: :library:network, :library:image, :library:room, :library:aosp-stubs (compileOnly), :library:wearlink, :library:log, Wear Compose (material + foundation) - Metadata: metadata_data/communicate.md (present) - Rust: no (both crates live in `:communicate-dev`) / screenshotTest: yes @@ -18,6 +18,33 @@ _Install: ./install communicate (dev by default)._ - Android Auto car templates (`service/car/`), assistant send/read intents, voicemail tab with plain ExoPlayer playback **Architecture / data-flow:** `ui/` tabs + conversation screens → `data/CommunicateRepository*` (per-line splits: `Sim`, `Send`, `Merged` in `src/main`; `Rcs`, `RcsGroup`, `Signal`, `WhatsApp`, `WhatsAppCalls` in `src/dev` over `:communicate-dev`, with no-op counterparts in `src/release`) over the SIM/GV providers; WhatsApp/Signal/RCS data, transports, Room DBs, protos, and Rust crates live in `:communicate-dev` (linked `devImplementation` only). `telephony/` in `src/main` owns SIM/GV framework services; the WA/Signal/RCS sync services and in-app Telecom glue live in `src/dev/telephony/` with their manifest entries in `:communicate-dev`. Shared-code line dispatch goes through the variant seam files (`data/LineRepositorySeam.kt`, `ui/LineUiSeam.kt` plus its one-composable-per-file splits `ui/rememberSignalSignedIn.kt`, `ui/remember{WhatsApp,Signal}Account.kt`, `ui/rememberRcsStatusText.kt`, `ui/rememberDevLineChoices.kt`, `ui/LineSyncEffects.kt`, and `ui/AppTelecomEffects.kt`, each in `src/dev` + `src/release`). There is no `platform/` or `network/` root in this module; don't create those roots here. **Entry points + reading order:** `Route` (`Messages` / `Dialer` / `CallLogs` / `Accounts` / `Conversation(threadId, …)` / `Call` / registration wizards) → `MainActivity.kt` → `Navigation.kt` → `ui/MessagesScreen.kt` → `data/CommunicateRepository.kt`.++## One APK, two form factors (phone + watch)+This module is the single Communicate APK for phones and watches: same+`applicationId = "com.vayunmathur.communicate"` and signing on both, as+the WearLink handshake requires. The manifest deliberately declares no+`android.hardware.type.watch` feature (required=true would block+phones; required=false is disallowed for this feature), plus+touchscreen not-required and+`com.google.android.wearable.standalone=false`; distribution is+sideload/F-Droid, not Play's watch channel, so the APK installs on+phones and watches alike. `ui/FormFactor.kt` reads+`PackageManager.FEATURE_WATCH` at runtime: `MainActivity` (the sole+launcher entry) forwards watches to `ui/WearMainActivity` before any+phone state loads; phones get the tab UI. The phone telephony+receivers (`telephony/SmsDeliverReceiver`, `telephony/MmsDeliverReceiver`)+early-return on a watch — a watch has no default-SMS role and receives+its messages over WearLink.++## Wear sync (Watch conduit over WearLink)+**Protocol:** shared wire types live in `:library:wearlink` at `com.vayunmathur.library.wearlink.communicate.WearCommunicateProtocol`; this module's golden-JSON test pins the shared code's wire format.+- Snapshot + watch-state, thread pages, new-message/incoming-call alerts, and watch ops with phone verdicts (see the protocol file for paths and caps)+- **Transport:** phone side `data/WearCommunicateSync.kt` and watch side `sync/WearLinkBridge.kt` both live in this APK; `FormFactor` picks the side at runtime. Delivery is app-lifecycle-bound; the watch keeps ops pending and resends on reconnect.++## Watch experience (in this module)+- `ui/WearMainActivity` (a `WearShellActivity`) routes `ui/WearRoute` over the conversation list / thread (paged, cached offline) / quick reply / call log (read-only) / voicemail indicators / phone-only explanation; an incoming-call overlay offers Decline only (no answer-on-watch: watch audio routing is not guaranteed).+- Watch state persists in `data/WearCommunicateStore` (snapshot, thread-page and pending-op JSON files).+- Watch listing screenshots are the `group = "wear"` previews in `src/screenshotTest/.../ui/WearMetadataPreviews.kt`, collected by `:communicate:metadata` into `metadata_data/photos/communicate/wear/`. **Gotchas:** - Both Rust crates (`communicate_signal`, `communicate_mls`) and their guarded wrappers live in `:communicate-dev`; never call them unguarded and never merge the crates (own dependency trees). - Protobuf is hand-rolled in `:communicate-dev` (AGP 9 breaks both Wire and protobuf Gradle plugins): its `build.gradle.kts` resolves `protoc` from Maven and runs `GenerateProtoTask` over its `src/main/proto/` (11 Signal/WhatsApp protos) — don't add a proto plugin.@@ -37,7 +64,9 @@ _Install: ./install communicate (dev by default)._ - com/vayunmathur/communicate/data/CommunicateRepositoryMerged.kt — plus per-line splits (`Sim`, `Send`, `Rcs`, `Signal`, `WhatsApp`) - com/vayunmathur/communicate/data/SimManager.kt - com/vayunmathur/communicate/data/SecretSealer.kt-- com/vayunmathur/communicate/data/WearCommunicateSync.kt — phone side of the wear companion; wire protocol `com.vayunmathur.library.wearlink.communicate.WearCommunicateProtocol` in `:library:wearlink` (shared with `:communicate-wear`; each side's `WearCommunicateProtocolTest` pins the same golden JSON)+- com/vayunmathur/communicate/data/WearCommunicateSync.kt — phone side of the wear sync in this same APK; wire protocol `com.vayunmathur.library.wearlink.communicate.WearCommunicateProtocol` in `:library:wearlink` (this module's `WearCommunicateProtocolTest` pins the golden JSON)+- com/vayunmathur/communicate/data/WearCommunicateStore.kt — watch-side snapshot/thread-page/pending-op store+- com/vayunmathur/communicate/sync/WearLinkBridge.kt — watch side of the wear sync (snapshot/pages in, ops/requests out) ### data/googlevoice/ — Voice line (RPC + SIP calls) - com/vayunmathur/communicate/data/googlevoice/GoogleVoiceClient.kt - com/vayunmathur/communicate/data/googlevoice/GoogleVoiceSession.kt@@ -59,6 +88,10 @@ _Install: ./install communicate (dev by default)._ - com/vayunmathur/communicate/ui/MessagesScreen.kt - com/vayunmathur/communicate/ui/ConversationScreen.kt - com/vayunmathur/communicate/ui/DialerScreen.kt+### Watch experience (ui/ + data/ + sync/)+- com/vayunmathur/communicate/ui/WearMainActivity.kt — watch entry (WearShellActivity, exported=false; reached only via MainActivity's watch routing)+- com/vayunmathur/communicate/ui/WearRoute.kt, WearConversationListScreen.kt, WearThreadScreen.kt, WearReplyScreen.kt, WearCallLogScreen.kt, WearVoicemailScreen.kt, WearIncomingCallScreen.kt, WearPhoneOnlyScreen.kt+- com/vayunmathur/communicate/ui/FormFactor.kt — watch detection (`FEATURE_WATCH`)  ## Screenshot coverage + dialog routes Dialogs are `Route` destinations (`NewMessageDialog`, `DeleteConversationDialog`, `DeleteCallLogDialog`, `PollComposerDialog` — `DialogPage()` entries in `ui/CommunicateDialogEntries.kt`, selection in route args, results via `RESULT_*` keys), never `pendingDelete`/`show…` state in a screen. Each has a capture in `src/screenshotTest` named `<n>-<route-key>`; the fatal `RouteScreenshotCoverage` lint enforces route→capture mapping, with session/WebView/call-bound routes exempted per route in `Route.kt`. Remaining embedded dialog: `VoicemailContent`'s delete confirm (`VoicemailScreen` is unrouted today). Convention: `docs/screenshot-coverage.md`.@@ -67,5 +100,7 @@ Dialogs are `Route` destinations (`NewMessageDialog`, `DeleteConversationDialog` ``` ./gradlew :communicate:compileDevKotlin ./gradlew :communicate:lint+./gradlew :communicate:lintVitalRelease+./gradlew :communicate:testDevUnitTest ./gradlew :communicate:checkMetadata ```
communicate/build.gradle.kts
diff --git a/communicate/build.gradle.kts b/communicate/build.gradle.ktsindex 14584436b2..0ae074ebb2 100644--- a/communicate/build.gradle.kts+++ b/communicate/build.gradle.kts@@ -124,6 +124,13 @@ rustNativeTests {             "com.vayunmathur.communicate.whatsapp.W5Pass2ClientCoreTest",             "com.vayunmathur.communicate.whatsapp.W5Pass2ContactUtilsTest",             "com.vayunmathur.communicate.whatsapp.W5Pass2SyncHistoryTest",+            // Batch-shift fallout from the wear merge's added classes:+            // Y2RepositoryRcsSendTest's MMS send and+            // Y1RegistrationScreensTest's RCS verify (AndroidKeyStore via+            // Room/SQLCipher) fail when they share a batched Robolectric+            // sandbox with new neighbours; both pass isolated.+            "com.vayunmathur.communicate.data.Y2RepositoryRcsSendTest",+            "com.vayunmathur.communicate.ui.Y1RegistrationScreensTest",         )     ) }@@ -132,8 +139,17 @@ dependencies {     // Google Voice virtual line: protojson RPCs + SIP-over-WSS transport go through     // the repo's own Android-only HTTP/WebSocket stack (no OkHttp/Ktor).     implementation(project(":library:network"))-    // Wear OS companion sync (RFCOMM, no Play services); phone side of :communicate-wear.+    // Both sides of the Wear OS sync live in this one APK (same+    // applicationId and signing, as the WearLink handshake requires):+    // data/WearCommunicateSync publishes the phone snapshot,+    // sync/WearLinkBridge receives it on a watch. FormFactor picks the+    // side at runtime.     implementation(project(":library:wearlink"))+    // Watch experience (ui/Wear*): Wear Compose + the repo log facade the+    // watch store/sync code writes through.+    implementation(libs.androidx.wear.compose.material)+    implementation(libs.androidx.wear.compose.foundation)+    implementation(project(":library:log"))     // Local Compose image loading for Google Voice MMS previews (remote https + content://).     implementation(project(":library:image"))     // RingRTC supplies both Signal's calling engine and the org.webrtc classes every line's calling
communicate/src/main/AndroidManifest.xml
diff --git a/communicate/src/main/AndroidManifest.xml b/communicate/src/main/AndroidManifest.xmlindex 325d94f006..e61b3977e1 100644--- a/communicate/src/main/AndroidManifest.xml+++ b/communicate/src/main/AndroidManifest.xml@@ -64,6 +64,21 @@         android:name="android.hardware.telephony"         android:required="false" /> +    <!-- Single APK for phone and watch. Deliberately NO+         android.hardware.type.watch uses-feature here: required="true"+         would block every phone install, and required="false" is+         disallowed for this feature (lint InvalidWearFeatureAttribute;+         Google's packaging model does not support one APK for Wear and+         non-Wear via Play). This app does not distribute through Play's+         watch channel — it is sideloaded / F-Droid-installed, where no+         feature declaration is needed to install on a watch — so the+         APK carries no watch feature filter at all and+         FormFactor.isWatch (PackageManager.FEATURE_WATCH, still+         reported by watch hardware at runtime) routes the experience. -->+    <uses-feature+        android:name="android.hardware.touchscreen"+        android:required="false" />+     <queries>         <intent>             <action android:name="android.intent.action.DIAL" />@@ -83,6 +98,11 @@         android:roundIcon="@mipmap/ic_launcher"         android:supportsRtl="true"         android:theme="@style/Theme.General">++        <!-- Watch experience is paired with the phone app, not standalone. -->+        <meta-data+            android:name="com.google.android.wearable.standalone"+            android:value="false" />         <activity             android:name=".MainActivity"             android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"@@ -192,6 +212,15 @@             android:permission="com.vayunmathur.communicate.permissions.ACCESS_COMMUNICATE"             android:theme="@android:style/Theme.NoDisplay" /> +        <!-- Watch experience: entered only via MainActivity's watch routing+             (no launcher filter of its own). Inert on a phone: it is+             reached only from MainActivity's FEATURE_WATCH forward. -->+        <activity+            android:name=".ui.WearMainActivity"+            android:exported="false"+            android:taskAffinity=""+            android:theme="@android:style/Theme.Material.NoActionBar" />+         <!-- Expanded conversation bubble host: must be embeddable and document-launched. -->         <activity             android:name=".notifications.BubbleActivity"
communicate/src/main/java/com/vayunmathur/communicate/MainActivity.kt
diff --git a/communicate/src/main/java/com/vayunmathur/communicate/MainActivity.kt b/communicate/src/main/java/com/vayunmathur/communicate/MainActivity.ktindex 7357415c07..1e4c8c9732 100644--- a/communicate/src/main/java/com/vayunmathur/communicate/MainActivity.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/MainActivity.kt@@ -2,6 +2,7 @@ package com.vayunmathur.communicate  import android.app.PictureInPictureParams import android.content.Intent+import android.os.Bundle import android.util.Rational import androidx.compose.runtime.Composable import androidx.compose.runtime.mutableStateOf@@ -11,15 +12,36 @@ import com.vayunmathur.communicate.data.call.InAppCallPhase import com.vayunmathur.communicate.data.call.InAppCallRegistry import com.vayunmathur.communicate.intents.DeepLink import com.vayunmathur.communicate.intents.DeepLinks+import com.vayunmathur.communicate.ui.FormFactor+import com.vayunmathur.communicate.ui.WearMainActivity import com.vayunmathur.library.ui.MaActivity import com.vayunmathur.library.util.OfflineAware -/** The single activity hosting the communicate UI: navigation, deep links and line setup. */+/**+ * Sole launcher entry of the single merged Communicate APK. On a watch+ * (the `android.hardware.type.watch` system feature, see [FormFactor])+ * it hands off to [WearMainActivity] and finishes before any phone state+ * (phone sync, deep links, PiP) is touched; on a phone it hosts the+ * navigation, deep links and line setup.+ */ class MainActivity : MaActivity() {+    /** True on a watch, where this activity only forwards to [WearMainActivity]. */+    private var routedToWear = false++    override fun onCreate(savedInstanceState: Bundle?) {+        routedToWear = FormFactor.isWatch(this)+        super.onCreate(savedInstanceState)+        if (routedToWear) {+            startActivity(Intent(this, WearMainActivity::class.java))+            finish()+        }+    }+     /** The deep link the app was opened with, or the most recent one delivered to a running instance. */     private var pendingDeepLink by mutableStateOf<DeepLink?>(null)      override fun onCreateBeforeContent() {+        if (routedToWear) return         pendingDeepLink = DeepLinks.parse(intent)         // Wear companion sync lives and dies with this process (WearLink has         // no system wakeup); the watch reads its cached snapshot offline.@@ -31,6 +53,9 @@ class MainActivity : MaActivity() {      @Composable     override fun Content() {+        // On a watch this activity is finishing towards WearMainActivity;+        // compose nothing (and touch no phone state) in the meantime.+        if (routedToWear) return         OfflineAware {             Navigation(initialDeepLink = pendingDeepLink)         }@@ -53,6 +78,7 @@ class MainActivity : MaActivity() {      */     override fun onUserLeaveHint() {         super.onUserLeaveHint()+        if (routedToWear) return         val call = InAppCallRegistry.state.value         val videoActive = call.remoteVideoEnabled || call.localVideoEnabled         if (!videoActive || call.phase == InAppCallPhase.Idle || call.phase == InAppCallPhase.Ended) return
communicate/src/main/java/com/vayunmathur/communicate/data/WearCommunicateStore.kt
diff --git a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/data/WearCommunicateStore.kt b/communicate/src/main/java/com/vayunmathur/communicate/data/WearCommunicateStore.ktsimilarity index 97%rename from communicate-wear/src/main/java/com/vayunmathur/communicate/wear/data/WearCommunicateStore.ktrename to communicate/src/main/java/com/vayunmathur/communicate/data/WearCommunicateStore.ktindex 9794d2da25..6ab895fd59 100644--- a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/data/WearCommunicateStore.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/data/WearCommunicateStore.kt@@ -1,4 +1,4 @@-package com.vayunmathur.communicate.wear.data+package com.vayunmathur.communicate.data  import android.content.Context import com.vayunmathur.library.log.Log@@ -75,7 +75,7 @@ class WearCommunicateStore private constructor(private val context: Context) {     fun setSnapshot(snapshot: WearCommunicateSnapshot) {         _snapshot.value = snapshot         persist(snapshotFile, WearCommunicateProtocol.json.encodeToString(snapshot))-        com.vayunmathur.communicate.wear.sync.WearLinkBridge.publishWatchState(context)+        com.vayunmathur.communicate.sync.WearLinkBridge.publishWatchState(context)     }      /** Merges one arrived page into the thread cache (evicting the least recent threads). */@@ -174,7 +174,7 @@ class WearCommunicateStore private constructor(private val context: Context) {     private fun queue(op: WearCommOp): WearCommOp {         _pendingOps.value = _pendingOps.value + op         persistPending()-        com.vayunmathur.communicate.wear.sync.WearLinkBridge.flushPending(context)+        com.vayunmathur.communicate.sync.WearLinkBridge.flushPending(context)         return op     } 
communicate/src/main/java/com/vayunmathur/communicate/sync/WearLinkBridge.kt
diff --git a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/sync/WearLinkBridge.kt b/communicate/src/main/java/com/vayunmathur/communicate/sync/WearLinkBridge.ktsimilarity index 98%rename from communicate-wear/src/main/java/com/vayunmathur/communicate/wear/sync/WearLinkBridge.ktrename to communicate/src/main/java/com/vayunmathur/communicate/sync/WearLinkBridge.ktindex bc07008562..94766f6082 100644--- a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/sync/WearLinkBridge.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/sync/WearLinkBridge.kt@@ -1,7 +1,7 @@-package com.vayunmathur.communicate.wear.sync+package com.vayunmathur.communicate.sync  import android.content.Context-import com.vayunmathur.communicate.wear.data.WearCommunicateStore+import com.vayunmathur.communicate.data.WearCommunicateStore import com.vayunmathur.library.log.Log import com.vayunmathur.library.wearlink.WearLinkListener import com.vayunmathur.library.wearlink.WearLinkNode
communicate/src/main/java/com/vayunmathur/communicate/telephony/MmsDeliverReceiver.kt
diff --git a/communicate/src/main/java/com/vayunmathur/communicate/telephony/MmsDeliverReceiver.kt b/communicate/src/main/java/com/vayunmathur/communicate/telephony/MmsDeliverReceiver.ktindex 754cfcad14..9e300ff7ce 100644--- a/communicate/src/main/java/com/vayunmathur/communicate/telephony/MmsDeliverReceiver.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/telephony/MmsDeliverReceiver.kt@@ -14,6 +14,7 @@ import com.vayunmathur.communicate.R import com.vayunmathur.communicate.data.CommunicateLine import com.vayunmathur.communicate.notifications.ConversationSpace import com.vayunmathur.communicate.notifications.ConversationTarget+import com.vayunmathur.communicate.ui.FormFactor import java.io.File  /**@@ -24,6 +25,9 @@ import java.io.File  */ class MmsDeliverReceiver : BroadcastReceiver() {     override fun onReceive(context: Context, intent: Intent) {+        // Phone experience only: a watch has no default-SMS role; its+        // messages arrive over WearLink, not the telephony provider.+        if (FormFactor.isWatch(context)) return         when (intent.action) {             Telephony.Sms.Intents.WAP_PUSH_DELIVER_ACTION -> handlePush(context, intent)             ACTION_MMS_DOWNLOADED -> handleDownloaded(context, intent)
communicate/src/main/java/com/vayunmathur/communicate/telephony/SmsDeliverReceiver.kt
diff --git a/communicate/src/main/java/com/vayunmathur/communicate/telephony/SmsDeliverReceiver.kt b/communicate/src/main/java/com/vayunmathur/communicate/telephony/SmsDeliverReceiver.ktindex a80ec8f4f9..a0611586ae 100644--- a/communicate/src/main/java/com/vayunmathur/communicate/telephony/SmsDeliverReceiver.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/telephony/SmsDeliverReceiver.kt@@ -10,6 +10,7 @@ import com.vayunmathur.communicate.R import com.vayunmathur.communicate.data.CommunicateLine import com.vayunmathur.communicate.notifications.ConversationSpace import com.vayunmathur.communicate.notifications.ConversationTarget+import com.vayunmathur.communicate.ui.FormFactor  /**  * Handles inbound SMS as the default SMS app. Android delivers `SMS_DELIVER` only to the default@@ -21,6 +22,9 @@ import com.vayunmathur.communicate.notifications.ConversationTarget  */ class SmsDeliverReceiver : BroadcastReceiver() {     override fun onReceive(context: Context, intent: Intent) {+        // Phone experience only: a watch has no default-SMS role; its+        // messages arrive over WearLink, not the telephony provider.+        if (FormFactor.isWatch(context)) return         if (intent.action != Telephony.Sms.Intents.SMS_DELIVER_ACTION) return         val parts = runCatching { Telephony.Sms.Intents.getMessagesFromIntent(intent) }             .getOrNull()?.takeIf { it.isNotEmpty() } ?: run {
communicate/src/main/java/com/vayunmathur/communicate/ui/FormFactor.kt
diff --git a/communicate/src/main/java/com/vayunmathur/communicate/ui/FormFactor.kt b/communicate/src/main/java/com/vayunmathur/communicate/ui/FormFactor.ktnew file mode 100644index 0000000000..3001979a77--- /dev/null+++ b/communicate/src/main/java/com/vayunmathur/communicate/ui/FormFactor.kt@@ -0,0 +1,25 @@+package com.vayunmathur.communicate.ui++import android.content.Context+import android.content.pm.PackageManager++/**+ * Runtime form-factor detection for the single merged Communicate APK.+ *+ * One APK ships to phones and watches (same applicationId and signing, as+ * the WearLink handshake requires). [PackageManager.FEATURE_WATCH] is the+ * canonical signal: Wear OS devices report the `android.hardware.type.watch`+ * system feature, phones and tablets do not. The manifest deliberately+ * declares no such uses-feature (required=true would block phones,+ * required=false is disallowed for this feature), so the same APK+ * installs on both; this runtime check is what routes the experience.+ */+object FormFactor {++    /** True when this device reports the watch system feature. */+    fun isWatch(context: Context): Boolean =+        isWatch(context.packageManager.hasSystemFeature(PackageManager.FEATURE_WATCH))++    /** Pure core of [isWatch], split out so unit tests need no Android runtime. */+    fun isWatch(hasWatchSystemFeature: Boolean): Boolean = hasWatchSystemFeature+}
communicate/src/main/java/com/vayunmathur/communicate/ui/WearCallLogScreen.kt
diff --git a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearCallLogScreen.kt b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearCallLogScreen.ktsimilarity index 95%rename from communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearCallLogScreen.ktrename to communicate/src/main/java/com/vayunmathur/communicate/ui/WearCallLogScreen.ktindex a92fa01495..a042f37e4a 100644--- a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearCallLogScreen.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearCallLogScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.communicate.wear.ui+package com.vayunmathur.communicate.ui  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -16,8 +16,8 @@ import androidx.wear.compose.material.Chip import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text-import com.vayunmathur.communicate.wear.R-import com.vayunmathur.communicate.wear.data.WearCommunicateStore+import com.vayunmathur.communicate.R+import com.vayunmathur.communicate.data.WearCommunicateStore  /** Unified call log, read-only: calling back and dialling stay on the phone. */ @Composable
communicate/src/main/java/com/vayunmathur/communicate/ui/WearConversationListScreen.kt
diff --git a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearConversationListScreen.kt b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearConversationListScreen.ktsimilarity index 97%rename from communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearConversationListScreen.ktrename to communicate/src/main/java/com/vayunmathur/communicate/ui/WearConversationListScreen.ktindex 25599516d3..a34b7dcd2a 100644--- a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearConversationListScreen.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearConversationListScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.communicate.wear.ui+package com.vayunmathur.communicate.ui  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -21,9 +21,9 @@ import androidx.wear.compose.material.Chip import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text-import com.vayunmathur.communicate.wear.R-import com.vayunmathur.communicate.wear.data.WearCommunicateStore-import com.vayunmathur.communicate.wear.sync.WearLinkBridge+import com.vayunmathur.communicate.R+import com.vayunmathur.communicate.data.WearCommunicateStore+import com.vayunmathur.communicate.sync.WearLinkBridge import kotlinx.coroutines.launch  /** Merged conversation list (all lines), most recent first, from the local snapshot (offline-safe). */
communicate/src/main/java/com/vayunmathur/communicate/ui/WearIncomingCallScreen.kt
diff --git a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearIncomingCallScreen.kt b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearIncomingCallScreen.ktsimilarity index 95%rename from communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearIncomingCallScreen.ktrename to communicate/src/main/java/com/vayunmathur/communicate/ui/WearIncomingCallScreen.ktindex 95b92aea2c..ad4a3053b6 100644--- a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearIncomingCallScreen.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearIncomingCallScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.communicate.wear.ui+package com.vayunmathur.communicate.ui  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -13,8 +13,8 @@ import androidx.wear.compose.material.Chip import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text-import com.vayunmathur.communicate.wear.R-import com.vayunmathur.communicate.wear.data.WearCommunicateStore+import com.vayunmathur.communicate.R+import com.vayunmathur.communicate.data.WearCommunicateStore import com.vayunmathur.library.wearlink.communicate.WearIncomingCall  /**
communicate/src/main/java/com/vayunmathur/communicate/ui/WearMainActivity.kt
diff --git a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearMainActivity.kt b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearMainActivity.ktsimilarity index 94%rename from communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearMainActivity.ktrename to communicate/src/main/java/com/vayunmathur/communicate/ui/WearMainActivity.ktindex 5161fc2014..4b26e0c86b 100644--- a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearMainActivity.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearMainActivity.kt@@ -1,10 +1,10 @@-package com.vayunmathur.communicate.wear.ui+package com.vayunmathur.communicate.ui  import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue-import com.vayunmathur.communicate.wear.data.WearCommunicateStore-import com.vayunmathur.communicate.wear.sync.WearLinkBridge+import com.vayunmathur.communicate.data.WearCommunicateStore+import com.vayunmathur.communicate.sync.WearLinkBridge import com.vayunmathur.library.wearlink.WearShellActivity  /**
communicate/src/main/java/com/vayunmathur/communicate/ui/WearPhoneOnlyScreen.kt
diff --git a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearPhoneOnlyScreen.kt b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearPhoneOnlyScreen.ktsimilarity index 95%rename from communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearPhoneOnlyScreen.ktrename to communicate/src/main/java/com/vayunmathur/communicate/ui/WearPhoneOnlyScreen.ktindex 4a8c3c9439..d00a6a615b 100644--- a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearPhoneOnlyScreen.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearPhoneOnlyScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.communicate.wear.ui+package com.vayunmathur.communicate.ui  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -13,7 +13,7 @@ import androidx.wear.compose.material.Chip import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text-import com.vayunmathur.communicate.wear.R+import com.vayunmathur.communicate.R  /** What the watch deliberately does not mirror, and why, in one place. */ @Composable
communicate/src/main/java/com/vayunmathur/communicate/ui/WearReplyScreen.kt
diff --git a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearReplyScreen.kt b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearReplyScreen.ktsimilarity index 96%rename from communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearReplyScreen.ktrename to communicate/src/main/java/com/vayunmathur/communicate/ui/WearReplyScreen.ktindex b2677fc1d1..04151c3201 100644--- a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearReplyScreen.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearReplyScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.communicate.wear.ui+package com.vayunmathur.communicate.ui  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -21,8 +21,8 @@ import androidx.wear.compose.material.Chip import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text-import com.vayunmathur.communicate.wear.R-import com.vayunmathur.communicate.wear.data.WearCommunicateStore+import com.vayunmathur.communicate.R+import com.vayunmathur.communicate.data.WearCommunicateStore import com.vayunmathur.library.wearlink.communicate.WearCommunicateProtocol  /**
communicate/src/main/java/com/vayunmathur/communicate/ui/WearRoute.kt
diff --git a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearRoute.kt b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearRoute.ktsimilarity index 94%rename from communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearRoute.ktrename to communicate/src/main/java/com/vayunmathur/communicate/ui/WearRoute.ktindex 3ab888bf5b..f4e2cf9f91 100644--- a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearRoute.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearRoute.kt@@ -1,4 +1,4 @@-package com.vayunmathur.communicate.wear.ui+package com.vayunmathur.communicate.ui  /** Watch navigation destinations: detail routes carry the thread key, never selection state. */ sealed interface WearRoute {
communicate/src/main/java/com/vayunmathur/communicate/ui/WearThreadScreen.kt
diff --git a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearThreadScreen.kt b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearThreadScreen.ktsimilarity index 96%rename from communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearThreadScreen.ktrename to communicate/src/main/java/com/vayunmathur/communicate/ui/WearThreadScreen.ktindex 0ebfbd1c6b..b4ea88e7b0 100644--- a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearThreadScreen.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearThreadScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.communicate.wear.ui+package com.vayunmathur.communicate.ui  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -19,9 +19,9 @@ import androidx.wear.compose.material.Chip import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text-import com.vayunmathur.communicate.wear.R-import com.vayunmathur.communicate.wear.data.WearCommunicateStore-import com.vayunmathur.communicate.wear.sync.WearLinkBridge+import com.vayunmathur.communicate.R+import com.vayunmathur.communicate.data.WearCommunicateStore+import com.vayunmathur.communicate.sync.WearLinkBridge import kotlinx.coroutines.launch  /**@@ -54,7 +54,7 @@ fun WearThreadScreen( @Composable internal fun WearThreadContent(     thread: com.vayunmathur.library.wearlink.communicate.WearThread?,-    cache: com.vayunmathur.communicate.wear.data.WearThreadCache?,+    cache: com.vayunmathur.communicate.data.WearThreadCache?,     onLoadOlder: () -> Unit,     onReply: (String) -> Unit,     onMarkRead: () -> Unit,
communicate/src/main/java/com/vayunmathur/communicate/ui/WearVoicemailScreen.kt
diff --git a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearVoicemailScreen.kt b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearVoicemailScreen.ktsimilarity index 96%rename from communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearVoicemailScreen.ktrename to communicate/src/main/java/com/vayunmathur/communicate/ui/WearVoicemailScreen.ktindex a8bb654a36..1b53b95252 100644--- a/communicate-wear/src/main/java/com/vayunmathur/communicate/wear/ui/WearVoicemailScreen.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/ui/WearVoicemailScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.communicate.wear.ui+package com.vayunmathur.communicate.ui  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -16,8 +16,8 @@ import androidx.wear.compose.material.Chip import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text-import com.vayunmathur.communicate.wear.R-import com.vayunmathur.communicate.wear.data.WearCommunicateStore+import com.vayunmathur.communicate.R+import com.vayunmathur.communicate.data.WearCommunicateStore  /**  * Voicemail indicators only: caller, duration, read state and a capped
communicate/src/main/res/values/wear_strings.xml
diff --git a/communicate-wear/src/main/res/values/strings.xml b/communicate/src/main/res/values/wear_strings.xmlsimilarity index 97%rename from communicate-wear/src/main/res/values/strings.xmlrename to communicate/src/main/res/values/wear_strings.xmlindex 69c554288c..b0c627ae00 100644--- a/communicate-wear/src/main/res/values/strings.xml+++ b/communicate/src/main/res/values/wear_strings.xml@@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <resources>-    <string name="app_name">Communicate</string>     <string name="wear_empty">No conversations synced yet. Open Communicate on your phone to sync this watch.</string>     <string name="wear_calls">Calls</string>     <string name="wear_voicemail">Voicemail</string>
communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/WearMetadataPreviews.kt
diff --git a/communicate-wear/src/screenshotTest/kotlin/com/vayunmathur/communicate/wear/ui/MetadataPreviews.kt b/communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/WearMetadataPreviews.ktsimilarity index 93%rename from communicate-wear/src/screenshotTest/kotlin/com/vayunmathur/communicate/wear/ui/MetadataPreviews.ktrename to communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/WearMetadataPreviews.ktindex 15340f8208..8941c1908f 100644--- a/communicate-wear/src/screenshotTest/kotlin/com/vayunmathur/communicate/wear/ui/MetadataPreviews.kt+++ b/communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/WearMetadataPreviews.kt@@ -1,4 +1,4 @@-package com.vayunmathur.communicate.wear.ui+package com.vayunmathur.communicate.ui  import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box@@ -10,7 +10,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.tooling.preview.Preview import androidx.wear.compose.material.MaterialTheme import com.android.tools.screenshot.PreviewTest-import com.vayunmathur.communicate.wear.data.WearThreadCache+import com.vayunmathur.communicate.data.WearThreadCache import com.vayunmathur.library.wearlink.communicate.WearCallEntry import com.vayunmathur.library.wearlink.communicate.WearCommunicateSnapshot import com.vayunmathur.library.wearlink.communicate.WearIncomingCall@@ -30,12 +30,12 @@ private val fixtureSnapshot = WearCommunicateSnapshot( )  /**- * Store listing images for `:communicate-wear` — every top-level screen/route+ * Store listing images for the watch experience of `:communicate` — every top-level screen/route  * (conversation list, thread, reply, call log, voicemail, phone-only) plus the  * incoming-call overlay that replaces any route.- * `./gradlew :communicate-wear:metadata` copies renders into `metadata_data/photos/communicate-wear/wear/`.+ * `./gradlew :communicate:metadata` copies renders into `metadata_data/photos/communicate/wear/`.  */-class MetadataPreviews {+class WearMetadataPreviews {      @PreviewTest     @Preview(name = "1-conversations-round", device = ROUND, group = "wear")
communicate/src/test/java/com/vayunmathur/communicate/data/WearIncomingCallAfterResultTest.kt
diff --git a/communicate-wear/src/test/java/com/vayunmathur/communicate/wear/data/WearIncomingCallAfterResultTest.kt b/communicate/src/test/java/com/vayunmathur/communicate/data/WearIncomingCallAfterResultTest.ktsimilarity index 97%rename from communicate-wear/src/test/java/com/vayunmathur/communicate/wear/data/WearIncomingCallAfterResultTest.ktrename to communicate/src/test/java/com/vayunmathur/communicate/data/WearIncomingCallAfterResultTest.ktindex 684fe8bad1..26f59b2084 100644--- a/communicate-wear/src/test/java/com/vayunmathur/communicate/wear/data/WearIncomingCallAfterResultTest.kt+++ b/communicate/src/test/java/com/vayunmathur/communicate/data/WearIncomingCallAfterResultTest.kt@@ -1,4 +1,4 @@-package com.vayunmathur.communicate.wear.data+package com.vayunmathur.communicate.data  import com.vayunmathur.library.wearlink.communicate.WearCommOp import com.vayunmathur.library.wearlink.communicate.WearIncomingCall
communicate/src/test/java/com/vayunmathur/communicate/ui/FormFactorTest.kt
diff --git a/communicate/src/test/java/com/vayunmathur/communicate/ui/FormFactorTest.kt b/communicate/src/test/java/com/vayunmathur/communicate/ui/FormFactorTest.ktnew file mode 100644index 0000000000..4ab66e0e0f--- /dev/null+++ b/communicate/src/test/java/com/vayunmathur/communicate/ui/FormFactorTest.kt@@ -0,0 +1,19 @@+package com.vayunmathur.communicate.ui++import kotlin.test.Test+import kotlin.test.assertFalse+import kotlin.test.assertTrue++/** The watch system feature is the single-APK routing signal. */+class FormFactorTest {++    @Test+    fun watchFeatureMeansWatch() {+        assertTrue(FormFactor.isWatch(hasWatchSystemFeature = true))+    }++    @Test+    fun noWatchFeatureMeansPhone() {+        assertFalse(FormFactor.isWatch(hasWatchSystemFeature = false))+    }+}
library/wearlink/src/main/java/com/vayunmathur/library/wearlink/communicate/WearCommunicateProtocol.kt
diff --git a/library/wearlink/src/main/java/com/vayunmathur/library/wearlink/communicate/WearCommunicateProtocol.kt b/library/wearlink/src/main/java/com/vayunmathur/library/wearlink/communicate/WearCommunicateProtocol.ktindex af73bbd6f8..d29e67e2d6 100644--- a/library/wearlink/src/main/java/com/vayunmathur/library/wearlink/communicate/WearCommunicateProtocol.kt+++ b/library/wearlink/src/main/java/com/vayunmathur/library/wearlink/communicate/WearCommunicateProtocol.kt@@ -7,9 +7,9 @@ import kotlinx.serialization.json.Json /**  * Phone <-> watch protocol for the Wear OS Communicate companion.  *- * Shared by the phone (`:communicate`) and the watch (`:communicate-wear`)- * through `:library:wearlink`; neither app module depends on the other.- * Each side's tests pin the same golden JSON against this code.+ * Shared by the phone and watch experiences of the single merged+ * `:communicate` APK through `:library:wearlink`. Its tests pin the+ * golden JSON against this code.  *  * The watch mirrors the phone app's navigation, not a glance card:  * conversation list (all lines the phone merges: SIM / Google Voice /
metadata_data/photos/communicate/wear/1.png
diff --git a/metadata_data/photos/communicate-wear/wear/1.png b/metadata_data/photos/communicate/wear/1.pngsimilarity index 100%rename from metadata_data/photos/communicate-wear/wear/1.pngrename to metadata_data/photos/communicate/wear/1.png
metadata_data/photos/communicate/wear/2.png
diff --git a/metadata_data/photos/communicate-wear/wear/2.png b/metadata_data/photos/communicate/wear/2.pngsimilarity index 100%rename from metadata_data/photos/communicate-wear/wear/2.pngrename to metadata_data/photos/communicate/wear/2.png
metadata_data/photos/communicate/wear/3.png
diff --git a/metadata_data/photos/communicate-wear/wear/3.png b/metadata_data/photos/communicate/wear/3.pngsimilarity index 100%rename from metadata_data/photos/communicate-wear/wear/3.pngrename to metadata_data/photos/communicate/wear/3.png
metadata_data/photos/communicate/wear/4.png
diff --git a/metadata_data/photos/communicate-wear/wear/4.png b/metadata_data/photos/communicate/wear/4.pngsimilarity index 100%rename from metadata_data/photos/communicate-wear/wear/4.pngrename to metadata_data/photos/communicate/wear/4.png
metadata_data/photos/communicate/wear/5.png
diff --git a/metadata_data/photos/communicate-wear/wear/5.png b/metadata_data/photos/communicate/wear/5.pngsimilarity index 100%rename from metadata_data/photos/communicate-wear/wear/5.pngrename to metadata_data/photos/communicate/wear/5.png
metadata_data/photos/communicate/wear/6.png
diff --git a/metadata_data/photos/communicate-wear/wear/6.png b/metadata_data/photos/communicate/wear/6.pngsimilarity index 100%rename from metadata_data/photos/communicate-wear/wear/6.pngrename to metadata_data/photos/communicate/wear/6.png
metadata_data/photos/communicate/wear/7.png
diff --git a/metadata_data/photos/communicate-wear/wear/7.png b/metadata_data/photos/communicate/wear/7.pngsimilarity index 100%rename from metadata_data/photos/communicate-wear/wear/7.pngrename to metadata_data/photos/communicate/wear/7.png
settings.gradle.kts
diff --git a/settings.gradle.kts b/settings.gradle.ktsindex c2c3d547eb..044e451a2d 100644--- a/settings.gradle.kts+++ b/settings.gradle.kts@@ -152,7 +152,6 @@ include(":measure") include(":taxi") include(":communicate") include(":communicate-dev")-include(":communicate-wear") include(":euicc") include(":globalesim") include(":backup")