Modern Apps git

← Modern-Apps.git

weather: merge weather-wear into the single weather APK

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

The merged :weather APK keeps applicationId com.vayunmathur.weather
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 (network client, forecast
repository, widget previews) is touched, and phones keep the existing
tab UI. The Glance widget receivers are a phone-only surface and
early-return on a watch. The WearLink sync is unchanged:
WearWeatherSync publishes /weather/snapshot from the phone
experience, WearLinkBridge receives it in the watch experience,
capability weather_wear_companion.

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 weather-wear sources move into weather's closed package roots
(wear/data -> data, wear/domain -> domain, wear/platform ->
platform, wear/sync -> sync, wear/ui -> ui as Wear*), R references
retarget to com.vayunmathur.weather.R, and wear strings merge as
res/values/wear_strings.xml (duplicate app_name dropped). The watch
unit tests move with them; the wear WearWeatherProtocolTest copy
is dropped because :weather already pins the same golden JSON.
Watch screenshot previews become ui/WearMetadataPreviews with
group=wear, so :weather:metadata keeps rendering them into
metadata_data/photos/weather/wear/ (the old weather-wear bucket's
capture is replaced there by a fresh render). The weather-wear
module, its settings include, and its AGENTS.md are deleted.
Root and weather AGENTS.md describe the merged state.

WxStaticDiskCacheTest joins the forkEvery=1 quarantine in
weather/build.gradle.kts: it installs a throwing WxStatic.fetcher
mid-test and never restores it (resetForTest does not touch the
fetcher), so any later same-JVM test reaching WxStatic inherits
the failure. The batch reshuffle from the moved tests exposed
that latent leak (WeatherMiscTest); the identical failure
reproduces on the unmodified base when the two pre-existing
classes share one JVM in polluter-first order.

Verified on devvm21958: :weather:compileDevKotlin green;
:weather:lint and :weather:lintVitalRelease green;
:weather:testDevUnitTest green (334 tests, 0 failures, including
the moved watch tests and new FormFactorTest); :weather:metadata
green with the wear render in metadata_data/photos/weather/wear/.
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 f3662d18eb..eb9114d577 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` and `appstore` 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` 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). `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`). 
metadata_data/photos/weather/wear/1.png
diff --git a/metadata_data/photos/weather-wear/wear/1.png b/metadata_data/photos/weather/wear/1.pngsimilarity index 100%rename from metadata_data/photos/weather-wear/wear/1.pngrename to metadata_data/photos/weather/wear/1.png
settings.gradle.kts
diff --git a/settings.gradle.kts b/settings.gradle.ktsindex 01148362dc..c2c3d547eb 100644--- a/settings.gradle.kts+++ b/settings.gradle.kts@@ -124,8 +124,6 @@ include(":games:hub") include(":email") include(":securemail") include(":weather")-include(":weather:wear")-project(":weather:wear").projectDir = file("weather-wear") include(":camera") include(":sdk:openassistant") include(":sdk:games")
weather-wear/AGENTS.md
diff --git a/weather-wear/AGENTS.md b/weather-wear/AGENTS.mddeleted file mode 100644index 70d0d5874f..0000000000--- a/weather-wear/AGENTS.md+++ /dev/null@@ -1,17 +0,0 @@-# AGENTS.md — weather-wear/ (':weather:wear')-> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `weather-wear/` + `weather/`.-- Gradle: :weather:wear (dir weather-wear/)-- Entry: ui/WearMainActivity.kt-## Why-Wear OS companion of :weather. Same applicationId + signing (WearLink handshake requires same cert). Sideload once via ADB.-## Protocol-The wire protocol lives in `:library:wearlink` at-`com.vayunmathur.library.wearlink.weather.WearWeatherProtocol` (shared by-`:weather` and `:weather:wear`; neither app module depends on the other).-Golden tests on each side pin the same JSON against that shared code.-- Snapshot/watch-state: WearLink data items; request-sync: message watch->phone only.-- Offline: renders locally stored snapshot; no network on watch.-- Units: protocol values stay Celsius / km/h; rendering converts to the watch's system regional preferences (`platform/WearSystemUnits`, formatting in `domain/WearWeatherFormatting`).-## Verify-./gradlew :weather:wear:assembleDev-./gradlew :weather:wear:testDebugUnitTest
weather-wear/build.gradle.kts
diff --git a/weather-wear/build.gradle.kts b/weather-wear/build.gradle.ktsdeleted file mode 100644index 2e74661a8f..0000000000--- a/weather-wear/build.gradle.kts+++ /dev/null@@ -1,20 +0,0 @@-plugins { id("common-conventions-wear")-    // Listing screenshots come from Compose previews (src/screenshotTest), not from an-    // instrumented test on a device. Renders land in this module's own-    // metadata_data/photos/<wear-module-key>/wear/ bucket.-    id("common-conventions-preview-metadata") }-launcherIcon { symbol = "partly_cloudy_day" }-android {-    namespace = "com.vayunmathur.weather.wear"-    defaultConfig {-        applicationId = "com.vayunmathur.weather"-        minSdk = 31-    }-}-dependencies {-    implementation(libs.androidx.core.ktx)-    implementation(libs.kotlinx.coroutines.android)-    implementation(project(":library:wearlink"))-    testImplementation(libs.kotlin.test)-    testImplementation(libs.kotlin.test.junit)-}
weather-wear/src/main/AndroidManifest.xml
diff --git a/weather-wear/src/main/AndroidManifest.xml b/weather-wear/src/main/AndroidManifest.xmldeleted file mode 100644index 15b8083385..0000000000--- a/weather-wear/src/main/AndroidManifest.xml+++ /dev/null@@ -1,12 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<manifest xmlns:android="http://schemas.android.com/apk/res/android">-    <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">-        <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>-    </application>-</manifest>
weather-wear/src/main/res/values/colors.xml
diff --git a/weather-wear/src/main/res/values/colors.xml b/weather-wear/src/main/res/values/colors.xmldeleted file mode 100644index 79503191b9..0000000000--- a/weather-wear/src/main/res/values/colors.xml+++ /dev/null@@ -1 +0,0 @@-<resources><color name="ic_launcher_background">#FFFFFF</color></resources>
weather-wear/src/test/java/com/vayunmathur/weather/wear/domain/WearWeatherProtocolTest.kt
diff --git a/weather-wear/src/test/java/com/vayunmathur/weather/wear/domain/WearWeatherProtocolTest.kt b/weather-wear/src/test/java/com/vayunmathur/weather/wear/domain/WearWeatherProtocolTest.ktdeleted file mode 100644index 788074348f..0000000000--- a/weather-wear/src/test/java/com/vayunmathur/weather/wear/domain/WearWeatherProtocolTest.kt+++ /dev/null@@ -1,27 +0,0 @@-package com.vayunmathur.weather.wear.domain-import com.vayunmathur.library.wearlink.weather.WearWatchState-import com.vayunmathur.library.wearlink.weather.WearWeatherCurrent-import com.vayunmathur.library.wearlink.weather.WearWeatherDay-import com.vayunmathur.library.wearlink.weather.WearWeatherHour-import com.vayunmathur.library.wearlink.weather.WearWeatherLocation-import com.vayunmathur.library.wearlink.weather.WearWeatherProtocol-import com.vayunmathur.library.wearlink.weather.WearWeatherSnapshot-import com.vayunmathur.library.wearlink.weather.buildWearWeatherSnapshot-import com.vayunmathur.library.wearlink.weather.wearCompanionPresent-import kotlin.test.Test-import kotlin.test.assertEquals-import kotlin.test.assertFalse-import kotlin.test.assertTrue-import kotlinx.serialization.encodeToString-class WearWeatherProtocolTest {- private fun loc(id:Long,primary:Boolean=false)=WearWeatherLocation(locationId=id,name="Loc $id",country="X",isPrimary=primary,timezone="UTC",current=WearWeatherCurrent("2026-11-24T12:00",20.0,19.0,50,1,true,10.0,90,1013.0),hourly=listOf(WearWeatherHour("2026-11-24T13:00",21.0,1,10,true)),daily=listOf(WearWeatherDay("2026-11-24",1,22.0,15.0,10)))- @Test fun goldenSnapshotJson(){ val s=WearWeatherSnapshot(1000L,listOf(loc(42L,true)),false)-  assertEquals("""{"generatedAtMillis":1000,"locations":[{"locationId":42,"name":"Loc 42","country":"X","isPrimary":true,"current":{"timeIso":"2026-11-24T12:00","temperatureC":20.0,"apparentTemperatureC":19.0,"humidityPercent":50,"weatherCode":1,"windSpeedKmh":10.0,"windDirectionDegrees":90,"pressureHpa":1013.0},"hourly":[{"timeIso":"2026-11-24T13:00","temperatureC":21.0,"weatherCode":1,"precipitationProbabilityPercent":10}],"daily":[{"dateIso":"2026-11-24","weatherCode":1,"temperatureMaxC":22.0,"temperatureMinC":15.0,"precipitationProbabilityMaxPercent":10}]}]}""", WearWeatherProtocol.json.encodeToString(s)) }- @Test fun roundTrips(){ val s=WearWeatherSnapshot(9L,listOf(loc(1L)),true); assertEquals(s, WearWeatherProtocol.json.decodeFromString<WearWeatherSnapshot>(WearWeatherProtocol.json.encodeToString(s))) }- @Test fun buildPrimaryFirstAndCapsLocations(){ val s=buildWearWeatherSnapshot((1L..6L).map{loc(it,it==3L)},0L); assertEquals(3L,s.locations.first().locationId); assertEquals(WearWeatherProtocol.MAX_LOCATIONS,s.locations.size); assertTrue(s.truncated) }- @Test fun buildCapsHourlyDaily(){ val big=loc(1L,true).copy(hourly=(1..40).map{WearWeatherHour("2026-11-24T13:00",1.0,1)},daily=(1..10).map{WearWeatherDay("2026-11-24",1,2.0,1.0)}); val s=buildWearWeatherSnapshot(listOf(big),0L); assertEquals(WearWeatherProtocol.MAX_HOURLY,s.locations[0].hourly.size); assertEquals(WearWeatherProtocol.MAX_DAILY,s.locations[0].daily.size) }- @Test fun presenceAbsent(){ assertFalse(wearCompanionPresent(emptyList())); assertTrue(wearCompanionPresent(listOf("n"))) }- @Test fun buildCapsBytes(){ val many=(1L..4L).map{ loc(it).copy(name="x".repeat(200),hourly=(1..24).map{WearWeatherHour("2026-11-24T13:00",1.0,1)}) }; val s=buildWearWeatherSnapshot(many,0L); assertTrue(WearWeatherProtocol.json.encodeToString(s).encodeToByteArray().size<=WearWeatherProtocol.MAX_JSON_BYTES) }- @Test fun goldenWatchStateJson(){ assertEquals("""{"appliedGeneratedAtMillis":1000,"locationCount":2}""", WearWeatherProtocol.json.encodeToString(WearWatchState(1000L,2))) }- @Test fun watchStateRoundTrips(){ val s=WearWatchState(9L,3); assertEquals(s, WearWeatherProtocol.json.decodeFromString<WearWatchState>(WearWeatherProtocol.json.encodeToString(s))) }-}
weather/AGENTS.md
diff --git a/weather/AGENTS.md b/weather/AGENTS.mdindex 45be3f9211..273e14ab53 100644--- a/weather/AGENTS.md+++ b/weather/AGENTS.md@@ -4,9 +4,9 @@  _Install: ./install weather (dev by default)._ - Gradle: :weather / dir: weather/-- Package roots present: ui, data, domain, platform, network, intents, widget-- Entry files: MainActivity.kt, Route.kt, Navigation.kt-- Deps: :library:network, :library:widgets, :library:map, :library:room+- Package roots present: ui, data, domain, platform, network, intents, widget, service, sync+- Entry files: MainActivity.kt (sole launcher; routes watches to WearMainActivity), Route.kt, Navigation.kt, ui/WearMainActivity.kt+- Deps: :library:network, :library:widgets, :library:map, :library:room, :library:wearlink, :library:log, Wear Compose (material + foundation) - Metadata: metadata_data/weather.md (present) - Rust: yes / screenshotTest: yes @@ -18,6 +18,32 @@ _Install: ./install weather (dev by default)._ - Two Glance widgets (standard + blob); `GetWeather`/`GetWeatherByName` current-conditions and `GetForecast` capped multi-day/hourly assistant intents **Architecture / data-flow:** `ui/` home/map/locations → `platform/WeatherViewModel` (+ `WeatherUiContract`) → `data/WeatherRepository` over Room + `network/WeatherApi`; all weather reads come from the static R2 packs (`network/WxStatic`: `run.wxp`/`hist/<day>.wxp`/`geo.wxp` + `latest.json` manifest on `static.maproj.org/wx/v1/`), computed on device by `domain/wx/`; the map samples the same run tiles (no `.om`/`data_spatial` read); place search is the on-device `places.db.br` catalogue; `domain/` holds pure unit/metric/WMO formatting + map metadata; widgets read the same repository snapshot. **Entry points + reading order:** `Route` → `MainActivity.kt` → `Navigation.kt` → `ui/HomePage.kt` → `platform/WeatherViewModel.kt` → `data/WeatherRepository.kt` → `network/WeatherApi.kt`.++## One APK, two form factors (phone + watch)+This module is the single Weather APK for phones and watches: same+`applicationId = "com.vayunmathur.weather"` 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. `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 tab UI. The Glance widget+receivers are a phone-only surface and early-return on a watch.++## Wear sync (Watch conduit client)+**Protocol:** shared wire types live in `:library:wearlink` at `com.vayunmathur.library.wearlink.weather.WearWeatherProtocol`; the golden-JSON tests in this module pin the shared code's wire format.+- Snapshot + watch-state sync: WearLink data items (`/weather/snapshot` phone -> watch, `/weather/watch-state` watch -> phone)+- Sync request: WearLink message (`/weather/request-sync`), watch -> phone only+- **Transport: WearLink RFCOMM nodes** — phone side `sync/WearWeatherSync.kt` publishes the snapshot from cached forecasts, watch side `sync/WearLinkBridge.kt` receives it into `data/WearWeatherStore`; the watch renders the locally stored snapshot offline and holds no network path of its own. Protocol values stay Celsius / km/h; rendering converts to the watch's system regional preferences (`platform/WearSystemUnits`, formatting in `domain/WearWeatherFormatting`).++## Watch experience (in this module)+- `ui/WearMainActivity` (a `WearShellActivity`) routes `ui/WearRoute` over locations (`ui/WearLocationsScreen`) and one location's current/hourly/daily detail (`ui/WearLocationScreen`), with a sync-now action that messages the phone side.+- Watch state persists in `data/WearWeatherStore` (`wear-weather-snapshot.json`).+- Watch listing screenshots are the `group = "wear"` previews in `src/screenshotTest/.../ui/WearMetadataPreviews.kt`, collected by `:weather:metadata` into `metadata_data/photos/weather/wear/`; phone shots use the `phone` bucket. **Gotchas:** - Unit system follows the device locale (`platform/SystemUnits`) — format in `domain/`, never in `ui/` - Map shading is sampled on device from the R2 run tiles in `network/WxStatic`; the Rust `.om` bridge (`domain/map/OmTilesNative`) is not on the read path@@ -104,6 +130,16 @@ _Install: ./install weather (dev by default)._ - com/vayunmathur/weather/ui/components/blocks/CloudCoverBlock.kt - com/vayunmathur/weather/ui/components/blocks/SunBlock.kt - com/vayunmathur/weather/ui/components/blocks/MoonBlock.kt+### sync/ — wear companion sync+- com/vayunmathur/weather/sync/WearWeatherSync.kt — phone WearLink node; snapshot publish from cached forecasts, watch-state receive, request-sync handling+- com/vayunmathur/weather/sync/WearLinkBridge.kt — watch WearLink node; snapshot receive into the watch store, watch-state publish, sync request+### Watch experience (ui/ + platform/ + data/ + domain/)+- com/vayunmathur/weather/ui/WearMainActivity.kt — watch entry (WearShellActivity)+- com/vayunmathur/weather/ui/WearRoute.kt, WearLocationsScreen.kt, WearLocationScreen.kt+- com/vayunmathur/weather/platform/FormFactor.kt — watch detection (`FEATURE_WATCH`)+- com/vayunmathur/weather/platform/WearSystemUnits.kt — watch display units from regional preferences+- com/vayunmathur/weather/data/WearWeatherStore.kt+- com/vayunmathur/weather/domain/WearWeatherFormatting.kt ### widget/ — Glance widgets (cache-fed only) - com/vayunmathur/weather/widget/WeatherGlanceWidget.kt — includes `WeatherGlanceWidgetReceiver` + `WidgetWeather` model (one widget, one file) - com/vayunmathur/weather/widget/WeatherBlobGlanceWidget.kt — includes `WeatherBlobGlanceWidgetReceiver` (one widget, one file)
weather/build.gradle.kts
diff --git a/weather/build.gradle.kts b/weather/build.gradle.ktsindex a2a81432eb..bf491e0c96 100644--- a/weather/build.gradle.kts+++ b/weather/build.gradle.kts@@ -74,6 +74,13 @@ rustNativeTests {     // above. All other classes batch.     isolatedClasses.addAll(         listOf(+            // WxStaticDiskCacheTest installs a throwing WxStatic.fetcher+            // mid-test and never restores it (resetForTest does not touch+            // the fetcher), so any later same-JVM test that reaches+            // WxStatic inherits the bomb (WeatherMiscTest's intent test+            // failed exactly that way once batch composition shifted).+            // forkEvery = 1 keeps the leak inside its own JVM.+            "com.vayunmathur.weather.network.WxStaticDiskCacheTest",             "com.vayunmathur.weather.platform.ViewModelAddLocationTest",             "com.vayunmathur.weather.platform.ViewModelDeviceFixTest",             "com.vayunmathur.weather.platform.ViewModelFetchTest",@@ -92,7 +99,16 @@ dependencies {     implementation(project(":library:widgets"))     implementation(libs.androidx.datastore.preferences)     implementation(project(":library:map"))+    // Both sides of the Wear OS sync live in this one APK (same+    // applicationId and signing, as the WearLink handshake requires):+    // sync/WearWeatherSync 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 platform/sync code writes through.+    implementation(libs.androidx.wear.compose.material)+    implementation(libs.androidx.wear.compose.foundation)+    implementation(project(":library:log"))     implementRoom(libs)     implementation(project(":library:room")) 
weather/src/main/AndroidManifest.xml
diff --git a/weather/src/main/AndroidManifest.xml b/weather/src/main/AndroidManifest.xmlindex 1ad9d0df44..1bf49f8233 100644--- a/weather/src/main/AndroidManifest.xml+++ b/weather/src/main/AndroidManifest.xml@@ -7,6 +7,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.INTERNET" />     <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />@@ -38,6 +53,11 @@         android:roundIcon="@mipmap/ic_launcher"         android:supportsRtl="true"         android:theme="@style/Theme.Weather">++        <!-- Watch experience is paired with the phone app, not standalone. -->+        <meta-data+            android:name="com.google.android.wearable.standalone"+            android:value="false" />         <meta-data             android:name="com.google.android.gms.car.application"             android:resource="@xml/automotive_app_desc" />@@ -87,6 +107,14 @@             android:name="androidx.car.app.minCarApiLevel"             android:value="1" /> +        <!-- Watch experience: entered only via MainActivity's watch routing+             (no launcher filter of its own). Inert on a phone. -->+        <activity+            android:name=".ui.WearMainActivity"+            android:exported="false"+            android:taskAffinity=""+            android:theme="@android:style/Theme.Material.NoActionBar" />+         <receiver             android:name=".widget.WeatherGlanceWidgetReceiver"             android:exported="false">
weather/src/main/java/com/vayunmathur/weather/MainActivity.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/MainActivity.kt b/weather/src/main/java/com/vayunmathur/weather/MainActivity.ktindex 3595ea61b9..5477276677 100644--- a/weather/src/main/java/com/vayunmathur/weather/MainActivity.kt+++ b/weather/src/main/java/com/vayunmathur/weather/MainActivity.kt@@ -1,5 +1,7 @@ package com.vayunmathur.weather +import android.content.Intent+import android.os.Bundle import androidx.activity.viewModels import androidx.compose.runtime.Composable import androidx.lifecycle.lifecycleScope@@ -11,17 +13,39 @@ import com.vayunmathur.library.widgets.updateWidgetPreviews import com.vayunmathur.weather.data.GeoDatabase import com.vayunmathur.weather.data.WeatherRepository import com.vayunmathur.weather.network.WxStatic+import com.vayunmathur.weather.platform.FormFactor import com.vayunmathur.weather.platform.WeatherViewModel import com.vayunmathur.weather.platform.WeatherViewModelFactory+import com.vayunmathur.weather.ui.WearMainActivity import com.vayunmathur.weather.widget.WeatherGlanceWidgetReceiver -/** Main Activity: a ma activity implementation for main activity. */+/**+ * Sole launcher entry of the single merged Weather APK. On a watch (the+ * `android.hardware.type.watch` system feature, see [FormFactor]) it hands+ * off to [WearMainActivity] and finishes before any phone state (network+ * client, forecast repository, widget previews) is touched; on a phone it+ * owns the [WeatherViewModel] and the tab UI.+ */ 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 viewModel: WeatherViewModel by viewModels {         WeatherViewModelFactory(application, WeatherRepository.get(application))     }      override fun onCreateBeforeContent() {+        if (routedToWear) return         com.vayunmathur.library.wearlink.WearLinkPermissions.requestIfNeeded(this)         // FIRST_PARTY covers static.maproj.org (static weather packs on         // R2, the app's only weather origin) and, for the flagged@@ -39,6 +63,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(viewModel)         }
weather/src/main/java/com/vayunmathur/weather/data/WearWeatherStore.kt
diff --git a/weather-wear/src/main/java/com/vayunmathur/weather/wear/data/WearWeatherStore.kt b/weather/src/main/java/com/vayunmathur/weather/data/WearWeatherStore.ktsimilarity index 93%rename from weather-wear/src/main/java/com/vayunmathur/weather/wear/data/WearWeatherStore.ktrename to weather/src/main/java/com/vayunmathur/weather/data/WearWeatherStore.ktindex a4db8862a5..9c45e70329 100644--- a/weather-wear/src/main/java/com/vayunmathur/weather/wear/data/WearWeatherStore.kt+++ b/weather/src/main/java/com/vayunmathur/weather/data/WearWeatherStore.kt@@ -1,9 +1,9 @@-package com.vayunmathur.weather.wear.data+package com.vayunmathur.weather.data import android.content.Context import com.vayunmathur.library.log.Log import com.vayunmathur.library.wearlink.weather.WearWeatherProtocol import com.vayunmathur.library.wearlink.weather.WearWeatherSnapshot-import com.vayunmathur.weather.wear.sync.WearLinkBridge+import com.vayunmathur.weather.sync.WearLinkBridge import java.io.File import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow
weather/src/main/java/com/vayunmathur/weather/domain/WearWeatherFormatting.kt
diff --git a/weather-wear/src/main/java/com/vayunmathur/weather/wear/domain/WearWeatherFormatting.kt b/weather/src/main/java/com/vayunmathur/weather/domain/WearWeatherFormatting.ktsimilarity index 97%rename from weather-wear/src/main/java/com/vayunmathur/weather/wear/domain/WearWeatherFormatting.ktrename to weather/src/main/java/com/vayunmathur/weather/domain/WearWeatherFormatting.ktindex 406a879cd9..e1523889a4 100644--- a/weather-wear/src/main/java/com/vayunmathur/weather/wear/domain/WearWeatherFormatting.kt+++ b/weather/src/main/java/com/vayunmathur/weather/domain/WearWeatherFormatting.kt@@ -1,4 +1,4 @@-package com.vayunmathur.weather.wear.domain+package com.vayunmathur.weather.domain import java.util.Locale import kotlin.math.roundToInt 
weather/src/main/java/com/vayunmathur/weather/platform/FormFactor.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/platform/FormFactor.kt b/weather/src/main/java/com/vayunmathur/weather/platform/FormFactor.ktnew file mode 100644index 0000000000..eb051c1201--- /dev/null+++ b/weather/src/main/java/com/vayunmathur/weather/platform/FormFactor.kt@@ -0,0 +1,25 @@+package com.vayunmathur.weather.platform++import android.content.Context+import android.content.pm.PackageManager++/**+ * Runtime form-factor detection for the single merged Weather 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+}
weather/src/main/java/com/vayunmathur/weather/platform/WearSystemUnits.kt
diff --git a/weather-wear/src/main/java/com/vayunmathur/weather/wear/platform/WearSystemUnits.kt b/weather/src/main/java/com/vayunmathur/weather/platform/WearSystemUnits.ktsimilarity index 75%rename from weather-wear/src/main/java/com/vayunmathur/weather/wear/platform/WearSystemUnits.ktrename to weather/src/main/java/com/vayunmathur/weather/platform/WearSystemUnits.ktindex 79ab25c070..eae1128912 100644--- a/weather-wear/src/main/java/com/vayunmathur/weather/wear/platform/WearSystemUnits.kt+++ b/weather/src/main/java/com/vayunmathur/weather/platform/WearSystemUnits.kt@@ -1,8 +1,8 @@-package com.vayunmathur.weather.wear.platform+package com.vayunmathur.weather.platform import androidx.core.text.util.LocalePreferences-import com.vayunmathur.weather.wear.domain.WearTemperatureUnit-import com.vayunmathur.weather.wear.domain.WearWindUnit-import com.vayunmathur.weather.wear.domain.wearWindUnitForLocale+import com.vayunmathur.weather.domain.WearTemperatureUnit+import com.vayunmathur.weather.domain.WearWindUnit+import com.vayunmathur.weather.domain.wearWindUnitForLocale import java.util.Locale  /**
weather/src/main/java/com/vayunmathur/weather/sync/WearLinkBridge.kt
diff --git a/weather-wear/src/main/java/com/vayunmathur/weather/wear/sync/WearLinkBridge.kt b/weather/src/main/java/com/vayunmathur/weather/sync/WearLinkBridge.ktsimilarity index 94%rename from weather-wear/src/main/java/com/vayunmathur/weather/wear/sync/WearLinkBridge.ktrename to weather/src/main/java/com/vayunmathur/weather/sync/WearLinkBridge.ktindex 4533a8b4e6..5fe4d3daec 100644--- a/weather-wear/src/main/java/com/vayunmathur/weather/wear/sync/WearLinkBridge.kt+++ b/weather/src/main/java/com/vayunmathur/weather/sync/WearLinkBridge.kt@@ -1,9 +1,9 @@-package com.vayunmathur.weather.wear.sync+package com.vayunmathur.weather.sync import android.content.Context import com.vayunmathur.library.log.Log import com.vayunmathur.library.wearlink.WearLinkListener import com.vayunmathur.library.wearlink.WearLinkNode-import com.vayunmathur.weather.wear.data.WearWeatherStore+import com.vayunmathur.weather.data.WearWeatherStore import com.vayunmathur.library.wearlink.weather.WearWeatherProtocol import com.vayunmathur.library.wearlink.weather.WearWeatherSnapshot import com.vayunmathur.library.wearlink.weather.WearWatchState
weather/src/main/java/com/vayunmathur/weather/ui/WearLocationScreen.kt
diff --git a/weather-wear/src/main/java/com/vayunmathur/weather/wear/ui/WearLocationScreen.kt b/weather/src/main/java/com/vayunmathur/weather/ui/WearLocationScreen.ktsimilarity index 87%rename from weather-wear/src/main/java/com/vayunmathur/weather/wear/ui/WearLocationScreen.ktrename to weather/src/main/java/com/vayunmathur/weather/ui/WearLocationScreen.ktindex 8d3d12556d..77515ad8f0 100644--- a/weather-wear/src/main/java/com/vayunmathur/weather/wear/ui/WearLocationScreen.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/WearLocationScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.weather.wear.ui+package com.vayunmathur.weather.ui import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable@@ -20,16 +20,16 @@ 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.weather.wear.R-import com.vayunmathur.weather.wear.data.WearWeatherStore-import com.vayunmathur.weather.wear.domain.wearConditionLabel-import com.vayunmathur.weather.wear.domain.wearDayLabel-import com.vayunmathur.weather.wear.domain.wearHourLabel-import com.vayunmathur.weather.wear.domain.wearTemp-import com.vayunmathur.weather.wear.domain.wearWind-import com.vayunmathur.weather.wear.platform.systemWearTemperatureUnit-import com.vayunmathur.weather.wear.platform.systemWearWindUnit-import com.vayunmathur.weather.wear.sync.requestWearSync+import com.vayunmathur.weather.R+import com.vayunmathur.weather.data.WearWeatherStore+import com.vayunmathur.weather.domain.wearConditionLabel+import com.vayunmathur.weather.domain.wearDayLabel+import com.vayunmathur.weather.domain.wearHourLabel+import com.vayunmathur.weather.domain.wearTemp+import com.vayunmathur.weather.domain.wearWind+import com.vayunmathur.weather.platform.systemWearTemperatureUnit+import com.vayunmathur.weather.platform.systemWearWindUnit+import com.vayunmathur.weather.sync.requestWearSync import kotlinx.coroutines.launch @Composable fun WearLocationScreen(store:WearWeatherStore, locationId:Long, onBack:()->Unit){  val s by store.snapshot.collectAsState(); val loc=s.locations.firstOrNull{it.locationId==locationId}?:s.locations.firstOrNull()
weather/src/main/java/com/vayunmathur/weather/ui/WearLocationsScreen.kt
diff --git a/weather-wear/src/main/java/com/vayunmathur/weather/wear/ui/WearLocationsScreen.kt b/weather/src/main/java/com/vayunmathur/weather/ui/WearLocationsScreen.ktsimilarity index 86%rename from weather-wear/src/main/java/com/vayunmathur/weather/wear/ui/WearLocationsScreen.ktrename to weather/src/main/java/com/vayunmathur/weather/ui/WearLocationsScreen.ktindex 1cfdb69515..563ce089c6 100644--- a/weather-wear/src/main/java/com/vayunmathur/weather/wear/ui/WearLocationsScreen.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/WearLocationsScreen.kt@@ -1,4 +1,4 @@-package com.vayunmathur.weather.wear.ui+package com.vayunmathur.weather.ui import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable@@ -16,12 +16,12 @@ 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.weather.wear.R-import com.vayunmathur.weather.wear.data.WearWeatherStore-import com.vayunmathur.weather.wear.domain.WearTemperatureUnit-import com.vayunmathur.weather.wear.domain.wearConditionLabel-import com.vayunmathur.weather.wear.domain.wearTemp-import com.vayunmathur.weather.wear.platform.systemWearTemperatureUnit+import com.vayunmathur.weather.R+import com.vayunmathur.weather.data.WearWeatherStore+import com.vayunmathur.weather.domain.WearTemperatureUnit+import com.vayunmathur.weather.domain.wearConditionLabel+import com.vayunmathur.weather.domain.wearTemp+import com.vayunmathur.weather.platform.systemWearTemperatureUnit @Composable fun WearLocationsScreen(store:WearWeatherStore, onOpen:(Long)->Unit){  val s by store.snapshot.collectAsState()  val tempUnit=remember{systemWearTemperatureUnit()}
weather/src/main/java/com/vayunmathur/weather/ui/WearMainActivity.kt
diff --git a/weather-wear/src/main/java/com/vayunmathur/weather/wear/ui/WearMainActivity.kt b/weather/src/main/java/com/vayunmathur/weather/ui/WearMainActivity.ktsimilarity index 83%rename from weather-wear/src/main/java/com/vayunmathur/weather/wear/ui/WearMainActivity.ktrename to weather/src/main/java/com/vayunmathur/weather/ui/WearMainActivity.ktindex 8abfeeec75..8b7a8bc147 100644--- a/weather-wear/src/main/java/com/vayunmathur/weather/wear/ui/WearMainActivity.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/WearMainActivity.kt@@ -1,9 +1,9 @@-package com.vayunmathur.weather.wear.ui+package com.vayunmathur.weather.ui  import androidx.compose.runtime.Composable import com.vayunmathur.library.wearlink.WearShellActivity-import com.vayunmathur.weather.wear.data.WearWeatherStore-import com.vayunmathur.weather.wear.sync.WearLinkBridge+import com.vayunmathur.weather.data.WearWeatherStore+import com.vayunmathur.weather.sync.WearLinkBridge  class WearMainActivity : WearShellActivity<WearRoute, WearWeatherStore>(WearRoute.Locations) { 
weather/src/main/java/com/vayunmathur/weather/ui/WearRoute.kt
diff --git a/weather-wear/src/main/java/com/vayunmathur/weather/wear/ui/WearRoute.kt b/weather/src/main/java/com/vayunmathur/weather/ui/WearRoute.ktsimilarity index 74%rename from weather-wear/src/main/java/com/vayunmathur/weather/wear/ui/WearRoute.ktrename to weather/src/main/java/com/vayunmathur/weather/ui/WearRoute.ktindex 4ebf1096af..96c32b4ff5 100644--- a/weather-wear/src/main/java/com/vayunmathur/weather/wear/ui/WearRoute.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/WearRoute.kt@@ -1,2 +1,2 @@-package com.vayunmathur.weather.wear.ui+package com.vayunmathur.weather.ui sealed interface WearRoute { data object Locations:WearRoute; data class Location(val locationId:Long):WearRoute }
weather/src/main/java/com/vayunmathur/weather/widget/WeatherBlobGlanceWidget.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/widget/WeatherBlobGlanceWidget.kt b/weather/src/main/java/com/vayunmathur/weather/widget/WeatherBlobGlanceWidget.ktindex 4ce6d07066..23c09bb73a 100644--- a/weather/src/main/java/com/vayunmathur/weather/widget/WeatherBlobGlanceWidget.kt+++ b/weather/src/main/java/com/vayunmathur/weather/widget/WeatherBlobGlanceWidget.kt@@ -36,6 +36,7 @@ import com.vayunmathur.weather.MainActivity import com.vayunmathur.weather.R import com.vayunmathur.weather.domain.celsiusTo import com.vayunmathur.weather.domain.weatherConditionForCode+import com.vayunmathur.weather.platform.FormFactor import com.vayunmathur.weather.platform.systemTempUnit import kotlin.math.max import kotlin.math.roundToInt@@ -190,6 +191,13 @@ class WeatherBlobGlanceWidgetReceiver : MaWidgetReceiver<WeatherBlobGlanceWidget     hourly = false,     widgetFactory = ::WeatherBlobGlanceWidget, ) {+    override fun onReceive(context: Context, intent: Intent) {+        // Phone experience only: Glance widgets have no watch surface, and+        // on a watch WearMainActivity owns the experience.+        if (FormFactor.isWatch(context)) return+        super.onReceive(context, intent)+    }+     override fun onEnabledExtra(context: Context) {         WeatherRefreshWorker.scheduleHourlyRefresh(context)     }
weather/src/main/java/com/vayunmathur/weather/widget/WeatherGlanceWidget.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/widget/WeatherGlanceWidget.kt b/weather/src/main/java/com/vayunmathur/weather/widget/WeatherGlanceWidget.ktindex ecb8083b34..ce606443ff 100644--- a/weather/src/main/java/com/vayunmathur/weather/widget/WeatherGlanceWidget.kt+++ b/weather/src/main/java/com/vayunmathur/weather/widget/WeatherGlanceWidget.kt@@ -44,6 +44,7 @@ import com.vayunmathur.weather.MainActivity import com.vayunmathur.weather.R import com.vayunmathur.weather.domain.celsiusTo import com.vayunmathur.weather.domain.weatherConditionForCode+import com.vayunmathur.weather.platform.FormFactor import com.vayunmathur.weather.platform.systemTempUnit import kotlinx.datetime.LocalDateTime import kotlinx.datetime.TimeZone@@ -247,6 +248,13 @@ class WeatherGlanceWidgetReceiver : MaWidgetReceiver<WeatherGlanceWidget>(     hourly = false,     widgetFactory = ::WeatherGlanceWidget, ) {+    override fun onReceive(context: Context, intent: Intent) {+        // Phone experience only: Glance widgets have no watch surface, and+        // on a watch WearMainActivity owns the experience.+        if (FormFactor.isWatch(context)) return+        super.onReceive(context, intent)+    }+     override fun onEnabledExtra(context: Context) {         WeatherRefreshWorker.scheduleHourlyRefresh(context)     }
weather/src/main/res/values/wear_strings.xml
diff --git a/weather-wear/src/main/res/values/strings.xml b/weather/src/main/res/values/wear_strings.xmlsimilarity index 80%rename from weather-wear/src/main/res/values/strings.xmlrename to weather/src/main/res/values/wear_strings.xmlindex 3adff26ab2..c300670b0c 100644--- a/weather-wear/src/main/res/values/strings.xml+++ b/weather/src/main/res/values/wear_strings.xml@@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?>+<!-- Watch-experience strings for the single merged Weather APK (ui/Wear*).+     The phone strings.xml already owns app_name, so it is not repeated here. --> <resources>-<string name="app_name">Weather</string> <string name="wear_empty">No weather synced yet. Open Weather on your phone to sync this watch.</string> <string name="wear_locations">Locations</string> <string name="wear_hourly">Next hours</string>
weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/WearMetadataPreviews.kt
diff --git a/weather-wear/src/screenshotTest/kotlin/com/vayunmathur/weather/wear/ui/MetadataPreviews.kt b/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/WearMetadataPreviews.ktsimilarity index 86%rename from weather-wear/src/screenshotTest/kotlin/com/vayunmathur/weather/wear/ui/MetadataPreviews.ktrename to weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/WearMetadataPreviews.ktindex 63fd859727..e2887e2e72 100644--- a/weather-wear/src/screenshotTest/kotlin/com/vayunmathur/weather/wear/ui/MetadataPreviews.kt+++ b/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/WearMetadataPreviews.kt@@ -1,4 +1,4 @@-package com.vayunmathur.weather.wear.ui+package com.vayunmathur.weather.ui  import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box@@ -18,19 +18,19 @@ import com.vayunmathur.library.wearlink.weather.WearWeatherSnapshot private const val ROUND = "spec:width=227dp,height=227dp,dpi=320"  /**- * Store listing images for `:weather:wear`, rendered from Compose previews instead- * of from an instrumented test on a device.+ * Watch store-listing images for the single merged `:weather` APK, rendered from+ * Compose previews instead of from an instrumented test on a device.  *- * `./gradlew :weather:wear:metadata` renders these and copies the PNGs into- * `metadata_data/photos/weather-wear/wear/` — the wear module's own bucket, not the- * phone Weather app's folder — where the release build picks them up.+ * `./gradlew :weather:metadata` renders these and copies the PNGs into+ * `metadata_data/photos/weather/wear/` — the watch bucket of the merged app's+ * folder — where the release build picks them up.  *  * Rules (same as every other module's MetadataPreviews): order comes from the  * function names, each preview needs `@PreviewTest` plus `group = "wear"`, previews  * are class members, and everything is a literal fixture snapshot. Layoutlib renders  * a rectangular canvas, so round previews clip to a circle.  */-class MetadataPreviews {+class WearMetadataPreviews {      @PreviewTest     @Preview(name = "1-locations-round", device = ROUND, group = "wear")
weather/src/test/java/com/vayunmathur/weather/domain/WearWeatherFormattingTest.kt
diff --git a/weather-wear/src/test/java/com/vayunmathur/weather/wear/domain/WearWeatherFormattingTest.kt b/weather/src/test/java/com/vayunmathur/weather/domain/WearWeatherFormattingTest.ktsimilarity index 97%rename from weather-wear/src/test/java/com/vayunmathur/weather/wear/domain/WearWeatherFormattingTest.ktrename to weather/src/test/java/com/vayunmathur/weather/domain/WearWeatherFormattingTest.ktindex 80fd921620..d7ef3c22b4 100644--- a/weather-wear/src/test/java/com/vayunmathur/weather/wear/domain/WearWeatherFormattingTest.kt+++ b/weather/src/test/java/com/vayunmathur/weather/domain/WearWeatherFormattingTest.kt@@ -1,4 +1,4 @@-package com.vayunmathur.weather.wear.domain+package com.vayunmathur.weather.domain import java.util.Locale import kotlin.test.Test import kotlin.test.assertEquals
weather/src/test/java/com/vayunmathur/weather/platform/FormFactorTest.kt
diff --git a/weather/src/test/java/com/vayunmathur/weather/platform/FormFactorTest.kt b/weather/src/test/java/com/vayunmathur/weather/platform/FormFactorTest.ktnew file mode 100644index 0000000000..b3c8200a5d--- /dev/null+++ b/weather/src/test/java/com/vayunmathur/weather/platform/FormFactorTest.kt@@ -0,0 +1,19 @@+package com.vayunmathur.weather.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))+    }+}