calendar: merge calendar-wear into the single calendar APK
- Commit
41ab07c5ea9a26c8c0ba0676fe8512fc4c19f175- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-04 18:09 UTC (1 day ago)
- Parents
445183f
Owner directive: singular apps that detect when they are on a watch and adapt, instead of a separate *-wear APK per companion. This applies the merged clock pilot (adec0c398 + 31a81d3c5) to calendar + calendar-wear. The merged :calendar APK keeps applicationId com.vayunmathur.calendar and the convention signing on both form factors, as the WearLink handshake requires; neither side's identity changed. Runtime detection is PackageManager.FEATURE_WATCH (platform/FormFactor): MainActivity, the sole launcher entry, forwards watches to ui/WearMainActivity before any phone state (calendar provider, phone conduit sync, widget previews) is touched, and phones keep the existing month/agenda UI. The phone BootReceiver and ReminderReceiver each gate on the same signal and return immediately on a watch. The conduit sync is unchanged: both sides already use WearLinkClientNode (appId calendar) — sync/WearCalendarSync publishes /calendar/snapshot from the phone experience, sync/WearLinkBridge receives it in the watch experience, and FormFactor picks the side at runtime so only one node runs per device. 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. WearMainActivity loses its LAUNCHER filter and is exported=false, entered only via MainActivity routing. All calendar-wear sources move into calendar's closed package roots (wear/data -> data, wear/domain -> domain, wear/sync -> sync, wear/ui -> ui as WearMainActivity/WearRoute/WearAgendaScreen/ WearEventScreen), R references retarget to com.vayunmathur.calendar.R, and wear strings merge as res/values/wear_strings.xml (duplicate app_name dropped). The watch unit tests move with them (WearAgendaTest, plus new FormFactorTest); the wear WearCalendarProtocolTest copy is dropped because :calendar already pins the same golden JSON. Watch screenshot previews become ui/WearMetadataPreviews with group=wear, so :calendar:metadata renders them into metadata_data/photos/calendar/wear/ (the old calendar-wear bucket's captures move there unchanged). The calendar-wear module and its settings include are deleted; root, calendar, and library/wearlink AGENTS.md describe the merged state. Verified on devvm21958 in worktree wt-wear-calendar (base de47de281): :calendar:lint and :calendar:lintVitalRelease green; :calendar:testDevUnitTest runs 335 tests with 2 failures in ImportGlanceHolidayTest (holiday toggle picker) — proven pre-existing by running the same test class on a clean HEAD worktree, where it fails identically (12 tests, 2 failed) with no wear changes present. 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 d97e787814..52076c32e1 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` and `notes` are single merged APKs for phone and watch (watch experience inside `clock/` and `notes/` respectively; the other `*-wear` modules are separate companion APKs with the phone app's applicationId/signing).+`clock` and `calendar` are single merged APKs for phone and watch (watch experience inside `clock/` / `calendar/`; 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`).
calendar-wear/AGENTS.md
diff --git a/calendar-wear/AGENTS.md b/calendar-wear/AGENTS.mddeleted file mode 100644index e6797229a4..0000000000--- a/calendar-wear/AGENTS.md+++ /dev/null@@ -1,40 +0,0 @@-# AGENTS.md — calendar-wear/ (':calendar:wear')--> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside-> `calendar-wear/` + `calendar/` (the phone side of the same feature).--- Gradle: :calendar:wear (dir calendar-wear/) / dir: calendar-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 Calendar (`:calendar`). This module-deliberately uses `applicationId = "com.vayunmathur.calendar"` (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.calendar.WearCalendarProtocol` (shared by-`:calendar` and `:calendar:wear`; neither app module depends on the other).-Each side's `WearCalendarProtocolTest` pins the same golden JSON against-that shared code.--- Snapshot + watch-state sync: conduit data items (`/calendar/snapshot`, `/calendar/watch-state`)-- Sync request: conduit message (`/calendar/request-sync`), watch -> phone only-- Transport: Watch conduit client — `sync/WearLinkBridge.kt` uses `WearLinkClientNode` (Messenger to the Watch app's `watch_conduit` service, appId `calendar`); this app owns no RFCOMM link and holds no Bluetooth permission for this channel, so `WearMainActivity` never prompts for Bluetooth. With the Watch app absent the bridge stays `NotInstalled`/`Unavailable` and everything renders from the persisted store. App-lifecycle-bound (no Play services, no listener service)--## What the watch can and cannot do-Read-only. It renders today's agenda, upcoming events and event detail from-its locally stored snapshot, offline. There is no event editing or RSVP:-the phone model has no attendee/self-status for local calendars, so no-watch action claims to change an event. The one watch-originated write is-asking the phone for a fresh snapshot.--## Verify (this module only)-```-./gradlew :calendar:wear:assembleDev-./gradlew :calendar:wear:testDebugUnitTest-```
calendar-wear/build.gradle.kts
diff --git a/calendar-wear/build.gradle.kts b/calendar-wear/build.gradle.ktsdeleted file mode 100644index cfbc9b9447..0000000000--- a/calendar-wear/build.gradle.kts+++ /dev/null@@ -1,31 +0,0 @@-plugins {- id("common-conventions-wear")- id("common-conventions-preview-metadata")-}--launcherIcon {- symbol = "calendar_month"-}--android {- // The Wearable Data Layer 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.calendar.wear"- defaultConfig {- applicationId = "com.vayunmathur.calendar"- // Convention defaults to 30, but :library:log (pulled in by the wear- // convention) requires 31, so the watch floor is 31.- minSdk = 31- }-}--dependencies {- // Watch side of the Wear OS sync (protocol in :library:wearlink).- implementation(libs.kotlinx.coroutines.android)- implementation(project(":library:wearlink"))- testImplementation(libs.kotlin.test)- testImplementation(libs.kotlin.test.junit)-}
calendar-wear/src/main/AndroidManifest.xml
diff --git a/calendar-wear/src/main/AndroidManifest.xml b/calendar-wear/src/main/AndroidManifest.xmldeleted file mode 100644index 7ccb8c3001..0000000000--- a/calendar-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>
calendar-wear/src/main/res/values/colors.xml
diff --git a/calendar-wear/src/main/res/values/colors.xml b/calendar-wear/src/main/res/values/colors.xmldeleted file mode 100644index bfc7025d71..0000000000--- a/calendar-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>
calendar-wear/src/test/java/com/vayunmathur/calendar/wear/domain/WearCalendarProtocolTest.kt
diff --git a/calendar-wear/src/test/java/com/vayunmathur/calendar/wear/domain/WearCalendarProtocolTest.kt b/calendar-wear/src/test/java/com/vayunmathur/calendar/wear/domain/WearCalendarProtocolTest.ktdeleted file mode 100644index fae00aff2b..0000000000--- a/calendar-wear/src/test/java/com/vayunmathur/calendar/wear/domain/WearCalendarProtocolTest.kt+++ /dev/null@@ -1,117 +0,0 @@-package com.vayunmathur.calendar.wear.domain-import com.vayunmathur.library.wearlink.calendar.WearCalendarEvent-import com.vayunmathur.library.wearlink.calendar.WearCalendarProtocol-import com.vayunmathur.library.wearlink.calendar.WearCalendarSnapshot-import com.vayunmathur.library.wearlink.calendar.buildWearSnapshot-import com.vayunmathur.library.wearlink.calendar.wearCompanionPresent--import kotlin.test.Test-import kotlin.test.assertEquals-import kotlin.test.assertFalse-import kotlin.test.assertTrue-import kotlinx.serialization.encodeToString--class WearCalendarProtocolTest {-- private fun event(- id: Long,- start: Long,- end: Long = start + 3_600_000L,- title: String = "Event $id",- description: String = "",- ) = WearCalendarEvent(- eventId = id,- title = title,- location = "Room $id",- description = description,- calendarName = "Personal",- color = 7,- startMillis = start,- endMillis = end,- timezone = "UTC",- )-- @Test- fun goldenSnapshotJson() {- val snapshot = WearCalendarSnapshot(- generatedAtMillis = 1_000L,- windowStartMillis = 2_000L,- windowEndMillis = 3_000L,- events = listOf(event(42L, 2_500L)),- truncated = false,- )- assertEquals(- """{"generatedAtMillis":1000,"windowStartMillis":2000,"windowEndMillis":3000,""" +- """"events":[{"eventId":42,"title":"Event 42","location":"Room 42",""" +- """"calendarName":"Personal","color":7,"startMillis":2500,""" +- """"endMillis":3602500}]}""",- WearCalendarProtocol.json.encodeToString(snapshot),- )- }-- @Test- fun snapshotRoundTrips() {- val snapshot = WearCalendarSnapshot(- generatedAtMillis = 9L,- windowStartMillis = 10L,- windowEndMillis = 20L,- events = listOf(event(1L, 12L), event(2L, 14L)),- truncated = true,- )- val decoded = WearCalendarProtocol.json.decodeFromString<WearCalendarSnapshot>(- WearCalendarProtocol.json.encodeToString(snapshot),- )- assertEquals(snapshot, decoded)- }-- @Test- fun buildKeepsOnlyWindowAndSortsByStart() {- val snapshot = buildWearSnapshot(- candidates = listOf(- event(3L, 5_000L),- event(1L, 3_000L),- event(9L, 500L, end = 900L), // over before window- event(8L, 9_500L), // starts after window- ),- generatedAtMillis = 1_000L,- windowStartMillis = 1_000L,- windowEndMillis = 9_000L,- )- assertEquals(listOf(1L, 3L), snapshot.events.map { it.eventId })- assertFalse(snapshot.truncated)- }-- @Test- fun buildCapsEventCountAndMarksTruncated() {- val candidates = (1L..(WearCalendarProtocol.MAX_EVENTS + 50L)).map {- event(it, 1_000L + it * 1_000L)- }- val snapshot = buildWearSnapshot(candidates, 0L, 0L, Long.MAX_VALUE)- assertEquals(WearCalendarProtocol.MAX_EVENTS, snapshot.events.size)- assertTrue(snapshot.truncated)- // Earliest kept: today's agenda survives longest.- assertEquals(1L, snapshot.events.first().eventId)- }-- @Test- fun buildCapsFieldLengthsAndTotalBytes() {- val longTitle = "x".repeat(WearCalendarProtocol.MAX_TITLE_CHARS + 100)- val candidates = (1L..300L).map {- event(it, 1_000L + it * 1_000L, title = longTitle, description = "d".repeat(500))- }- val snapshot = buildWearSnapshot(candidates, 0L, 0L, Long.MAX_VALUE)- assertTrue(snapshot.events.all {- it.title.length == WearCalendarProtocol.MAX_TITLE_CHARS &&- it.description.length == WearCalendarProtocol.MAX_DESCRIPTION_CHARS- })- val bytes = WearCalendarProtocol.json.encodeToString(snapshot).encodeToByteArray().size- assertTrue(bytes <= WearCalendarProtocol.MAX_JSON_BYTES, "snapshot $bytes bytes over cap")- assertTrue(snapshot.truncated)- }-- @Test- fun capabilityAbsentMeansNoCompanion() {- assertFalse(wearCompanionPresent(emptyList()))- assertTrue(wearCompanionPresent(listOf("node-1")))- }-}
calendar/AGENTS.md
diff --git a/calendar/AGENTS.md b/calendar/AGENTS.mdindex a0e10680f5..e6abe7e18e 100644--- a/calendar/AGENTS.md+++ b/calendar/AGENTS.md@@ -4,9 +4,9 @@ _Install: ./install calendar (dev by default)._ - Gradle: :calendar / dir: calendar/-- Package roots present: ui, data, intents, sync-- Entry files: MainActivity.kt (no Route.kt — single-screen app with dialogs, not nav destinations)-- Deps: :library:widgets, :library:wearlink+- Package roots present: ui, data, domain, platform, intents, sync, widget+- Entry files: MainActivity.kt (sole launcher; routes watches to ui/WearMainActivity), ui/WearMainActivity.kt+- Deps: :library:widgets, :library:wearlink, Wear Compose (material + foundation) - Metadata: metadata_data/calendar.md (present) - Rust: no / screenshotTest: yes @@ -17,18 +17,38 @@ _Install: ./install calendar (dev by default)._ - `.ics` import (files shared from anywhere) + export; holiday calendars via generated data (`scripts/calendar`) — the holiday screen toggles each country: single-language countries enable/disable directly, multi-language countries open the language picker when toggled on and simply disable when toggled off - Exact-alarm reminders rescheduled after reboot (`ReminderScheduler` + `BootReceiver`) - Self-refreshing Glance widgets (agenda + month); assistant read/add via `intents/`-**Architecture / data-flow:** `ui/` screens + `ui/dialogs/` editors → `util/CalendarViewModel` (+ `CalendarUiContract`) → `data/` models (`Calendar`/`Event`/`Instance`/`ReminderMirror`); reminders flow ViewModel → `ReminderScheduler` → `ReminderReceiver` → notification, re-armed on boot.-**Entry points + reading order:** `MainActivity.kt` → `ui/CalendarScreen.kt` → `util/CalendarViewModel.kt` → `data/Event.kt` + `data/Instance.kt` → `util/RRule.kt` → `util/ReminderScheduler.kt`.+**Architecture / data-flow:** `ui/` screens + `ui/dialogs/` editors → `platform/CalendarViewModel` (+ `CalendarUiContract`) → `data/` models (`Calendar`/`Event`/`Instance`/`ReminderMirror`); reminders flow ViewModel → `platform/ReminderScheduler` → `platform/ReminderReceiver` → notification, re-armed on boot.+**Entry points + reading order:** `MainActivity.kt` → `ui/CalendarScreen.kt` → `platform/CalendarViewModel.kt` → `data/Event.kt` + `data/Instance.kt` → `domain/RRule.kt` → `platform/ReminderScheduler.kt`.++## One APK, two form factors (phone + watch)+This module is the single Calendar APK for phones and watches: same+`applicationId = "com.vayunmathur.calendar"` and signing on both, as the+WearLink handshake requires. The manifest 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. `platform/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 month/agenda UI. The phone+`platform/BootReceiver` and `platform/ReminderReceiver` each gate on+`FormFactor` and return immediately on a watch. ## Wear sync (Watch conduit client)-**Protocol:** shared wire types live in `:library:wearlink` at `com.vayunmathur.library.wearlink.calendar.WearCalendarProtocol` (also consumed by `:calendar:wear`); the golden-JSON tests pin the shared code's wire format.+**Protocol:** shared wire types live in `:library:wearlink` at `com.vayunmathur.library.wearlink.calendar.WearCalendarProtocol`; the golden-JSON tests in this module pin the shared code's wire format. - Snapshot + watch-state sync: conduit data items (`/calendar/snapshot` phone -> watch, `/calendar/watch-state` watch -> phone) - Sync request: conduit message (`/calendar/request-sync`), watch -> phone only-- **Transport: Watch conduit client** — `sync/WearCalendarSync.kt` uses `WearLinkClientNode` (Messenger to the Watch app's `watch_conduit` service, appId `calendar`); this app owns no RFCOMM link and holds no Bluetooth permission for this channel, so `MainActivity` never prompts for Bluetooth. With the Watch app absent the node reports `NotInstalled`/`Unavailable` and the sync stays idle; snapshots republish on conduit `Connected` and on calendar changes.+- **Transport: Watch conduit client** — phone side `sync/WearCalendarSync.kt` and watch side `sync/WearLinkBridge.kt` both use `WearLinkClientNode` (Messenger to the Watch app's `watch_conduit` service, appId `calendar`); this app owns no RFCOMM link and holds no Bluetooth permission for this channel, so neither entry activity prompts for Bluetooth. With the Watch app absent the node reports `NotInstalled`/`Unavailable` and the sync stays idle; snapshots republish on conduit `Connected` and on calendar changes. `FormFactor` picks the side at runtime, so only one of the two nodes runs on a given device.+**Watch experience:**+- `ui/WearMainActivity` routes `ui/WearRoute` over the agenda (`ui/WearAgendaScreen`) and read-only event detail (`ui/WearEventScreen`), rendered from `data/WearCalendarStore` (`wear-calendar-snapshot.json`); sectioning is `domain/wearAgenda`. The watch has no event editing or RSVP; its one write is `sync/requestWearSync` asking the phone for a fresh snapshot.+- Watch listing screenshots are the `group = "wear"` previews in `src/screenshotTest/.../ui/WearMetadataPreviews.kt`, collected by `:calendar:metadata` into `metadata_data/photos/calendar/wear/`; phone shots use the `phone` bucket. **Gotchas:** - `util/` is NOT a closed package root — don't add more files there - Holiday data is generated by `scripts/calendar`, not hand-written — regenerate, don't edit - Reminder alarms must be re-registered on boot; test the `BootReceiver` path, not just in-app scheduling+- Phone and watch share one APK and one signing identity: never split the watch experience back into a separate module or applicationId, or the WearLink handshake breaks ## Key files ### Root — entry (no Route.kt)@@ -83,8 +103,16 @@ _Install: ./install calendar (dev by default)._ - com/vayunmathur/calendar/ui/dialogs/SettingsDeleteCalendarDialog.kt - com/vayunmathur/calendar/ui/dialogs/SettingsRenameCalendarDialog.kt - com/vayunmathur/calendar/ui/dialogs/TimezonePickerDialog.kt-### sync/ — wear companion sync-- com/vayunmathur/calendar/sync/WearCalendarSync.kt — conduit client node; snapshot publish, watch-state receive, request-sync handling+### sync/ — wear companion sync (both sides, one APK)+- com/vayunmathur/calendar/sync/WearCalendarSync.kt — phone conduit client node; snapshot publish, watch-state receive, request-sync handling+- com/vayunmathur/calendar/sync/WearLinkBridge.kt — watch conduit client node; snapshot receive into the store, watch-state publish+- com/vayunmathur/calendar/sync/WearSyncRequest.kt — `requestWearSync` helper (watch asks phone for a fresh snapshot)+### Watch experience (ui/ + data/ + domain/ + platform/)+- com/vayunmathur/calendar/ui/WearMainActivity.kt — watch entry (agenda + event detail from the synced store)+- com/vayunmathur/calendar/ui/WearRoute.kt, WearAgendaScreen.kt, WearEventScreen.kt+- com/vayunmathur/calendar/data/WearCalendarStore.kt — persisted watch snapshot (`wear-calendar-snapshot.json`)+- com/vayunmathur/calendar/domain/WearAgenda.kt — today/upcoming sectioning for the watch agenda+- com/vayunmathur/calendar/platform/FormFactor.kt — watch detection (`FEATURE_WATCH`) ### glance/ + intents/ — widgets and assistant IPC - com/vayunmathur/calendar/glance/CalendarGlanceWidget.kt - com/vayunmathur/calendar/glance/CalendarGlanceWidgetReceiver.kt
calendar/build.gradle.kts
diff --git a/calendar/build.gradle.kts b/calendar/build.gradle.ktsindex d6284da243..2cfe22fc9e 100644--- a/calendar/build.gradle.kts+++ b/calendar/build.gradle.kts@@ -17,10 +17,14 @@ android { dependencies { implementation(project(":library:widgets"))+ // Both sides of the Wear OS sync live in this one APK (same+ // applicationId and signing, as the WearLink handshake requires):+ // sync/WearCalendarSync publishes the phone snapshot, sync/WearLinkBridge+ // receives it on a watch. FormFactor picks the side at runtime. implementation(project(":library:wearlink"))- // Phone side of the Wear OS sync (sync/WearCalendarSync): capability- // discovery and snapshot publish to :calendar-wear, which shares this- // app's applicationId and signing certificate.+ // Watch experience (ui/Wear*): Wear Compose for the round agenda UI.+ implementation(libs.androidx.wear.compose.material)+ implementation(libs.androidx.wear.compose.foundation) implementation(libs.kotlinx.coroutines.android) testImplementation(libs.androidx.glance.testing) testImplementation(libs.androidx.glance.appwidget.testing)
calendar/src/main/AndroidManifest.xml
diff --git a/calendar/src/main/AndroidManifest.xml b/calendar/src/main/AndroidManifest.xmlindex 5700f4cd24..ff32a2db50 100644--- a/calendar/src/main/AndroidManifest.xml+++ b/calendar/src/main/AndroidManifest.xml@@ -8,6 +8,21 @@ <!-- Sensors permission at install instead of auto-granting it. --> <uses-permission android:name="com.vayunmathur.permission.SENSORS_OPTOUT" /> + <!-- 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" />+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" tools:node="remove" /> <uses-permission android:name="android.permission.READ_CALENDAR" />@@ -36,6 +51,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:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:name="MainActivity"@@ -170,6 +190,15 @@ android:theme="@android:style/Theme.NoDisplay" android:permission="com.vayunmathur.calendar.permissions.ACCESS_CALENDAR"> </activity>++ <!-- Watch experience: entered only via MainActivity's watch routing+ (no launcher filter of its own). It renders from the watch's+ synced store and is inert on a phone. -->+ <activity+ android:name=".ui.WearMainActivity"+ android:exported="false"+ android:taskAffinity=""+ android:theme="@android:style/Theme.Material.NoActionBar" /> </application> </manifest>\ No newline at end of file
calendar/src/main/java/com/vayunmathur/calendar/MainActivity.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/MainActivity.kt b/calendar/src/main/java/com/vayunmathur/calendar/MainActivity.ktindex dbb311e9ac..b5e2ec7eeb 100644--- a/calendar/src/main/java/com/vayunmathur/calendar/MainActivity.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/MainActivity.kt@@ -1,6 +1,7 @@ package com.vayunmathur.calendar import android.content.Intent+import android.os.Bundle import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue@@ -9,11 +10,13 @@ import androidx.compose.runtime.remember import androidx.lifecycle.lifecycleScope import com.vayunmathur.calendar.data.Instance import com.vayunmathur.calendar.platform.CalendarViewModel+import com.vayunmathur.calendar.platform.FormFactor import com.vayunmathur.calendar.platform.ReminderFallback import com.vayunmathur.calendar.platform.ReminderScheduler import com.vayunmathur.calendar.platform.editEventFromIntent import com.vayunmathur.calendar.platform.isTimeEpochIntent import com.vayunmathur.calendar.ui.CalendarAppContent+import com.vayunmathur.calendar.ui.WearMainActivity import com.vayunmathur.calendar.ui.readSharedIcsEvents import com.vayunmathur.calendar.widget.CalendarGlanceWidgetReceiver import com.vayunmathur.library.log.Log@@ -32,16 +35,33 @@ import kotlinx.datetime.toLocalDateTime import kotlinx.serialization.json.Json /**- * Calendar entry activity: hosts the navigation graph, applies the pinned light/dark- * choice, and routes intent extras into pending navigation state.+ * Sole launcher entry of the single merged Calendar APK. On a watch (the+ * `android.hardware.type.watch` system feature, see [FormFactor]) it hands+ * off to [WearMainActivity] and finishes before any phone state (calendar+ * provider, phone sync, widgets) is touched; on a phone it hosts the+ * navigation graph, applies the pinned light/dark choice, and routes intent+ * extras into pending navigation state. */ 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()+ }+ } private val importUris = mutableStateOf<List<String>>(emptyList()) private val pendingRoute = mutableStateOf<Route?>(null) private val pendingReminderFallback = mutableStateOf<ReminderFallback?>(null) private val pendingDate = mutableStateOf<LocalDate?>(null) override fun onCreateBeforeContent() {+ if (routedToWear) return // No Bluetooth prompt here: the Watch app owns the conduit link // and its permission. Wear sync runs over WearLinkClientNode via // CalendarViewModel; with the Watch app absent it reports@@ -73,6 +93,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 CalendarAppContent( activityIntent = intent, importUris = importUris,@@ -83,6 +106,7 @@ class MainActivity : MaActivity() { } override fun onNewIntent(intent: Intent) {+ if (routedToWear) return super.onNewIntent(intent) setIntent(intent) handleIntent(intent)
calendar/src/main/java/com/vayunmathur/calendar/data/WearCalendarStore.kt
diff --git a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/data/WearCalendarStore.kt b/calendar/src/main/java/com/vayunmathur/calendar/data/WearCalendarStore.ktsimilarity index 95%rename from calendar-wear/src/main/java/com/vayunmathur/calendar/wear/data/WearCalendarStore.ktrename to calendar/src/main/java/com/vayunmathur/calendar/data/WearCalendarStore.ktindex 1230fe8a1c..d39f916aee 100644--- a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/data/WearCalendarStore.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/data/WearCalendarStore.kt@@ -1,10 +1,10 @@-package com.vayunmathur.calendar.wear.data+package com.vayunmathur.calendar.data import android.content.Context import com.vayunmathur.library.wearlink.calendar.WearCalendarProtocol import com.vayunmathur.library.wearlink.calendar.WearCalendarSnapshot import com.vayunmathur.library.wearlink.calendar.WearWatchState-import com.vayunmathur.calendar.wear.sync.WearLinkBridge+import com.vayunmathur.calendar.sync.WearLinkBridge import com.vayunmathur.library.log.Log import java.io.File import kotlinx.coroutines.flow.MutableStateFlow
calendar/src/main/java/com/vayunmathur/calendar/domain/WearAgenda.kt
diff --git a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/domain/WearAgenda.kt b/calendar/src/main/java/com/vayunmathur/calendar/domain/WearAgenda.ktsimilarity index 98%rename from calendar-wear/src/main/java/com/vayunmathur/calendar/wear/domain/WearAgenda.ktrename to calendar/src/main/java/com/vayunmathur/calendar/domain/WearAgenda.ktindex ca5eec0e8c..7c13528b39 100644--- a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/domain/WearAgenda.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/domain/WearAgenda.kt@@ -1,4 +1,4 @@-package com.vayunmathur.calendar.wear.domain+package com.vayunmathur.calendar.domain import com.vayunmathur.library.wearlink.calendar.WearCalendarEvent import com.vayunmathur.library.wearlink.calendar.WearCalendarSnapshot
calendar/src/main/java/com/vayunmathur/calendar/platform/BootReceiver.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/platform/BootReceiver.kt b/calendar/src/main/java/com/vayunmathur/calendar/platform/BootReceiver.ktindex e67eebcb23..5fc7e2f770 100644--- a/calendar/src/main/java/com/vayunmathur/calendar/platform/BootReceiver.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/platform/BootReceiver.kt@@ -29,6 +29,8 @@ import kotlinx.coroutines.launch */ class BootReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) {+ // Phone experience only: the watch renders from its synced store and arms no reminders.+ if (FormFactor.isWatch(context)) return when (intent.action) { Intent.ACTION_BOOT_COMPLETED, Intent.ACTION_LOCKED_BOOT_COMPLETED,
calendar/src/main/java/com/vayunmathur/calendar/platform/FormFactor.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/platform/FormFactor.kt b/calendar/src/main/java/com/vayunmathur/calendar/platform/FormFactor.ktnew file mode 100644index 0000000000..c75d3ee018--- /dev/null+++ b/calendar/src/main/java/com/vayunmathur/calendar/platform/FormFactor.kt@@ -0,0 +1,25 @@+package com.vayunmathur.calendar.platform++import android.content.Context+import android.content.pm.PackageManager++/**+ * Runtime form-factor detection for the single merged Calendar 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+}
calendar/src/main/java/com/vayunmathur/calendar/platform/ReminderReceiver.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/platform/ReminderReceiver.kt b/calendar/src/main/java/com/vayunmathur/calendar/platform/ReminderReceiver.ktindex 37fbe0adff..7a60ef8eb5 100644--- a/calendar/src/main/java/com/vayunmathur/calendar/platform/ReminderReceiver.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/platform/ReminderReceiver.kt@@ -27,6 +27,8 @@ import java.util.Date */ class ReminderReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) {+ // Phone experience only: reminder alarms are armed by the phone scheduler.+ if (FormFactor.isWatch(context)) return val eventId = intent.getLongExtra(ReminderScheduler.EXTRA_EVENT_ID, -1L) val title = intent.getStringExtra(ReminderScheduler.EXTRA_TITLE) ?.takeIf { it.isNotBlank() }
calendar/src/main/java/com/vayunmathur/calendar/sync/WearLinkBridge.kt
diff --git a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/sync/WearLinkBridge.kt b/calendar/src/main/java/com/vayunmathur/calendar/sync/WearLinkBridge.ktsimilarity index 96%rename from calendar-wear/src/main/java/com/vayunmathur/calendar/wear/sync/WearLinkBridge.ktrename to calendar/src/main/java/com/vayunmathur/calendar/sync/WearLinkBridge.ktindex 0587bb2db2..29abb2793d 100644--- a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/sync/WearLinkBridge.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/sync/WearLinkBridge.kt@@ -1,7 +1,7 @@-package com.vayunmathur.calendar.wear.sync+package com.vayunmathur.calendar.sync import android.content.Context-import com.vayunmathur.calendar.wear.data.WearCalendarStore+import com.vayunmathur.calendar.data.WearCalendarStore import com.vayunmathur.library.wearlink.calendar.WearCalendarProtocol import com.vayunmathur.library.wearlink.calendar.WearCalendarSnapshot import com.vayunmathur.library.wearlink.calendar.WearWatchState
calendar/src/main/java/com/vayunmathur/calendar/sync/WearSyncRequest.kt
diff --git a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/sync/WearSyncRequest.kt b/calendar/src/main/java/com/vayunmathur/calendar/sync/WearSyncRequest.ktsimilarity index 89%rename from calendar-wear/src/main/java/com/vayunmathur/calendar/wear/sync/WearSyncRequest.ktrename to calendar/src/main/java/com/vayunmathur/calendar/sync/WearSyncRequest.ktindex 5e5bded470..cc9ec62215 100644--- a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/sync/WearSyncRequest.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/sync/WearSyncRequest.kt@@ -1,4 +1,4 @@-package com.vayunmathur.calendar.wear.sync+package com.vayunmathur.calendar.sync import android.content.Context
calendar/src/main/java/com/vayunmathur/calendar/ui/WearAgendaScreen.kt
diff --git a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/ui/WearAgendaScreen.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/WearAgendaScreen.ktsimilarity index 95%rename from calendar-wear/src/main/java/com/vayunmathur/calendar/wear/ui/WearAgendaScreen.ktrename to calendar/src/main/java/com/vayunmathur/calendar/ui/WearAgendaScreen.ktindex 377ff7ec2f..a05a85d1d9 100644--- a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/ui/WearAgendaScreen.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/WearAgendaScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.calendar.wear.ui+package com.vayunmathur.calendar.ui import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -21,13 +21,13 @@ 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.calendar.wear.R-import com.vayunmathur.calendar.wear.data.WearCalendarStore+import com.vayunmathur.calendar.R+import com.vayunmathur.calendar.data.WearCalendarStore import com.vayunmathur.library.wearlink.calendar.WearCalendarEvent import com.vayunmathur.library.wearlink.calendar.WearCalendarSnapshot-import com.vayunmathur.calendar.wear.domain.wearAgenda-import com.vayunmathur.calendar.wear.domain.wearEventDay-import com.vayunmathur.calendar.wear.sync.requestWearSync+import com.vayunmathur.calendar.domain.wearAgenda+import com.vayunmathur.calendar.domain.wearEventDay+import com.vayunmathur.calendar.sync.requestWearSync import kotlinx.coroutines.launch import kotlinx.datetime.TimeZone import kotlinx.datetime.format
calendar/src/main/java/com/vayunmathur/calendar/ui/WearEventScreen.kt
diff --git a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/ui/WearEventScreen.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/WearEventScreen.ktsimilarity index 97%rename from calendar-wear/src/main/java/com/vayunmathur/calendar/wear/ui/WearEventScreen.ktrename to calendar/src/main/java/com/vayunmathur/calendar/ui/WearEventScreen.ktindex 4ab8d28137..bc2a3341af 100644--- a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/ui/WearEventScreen.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/WearEventScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.calendar.wear.ui+package com.vayunmathur.calendar.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.calendar.wear.R-import com.vayunmathur.calendar.wear.data.WearCalendarStore+import com.vayunmathur.calendar.R+import com.vayunmathur.calendar.data.WearCalendarStore import com.vayunmathur.library.wearlink.calendar.WearCalendarEvent import kotlinx.datetime.TimeZone import kotlin.time.Instant
calendar/src/main/java/com/vayunmathur/calendar/ui/WearMainActivity.kt
diff --git a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/ui/WearMainActivity.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/WearMainActivity.ktsimilarity index 91%rename from calendar-wear/src/main/java/com/vayunmathur/calendar/wear/ui/WearMainActivity.ktrename to calendar/src/main/java/com/vayunmathur/calendar/ui/WearMainActivity.ktindex a2fd5099b7..dc9ea0db66 100644--- a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/ui/WearMainActivity.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/WearMainActivity.kt@@ -1,4 +1,4 @@-package com.vayunmathur.calendar.wear.ui+package com.vayunmathur.calendar.ui import android.os.Bundle import androidx.activity.ComponentActivity@@ -8,7 +8,7 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.wear.compose.material.MaterialTheme-import com.vayunmathur.calendar.wear.data.WearCalendarStore+import com.vayunmathur.calendar.data.WearCalendarStore /** * Watch calendar entry: agenda list and event detail, rendered only from the@@ -22,7 +22,7 @@ class WearMainActivity : ComponentActivity() { // and its permission. With the Watch app absent the bridge stays // NotInstalled/Unavailable and the local store keeps working. val store = WearCalendarStore.get(this)- com.vayunmathur.calendar.wear.sync.WearLinkBridge.get(this)+ com.vayunmathur.calendar.sync.WearLinkBridge.get(this) store.publishWatchState() setContent { MaterialTheme {
calendar/src/main/java/com/vayunmathur/calendar/ui/WearRoute.kt
diff --git a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/ui/WearRoute.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/WearRoute.ktsimilarity index 90%rename from calendar-wear/src/main/java/com/vayunmathur/calendar/wear/ui/WearRoute.ktrename to calendar/src/main/java/com/vayunmathur/calendar/ui/WearRoute.ktindex 177462ed7f..ac6ed96fd3 100644--- a/calendar-wear/src/main/java/com/vayunmathur/calendar/wear/ui/WearRoute.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/WearRoute.kt@@ -1,4 +1,4 @@-package com.vayunmathur.calendar.wear.ui+package com.vayunmathur.calendar.ui /** Watch navigation destinations: detail is a route carrying the event key, never selection state. */ sealed interface WearRoute {
calendar/src/main/res/values/wear_strings.xml
diff --git a/calendar-wear/src/main/res/values/strings.xml b/calendar/src/main/res/values/wear_strings.xmlsimilarity index 93%rename from calendar-wear/src/main/res/values/strings.xmlrename to calendar/src/main/res/values/wear_strings.xmlindex 645a223e49..55bde6ccd8 100644--- a/calendar-wear/src/main/res/values/strings.xml+++ b/calendar/src/main/res/values/wear_strings.xml@@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <resources>- <string name="app_name">Calendar</string> <string name="wear_empty">No events synced yet. Open Calendar on your phone to sync this watch.</string> <string name="wear_today">Today</string> <string name="wear_upcoming">Upcoming</string>
calendar/src/screenshotTest/kotlin/com/vayunmathur/calendar/ui/WearMetadataPreviews.kt
diff --git a/calendar-wear/src/screenshotTest/kotlin/com/vayunmathur/calendar/wear/ui/MetadataPreviews.kt b/calendar/src/screenshotTest/kotlin/com/vayunmathur/calendar/ui/WearMetadataPreviews.ktsimilarity index 90%rename from calendar-wear/src/screenshotTest/kotlin/com/vayunmathur/calendar/wear/ui/MetadataPreviews.ktrename to calendar/src/screenshotTest/kotlin/com/vayunmathur/calendar/ui/WearMetadataPreviews.ktindex 19959d1f77..833e3db1c9 100644--- a/calendar-wear/src/screenshotTest/kotlin/com/vayunmathur/calendar/wear/ui/MetadataPreviews.kt+++ b/calendar/src/screenshotTest/kotlin/com/vayunmathur/calendar/ui/WearMetadataPreviews.kt@@ -1,4 +1,4 @@-package com.vayunmathur.calendar.wear.ui+package com.vayunmathur.calendar.ui import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box@@ -26,10 +26,10 @@ private val fixtureEvents = listOf( ) /**- * Store listing images for `:calendar:wear` — every top-level screen (agenda, event detail).- * `./gradlew :calendar:wear:metadata` copies renders into `metadata_data/photos/calendar-wear/wear/`.+ * Store listing images for `:calendar` — every top-level screen (agenda, event detail).+ * `./gradlew :calendar:metadata` copies renders into `metadata_data/photos/calendar/wear/`. */-class MetadataPreviews {+class WearMetadataPreviews { @PreviewTest @Preview(name = "1-agenda-round", device = ROUND, group = "wear")
calendar/src/test/java/com/vayunmathur/calendar/domain/WearAgendaTest.kt
diff --git a/calendar-wear/src/test/java/com/vayunmathur/calendar/wear/domain/WearAgendaTest.kt b/calendar/src/test/java/com/vayunmathur/calendar/domain/WearAgendaTest.ktsimilarity index 98%rename from calendar-wear/src/test/java/com/vayunmathur/calendar/wear/domain/WearAgendaTest.ktrename to calendar/src/test/java/com/vayunmathur/calendar/domain/WearAgendaTest.ktindex b8e2abb45e..ba3c0e466e 100644--- a/calendar-wear/src/test/java/com/vayunmathur/calendar/wear/domain/WearAgendaTest.kt+++ b/calendar/src/test/java/com/vayunmathur/calendar/domain/WearAgendaTest.kt@@ -1,4 +1,4 @@-package com.vayunmathur.calendar.wear.domain+package com.vayunmathur.calendar.domain import com.vayunmathur.library.wearlink.calendar.WearCalendarEvent import com.vayunmathur.library.wearlink.calendar.WearCalendarSnapshot
calendar/src/test/java/com/vayunmathur/calendar/platform/FormFactorTest.kt
diff --git a/calendar/src/test/java/com/vayunmathur/calendar/platform/FormFactorTest.kt b/calendar/src/test/java/com/vayunmathur/calendar/platform/FormFactorTest.ktnew file mode 100644index 0000000000..2e352e70cd--- /dev/null+++ b/calendar/src/test/java/com/vayunmathur/calendar/platform/FormFactorTest.kt@@ -0,0 +1,19 @@+package com.vayunmathur.calendar.platform++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/AGENTS.md
diff --git a/library/wearlink/AGENTS.md b/library/wearlink/AGENTS.mdindex 1565ba8c77..8cdcf053aa 100644--- a/library/wearlink/AGENTS.md+++ b/library/wearlink/AGENTS.md@@ -34,9 +34,8 @@ unregistered apps, status fan-out, counters), `WearLinkClientNode` (drop-in `WearLinkNode` replacement over the conduit binding; reports `NotInstalled`/`Unavailable` when the Watch app is absent), and `ConduitHost`/`ConduitRuntime` used by the two Watch apps'-`ConduitService`s. Clock ships as one merged `:clock` APK whose phone and watch-experiences both use the client, and the calendar pair-(`:calendar` / `:calendar:wear`) has migrated to the client; the remaining app pairs still own their `WearLinkNode`s, and+`ConduitService`s. Clock and Calendar each ship as one merged APK (`:clock`, `:calendar`)+whose phone and watch experiences both use the client; the remaining app pairs still own their `WearLinkNode`s, and this module's manifest Bluetooth permissions stay until they migrate. ## Verify
metadata_data/photos/calendar/wear/1.png
diff --git a/metadata_data/photos/calendar-wear/wear/1.png b/metadata_data/photos/calendar/wear/1.pngsimilarity index 100%rename from metadata_data/photos/calendar-wear/wear/1.pngrename to metadata_data/photos/calendar/wear/1.png
metadata_data/photos/calendar/wear/2.png
diff --git a/metadata_data/photos/calendar-wear/wear/2.png b/metadata_data/photos/calendar/wear/2.pngsimilarity index 100%rename from metadata_data/photos/calendar-wear/wear/2.pngrename to metadata_data/photos/calendar/wear/2.png
settings.gradle.kts
diff --git a/settings.gradle.kts b/settings.gradle.ktsindex 02f2689b89..d8b9e74488 100644--- a/settings.gradle.kts+++ b/settings.gradle.kts@@ -88,8 +88,6 @@ include(":watch:wear") project(":watch:wear").projectDir = file("watch-wear") include(":library:carhost") include(":calendar")-include(":calendar:wear")-project(":calendar:wear").projectDir = file("calendar-wear") include(":contacts") include(":contacts-wear") include(":pdf")