phone: dynamic app list from glasses + two-channel GlassesStatusScreen
Phone app: - VmPhoneController: collect appsOnGlasses from glasses (state flow), and requestAppList() sends VmMessage.GetAppList over WebSocket. - AppsListScreen: rename to dynamic list from glasses, verticalScroll, tap → LaunchAppCommand(packageName). Tap calls onAppClick for parent nav (Glasses tab on the bottom NavigationBar). - Shared VM message types (VmMessage.GetAppList / AppListResponse / AppEntry) move into :shared module so both phone and glasses can serialize/deserialize them through the existing VmMessage.Json Glasses app: - VmService handles GetAppList by listing installed launchable apps via PackageManager.queryIntentActivities (combined with Android 11+ <queries> fix in the previous commit so 3rd-party apps appear) and replies with AppListResponse. - GlassesScreen drives state from controller.state; no longer hardcodes any apps in the UI. Tested end-to-end on A06B4AB933C4103: phone taps app on AppsListScreen → glasses' VmService receives LaunchAppCommand → controller.launchGuest(pkg) launches the activity via PackageManager.getLaunchIntentForPackage + FLAG_ACTIVITY_NEW_TASK.
This commit is contained in:
@@ -74,6 +74,22 @@ enum class AudioMode { ON_GLASSES, ON_PHONE }
|
||||
@SerialName("shutdown")
|
||||
data object Shutdown : VmMessage
|
||||
|
||||
@Serializable
|
||||
@SerialName("get_app_list")
|
||||
data object GetAppList : VmMessage
|
||||
|
||||
@Serializable
|
||||
data class AppEntry(
|
||||
val packageName: String,
|
||||
val displayName: String,
|
||||
) : VmMessage
|
||||
|
||||
@Serializable
|
||||
@SerialName("app_list")
|
||||
data class AppListResponse(
|
||||
val apps: List<AppEntry>,
|
||||
) : VmMessage
|
||||
|
||||
// =====================================================================
|
||||
// Glasses → Phone
|
||||
// =====================================================================
|
||||
|
||||
Reference in New Issue
Block a user