feat(android): support android node sms.search#48299
Conversation
Greptile SummaryThis PR adds Key changes:
Issues found:
Confidence Score: 3/5
|
apps/android/app/src/main/java/ai/openclaw/app/node/InvokeCommandRegistry.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3285a7c3fd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
apps/android/app/src/main/java/ai/openclaw/app/node/InvokeCommandRegistry.kt
Outdated
Show resolved
Hide resolved
apps/android/app/src/main/java/ai/openclaw/app/node/SmsHandler.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fdedc83ba3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| emptyList() | ||
| } | ||
|
|
||
| val messages = querySmsMessages(params, phoneNumbers) |
There was a problem hiding this comment.
Short-circuit contact-name searches with no matching numbers
If contactName is set but getPhoneNumbersFromContactName() returns an empty list, this still falls through to querySmsMessages() with no address filter. In the common case where the caller only supplies contactName, a typo or nonexistent contact now returns the device's recent SMS history instead of an empty result set, which leaks unrelated messages.
Useful? React with 👍 / 👎.
| name = OpenClawSmsCommand.Search.rawValue, | ||
| availability = InvokeCommandAvailability.ReadSmsAvailable, |
There was a problem hiding this comment.
Add a live-test profile before advertising sms.search
Once READ_SMS is granted, advertisedCommands() will now include sms.search, but src/gateway/android-node.capabilities.live.test.ts:456-459 hard-fails whenever an advertised command is missing from COMMAND_PROFILES. Because this new command is registered here without a corresponding profile, live Android-node capability runs will start aborting with unmapped advertised commands: sms.search on devices that expose the permission.
Useful? React with 👍 / 👎.
|
Landed on main. Thanks @lixuankai. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 205498dcfb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| val phoneNumbers = if (!params.contactName.isNullOrEmpty()) { | ||
| if (!ensureReadContactsPermission()) { | ||
| return@withContext SearchResult( | ||
| ok = false, | ||
| messages = emptyList(), | ||
| error = "CONTACTS_PERMISSION_REQUIRED: grant READ_CONTACTS permission", |
There was a problem hiding this comment.
Fall back to explicit phoneNumber when contacts access is denied
If a caller supplies both contactName and phoneNumber, this branch still hard-fails on missing READ_CONTACTS before querySmsMessages() runs. querySmsMessages() can already filter by phoneNumber alone, so otherwise valid searches (for example, an agent sending both a display name and an extracted number) now return CONTACTS_PERMISSION_REQUIRED on devices that intentionally withhold contacts access. Only requiring contacts permission when contactName is the sole address filter would avoid blocking those searches.
Useful? React with 👍 / 👎.
| val sendOk = perms[Manifest.permission.SEND_SMS] == true | ||
| val readOk = perms[Manifest.permission.READ_SMS] == true | ||
| smsPermissionGranted = sendOk && readOk |
There was a problem hiding this comment.
Let users enable sms.search without also granting SEND_SMS
This new Settings flow makes SMS permission all-or-nothing: smsPermissionGranted only becomes true when both SEND_SMS and READ_SMS are granted. That blocks the new read-only sms.search feature on devices or policies where sending SMS is intentionally disallowed, even though InvokeCommandRegistry and SmsManager.search() only need READ_SMS for search. As written, users cannot enable the new command from Settings unless they also hand over send-SMS access.
Useful? React with 👍 / 👎.
* feat(android): support android node sms.search * feat(android): support android node sms.search * fix(android): split sms search permissions * fix: document android sms.search landing (openclaw#48299) (thanks @lixuankai) --------- Co-authored-by: lixuankai <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
* feat(android): support android node sms.search * feat(android): support android node sms.search * fix(android): split sms search permissions * fix: document android sms.search landing (openclaw#48299) (thanks @lixuankai) --------- Co-authored-by: lixuankai <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
* feat(android): support android node sms.search * feat(android): support android node sms.search * fix(android): split sms search permissions * fix: document android sms.search landing (openclaw#48299) (thanks @lixuankai) --------- Co-authored-by: lixuankai <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
* feat(android): support android node sms.search * feat(android): support android node sms.search * fix(android): split sms search permissions * fix: document android sms.search landing (openclaw#48299) (thanks @lixuankai) --------- Co-authored-by: lixuankai <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
* feat(android): support android node sms.search * feat(android): support android node sms.search * fix(android): split sms search permissions * fix: document android sms.search landing (openclaw#48299) (thanks @lixuankai) --------- Co-authored-by: lixuankai <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
Summary
When I say,
It not support:

So I plan to enhance the tools for Android nodes to support more high-value scenarios
Upgrade the Android node function:
calllog.search#44073Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Security Impact (required)
Yes)No)No)No)Yes)Yes, explain risk + mitigation:Support applying for sms read access permission on Android applications and providing sms.search to OpenClaw
Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Compatibility / Migration
No)No)No)Failure Recovery (if this breaks)
Risks and Mitigations
None