diff --git a/apps/android/app/src/main/AndroidManifest.xml b/apps/android/app/src/main/AndroidManifest.xml index 801623083d2..43cd3e1acd6 100644 --- a/apps/android/app/src/main/AndroidManifest.xml +++ b/apps/android/app/src/main/AndroidManifest.xml @@ -49,6 +49,9 @@ android:supportsRtl="true" android:networkSecurityConfig="@xml/network_security_config" android:theme="@style/Theme.OpenClawNode"> + + + ask OpenClaw $prompt + tell OpenClaw to $prompt + open OpenClaw and ask $prompt + + diff --git a/apps/android/app/src/main/res/xml/shortcuts.xml b/apps/android/app/src/main/res/xml/shortcuts.xml new file mode 100644 index 00000000000..75573d4e860 --- /dev/null +++ b/apps/android/app/src/main/res/xml/shortcuts.xml @@ -0,0 +1,17 @@ + + + + + + + diff --git a/apps/android/app/src/test/java/ai/openclaw/app/AssistantLaunchTest.kt b/apps/android/app/src/test/java/ai/openclaw/app/AssistantLaunchTest.kt new file mode 100644 index 00000000000..2afffcd6556 --- /dev/null +++ b/apps/android/app/src/test/java/ai/openclaw/app/AssistantLaunchTest.kt @@ -0,0 +1,39 @@ +package ai.openclaw.app + +import android.content.Intent +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [34]) +class AssistantLaunchTest { + @Test + fun parsesAssistGestureIntent() { + val parsed = parseAssistantLaunchIntent(Intent(Intent.ACTION_ASSIST)) + + requireNotNull(parsed) + assertEquals("assist", parsed.source) + assertNull(parsed.prompt) + } + + @Test + fun parsesAppActionPrompt() { + val parsed = + parseAssistantLaunchIntent( + Intent(actionAskOpenClaw).putExtra(extraAssistantPrompt, " summarize my unread texts "), + ) + + requireNotNull(parsed) + assertEquals("app_action", parsed.source) + assertEquals("summarize my unread texts", parsed.prompt) + } + + @Test + fun ignoresUnrelatedIntents() { + assertNull(parseAssistantLaunchIntent(Intent(Intent.ACTION_VIEW))) + } +}