Add support for requesting all conversations and sending the reply
Details
- Reviewers
nicolasfella - Group Reviewers
KDE Connect - Commits
- R225:7cfb21684440: (WIP) Upgrade Telephony plugin to read SMS history (Android side)
- Build this diff
- Build the corresponding KDE-side diff (D11854)
- Put a breakpoint in handleRequestConversations somewhere where you can inspect one or more Message objects
- Use DBus to poke /modules/kdeconnect/devices/<deviceID>/telephony.requestAllConversations()
- Verify that the constructed Message is one you sent or received and that it is the most recent in the corresponding conversation
Diff Detail
- Repository
- R225 KDE Connect - Android application
- Branch
- sms-history
- Lint
No Linters Available - Unit
No Unit Test Coverage
src/org/kde/kdeconnect/Helpers/SMSHelper.java | ||
---|---|---|
44 ↗ | (On Diff #30557) | getSMSURIBad? I think getSMSURIBase is more logical. Also, these can easily be inlined in the getSMSUri function. |
76 ↗ | (On Diff #30557) | The return type could use some improvements. I'd suggest a data class holding these result with logical names. Also, getSMS is not really discriptive for what the function actually does (getting SMS threads). |
103 ↗ | (On Diff #30557) | Android coding style. |
src/org/kde/kdeconnect/Helpers/SMSHelper.java | ||
---|---|---|
44 ↗ | (On Diff #30557) | As the comment suggests, using this method to access messages is a bad idea. Thus the method name. In the standard library it resolves to the same thing as Telephony.Sms.CONTENT_URI, so I expect it will work most of the time, but it is very likely that some older phones have designed their own way of doing things and this method will not work, possibly even causing spectacular explosions With that in mind, the reason I left these two in functions is:
I suppose getSMSURIGood could be inlined, since it doesn't need much explaination |
76 ↗ | (On Diff #30557) | These are both good points, especially with respect to creating a custom class for the return type. I will definitely do that. The more I think about what I need from the SMS database in order to support the SMS app, the more I realize that this code in its current form won't work anyway. I will need more helper methods, meaning I will need to do better names. |
103 ↗ | (On Diff #30557) | Darn it. I was doing so well up to here. I have been doing brace-on-next-line for so long it's hard to not! |
src/org/kde/kdeconnect/Plugins/TelephonyPlugin/TelephonyPlugin.java | ||
---|---|---|
346 ↗ | (On Diff #31081) | You could batch them into a JSON array and just send one packet to reduce overhead |
src/org/kde/kdeconnect/Helpers/SMSHelper.java | ||
---|---|---|
202 ↗ | (On Diff #30557) | I was thinking somethink you could use like this: message.address, etc., instead of message.get(Message.ADDRESS). So the class just has these fields instead of extending a hashmap. |