Skip to content

Commit 5378fc7

Browse files
committed
feat(android): wire device commands into runtime
1 parent f94931f commit 5378fc7

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

apps/android/app/src/main/java/ai/openclaw/android/NodeRuntime.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ class NodeRuntime(context: Context) {
9292
locationPreciseEnabled = { locationPreciseEnabled.value },
9393
)
9494

95+
private val deviceHandler: DeviceHandler = DeviceHandler(
96+
appContext = appContext,
97+
)
98+
9599
private val notificationsHandler: NotificationsHandler = NotificationsHandler(
96100
appContext = appContext,
97101
)
@@ -127,6 +131,7 @@ class NodeRuntime(context: Context) {
127131
canvas = canvas,
128132
cameraHandler = cameraHandler,
129133
locationHandler = locationHandler,
134+
deviceHandler = deviceHandler,
130135
notificationsHandler = notificationsHandler,
131136
screenHandler = screenHandler,
132137
smsHandler = smsHandlerImpl,

apps/android/app/src/main/java/ai/openclaw/android/node/ConnectionManager.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class ConnectionManager(
8585
buildList {
8686
add(OpenClawCapability.Canvas.rawValue)
8787
add(OpenClawCapability.Screen.rawValue)
88+
add(OpenClawCapability.Device.rawValue)
8889
if (cameraEnabled()) add(OpenClawCapability.Camera.rawValue)
8990
if (smsAvailable()) add(OpenClawCapability.Sms.rawValue)
9091
if (voiceWakeMode() != VoiceWakeMode.Off && hasRecordAudioPermission()) {

apps/android/app/src/main/java/ai/openclaw/android/node/InvokeDispatcher.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import ai.openclaw.android.gateway.GatewaySession
44
import ai.openclaw.android.protocol.OpenClawCanvasA2UICommand
55
import ai.openclaw.android.protocol.OpenClawCanvasCommand
66
import ai.openclaw.android.protocol.OpenClawCameraCommand
7+
import ai.openclaw.android.protocol.OpenClawDeviceCommand
78
import ai.openclaw.android.protocol.OpenClawLocationCommand
89
import ai.openclaw.android.protocol.OpenClawNotificationsCommand
910
import ai.openclaw.android.protocol.OpenClawScreenCommand
@@ -13,6 +14,7 @@ class InvokeDispatcher(
1314
private val canvas: CanvasController,
1415
private val cameraHandler: CameraHandler,
1516
private val locationHandler: LocationHandler,
17+
private val deviceHandler: DeviceHandler,
1618
private val notificationsHandler: NotificationsHandler,
1719
private val screenHandler: ScreenHandler,
1820
private val smsHandler: SmsHandler,
@@ -116,6 +118,10 @@ class InvokeDispatcher(
116118
// Location command
117119
OpenClawLocationCommand.Get.rawValue -> locationHandler.handleLocationGet(paramsJson)
118120

121+
// Device commands
122+
OpenClawDeviceCommand.Status.rawValue -> deviceHandler.handleDeviceStatus(paramsJson)
123+
OpenClawDeviceCommand.Info.rawValue -> deviceHandler.handleDeviceInfo(paramsJson)
124+
119125
// Notifications command
120126
OpenClawNotificationsCommand.List.rawValue -> notificationsHandler.handleNotificationsList(paramsJson)
121127

0 commit comments

Comments
 (0)