launcher: remove manual watch sync chip from wear home
- Commit
f76b193c1c42062a35d443e1a01e56d1cf8fb42d- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-05 16:53 UTC (19 hours ago)
- Parents
c56d396
Phone-to-watch sync is now fully automatic over the Watch conduit, so the 'Sync favorites' chip on the wear launcher home is dead weight. Remove the chip, the sync-result note, its onRequestSync plumbing, the now-unused sync/WearSyncRequest.kt helper and the wear sync strings, and update the wear preview and AGENTS.md. Automatic WearLauncherSync favorites publishing (including the on-resume republish in MainActivity) is unchanged. Verified: :launcher:lint :launcher:lintVitalRelease :launcher:testDevUnitTest pass; :launcher:metadata regenerated.
Diff
launcher/AGENTS.md
diff --git a/launcher/AGENTS.md b/launcher/AGENTS.mdindex b1986e30b8..fe5b64828c 100644--- a/launcher/AGENTS.md+++ b/launcher/AGENTS.md@@ -120,7 +120,6 @@ neither runs on the wrong form factor. - com/vayunmathur/launcher/domain/WearLauncherModel.kt - com/vayunmathur/launcher/sync/WearLauncherSync.kt — phone conduit client node; favorites publish, watch-state receive, request-sync handling - com/vayunmathur/launcher/sync/WearLinkBridge.kt — watch conduit client node; favorites receive into the store, watch-state publish-- com/vayunmathur/launcher/sync/WearSyncRequest.kt — `requestWearSync` helper (watch asks phone for fresh favorites) ### tv/ — TV mode (UiMode-routed, DataStore order, no Room/widgets) - com/vayunmathur/launcher/tv/TvRoute.kt
launcher/src/main/java/com/vayunmathur/launcher/sync/WearSyncRequest.kt
diff --git a/launcher/src/main/java/com/vayunmathur/launcher/sync/WearSyncRequest.kt b/launcher/src/main/java/com/vayunmathur/launcher/sync/WearSyncRequest.ktdeleted file mode 100644index 456cda9191..0000000000--- a/launcher/src/main/java/com/vayunmathur/launcher/sync/WearSyncRequest.kt+++ /dev/null@@ -1,6 +0,0 @@-package com.vayunmathur.launcher.sync--import android.content.Context--/** Asks the phone for fresh favorites over the conduit; false when the conduit link is not connected. */-suspend fun requestWearSync(context: Context): Boolean = WearLinkBridge.requestSync(context)
launcher/src/main/java/com/vayunmathur/launcher/ui/WearLauncherScreen.kt
diff --git a/launcher/src/main/java/com/vayunmathur/launcher/ui/WearLauncherScreen.kt b/launcher/src/main/java/com/vayunmathur/launcher/ui/WearLauncherScreen.ktindex 66e739fdfe..905eb5564e 100644--- a/launcher/src/main/java/com/vayunmathur/launcher/ui/WearLauncherScreen.kt+++ b/launcher/src/main/java/com/vayunmathur/launcher/ui/WearLauncherScreen.kt@@ -8,11 +8,8 @@ import androidx.compose.foundation.layout.size import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue-import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.produceState import androidx.compose.runtime.remember-import androidx.compose.runtime.rememberCoroutineScope-import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.asImageBitmap import androidx.compose.ui.platform.LocalContext@@ -32,9 +29,7 @@ import com.vayunmathur.launcher.data.WearLauncherStore import com.vayunmathur.launcher.domain.WatchApp import com.vayunmathur.launcher.domain.buildWearLauncherSections import com.vayunmathur.launcher.platform.InstalledApps-import com.vayunmathur.launcher.sync.requestWearSync import kotlinx.coroutines.Dispatchers-import kotlinx.coroutines.launch import kotlinx.coroutines.withContext /** Round home: favorites, recents, our-apps shortcuts, then drawer/settings entries. */@@ -45,12 +40,8 @@ fun WearLauncherScreen( onOpenSettings: () -> Unit, ) { val context = LocalContext.current- val scope = rememberCoroutineScope() val snapshot by store.snapshot.collectAsState() val recents by store.recents.collectAsState()- var syncNote by remember { mutableStateOf<String?>(null) }- val requestedText = stringResource(R.string.wear_sync_requested)- val noPhoneText = stringResource(R.string.wear_no_phone) val installed by produceState(initialValue = emptyList<WatchApp>(), context) { value = withContext(Dispatchers.IO) { InstalledApps.load(context) } }@@ -67,7 +58,6 @@ fun WearLauncherScreen( }, onOpenAllApps = onOpenAllApps, onOpenSettings = onOpenSettings,- onRequestSync = { requestWearSync(context) }, ) } @@ -82,12 +72,7 @@ internal fun WearLauncherContent( onLaunch: (WatchApp) -> Unit, onOpenAllApps: () -> Unit, onOpenSettings: () -> Unit,- onRequestSync: suspend () -> Boolean, ) {- val scope = rememberCoroutineScope()- var syncNote by remember { mutableStateOf<String?>(null) }- val requestedText = stringResource(R.string.wear_sync_requested)- val noPhoneText = stringResource(R.string.wear_no_phone) val listState = rememberScalingLazyListState() fun launch(app: WatchApp) = onLaunch(app) @@ -108,16 +93,6 @@ internal fun WearLauncherContent( modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp, vertical = 4.dp), ) }- syncNote?.let { note ->- item {- Text(- note,- style = MaterialTheme.typography.body2,- textAlign = TextAlign.Center,- modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp, vertical = 4.dp),- )- }- } if (installedEmpty) { item { Text(@@ -182,18 +157,6 @@ internal fun WearLauncherContent( modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp), ) }- item {- Chip(- onClick = {- scope.launch {- syncNote = if (onRequestSync()) requestedText else noPhoneText- }- },- label = { Text(stringResource(R.string.wear_request_sync), maxLines = 1) },- colors = ChipDefaults.secondaryChipColors(),- modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp),- )- } } }
launcher/src/main/res/values/wear_strings.xml
diff --git a/launcher/src/main/res/values/wear_strings.xml b/launcher/src/main/res/values/wear_strings.xmlindex 41d3ad837f..43d9b993aa 100644--- a/launcher/src/main/res/values/wear_strings.xml+++ b/launcher/src/main/res/values/wear_strings.xml@@ -10,9 +10,6 @@ <string name="wear_no_matches">No matches</string> <string name="wear_no_favorites">No phone favorites synced yet. Open Launcher on your phone to sync.</string> <string name="wear_missing_favorite">Not installed on this watch: %1$s</string>- <string name="wear_request_sync">Sync favorites</string>- <string name="wear_sync_requested">Asked your phone for favorites</string>- <string name="wear_no_phone">Phone not reachable — showing the last synced favorites</string> <string name="wear_settings_unavailable">No system settings screen is available on this watch.</string> <string name="wear_not_home_note">This is an app, not the watch home screen — stock Wear OS keeps home for the system launcher.</string> <string name="wear_back">Back</string>
launcher/src/screenshotTest/kotlin/com/vayunmathur/launcher/ui/WearMetadataPreviews.kt
diff --git a/launcher/src/screenshotTest/kotlin/com/vayunmathur/launcher/ui/WearMetadataPreviews.kt b/launcher/src/screenshotTest/kotlin/com/vayunmathur/launcher/ui/WearMetadataPreviews.ktindex b50c5b76cb..ed07784f93 100644--- a/launcher/src/screenshotTest/kotlin/com/vayunmathur/launcher/ui/WearMetadataPreviews.kt+++ b/launcher/src/screenshotTest/kotlin/com/vayunmathur/launcher/ui/WearMetadataPreviews.kt@@ -40,7 +40,6 @@ class WearMetadataPreviews { onLaunch = {}, onOpenAllApps = {}, onOpenSettings = {},- onRequestSync = { true }, ) } }