2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-22 09:58:08 +00:00

29 Commits

Author SHA1 Message Date
Nicolas Fella
b3b74f25f4 Convert license headers to SPDX 2020-08-17 16:17:20 +02:00
Aniket Kumar
f3d683e2c5 Modifying SMSHelper.Message class and PACKET_TYPE_SMS_MESSAGE to contain list of attachment objects. 2020-08-12 17:08:02 +05:30
Aniket Kumar
b119de8e76 Added MMS support to the SMSPlugin using Klinker library. 2020-07-05 13:32:44 +05:30
Abdel-Rahman Abdel-Rahman
bfbe6b55ec Consider subscription id when sending SMS messages 2020-04-07 20:02:12 +00:00
Simon Redman
36f592a665 [SMS App] Add interface for querying a range of messages
## Summary
This patch adds an interface to return only a specified window of messages.

The current implementation of the conversation interface loads all messages every time the conversation is requested. This is might be painfully slow to load in case the conversation is large or if there are a lot of MMS/RCS messages in the conversation (since those are wildly slower to load than SMS)

Used by https://invent.kde.org/kde/kdeconnect-kde/merge_requests/203 to enable Desktop functionality

## Test Plan

 - With new Android app and old Desktop app:
   - The Android app will notice the missing fields and query for all messages as before.
 - With old Android app and new Desktop app:
   - The desktop will send fields for the new interface which will not be read and all messages will be returned.
 - With new Android app and new Desktop app:
   - The new interface is used and returns only a certain number of messages at a time.

## Known Issues
There is an un-covered corner case if lots of MMS messages are received in the same second (or SMS messages in the same millisecond): Since the interfaces uses timestamps as a filter, it might happen that not all messages sharing the same timestamp are returned. The fact that there are still more messages sharing the timestamp is invisible to the caller. This could be a real-world problem if, for example, a user gets off a plane and their phone downloads a bunch of MMS all at once.
2020-03-11 00:34:31 +00:00
Simon Redman
abcb6cbf33 [SMS App] Export all addresses of multitarget messages
## Summary
Export the complete list of remote addresses of a multitarget message

Note that this changes format of the returned Message object, replacing the string "address" field with a string list "addresses" field, so it is not backwards-compatible with old desktop applications

## Test Plan
See Test Plan of the desktop-side patch: https://invent.kde.org/kde/kdeconnect-kde/merge_requests/101
2019-07-19 17:46:54 +00:00
Albert Vaca
a9508a7f46 Lock before first access as per CR 2019-07-05 14:57:50 +02:00
Albert Vaca Cintora
bfadb84b9f Fix potential race condition caused by early unlocking
The lock should be kept between the point we read and the point we write

Also, no need to pass SMSPlugin as a parameter, since enclossed classes
already have access to its parent by default.
2019-07-04 21:01:12 +02:00
Simon Redman
51e957d822 [SMSApp] Support plain-text MMS
## Summary

Not having support for MMS caused some minor problems, like in https://bugs.kde.org/show_bug.cgi?id=398889 . This patch adds basic MMS support for plain-text MMS, including multi-target messages.

Android companion to https://invent.kde.org/kde/kdeconnect-kde/merge_requests/97

Currently there are several rough areas:
  - Multi-target messages do not have the full list of recipients (I am planning to work on this in another patch, because this one is already quite large enough)
  - Parsing MMS is significantly slower than parsing SMS. This makes sense, since we need to make significantly many more content:// calls for MMS. The only solution I can think of here is to add the ability to request a range of messages, which I need to do anyway, but which should not be part of this patch.
  - The desktop app is totally busted with regard to multi-target MMS, but that will also be fixed in another MR

BUG: 398889

## Test Plan

### Before:
Open SMS app on desktop, scroll through conversations, notice:
  - Any single-target message which had the most-recent message as an MMS does not appear
  - Any multi-target MMS conversations do not appear

### After:
Open SMS app on desktop, notice:
  - Conversations which have an MMS as their most-recent message appear
  - MMS which consisted of only text are rendered correctly
  - Multi-target conversations are shown (though pretty busted, as said before. Do not attempt to reply to one!)
2019-06-10 05:48:28 +00:00
Simon Redman
49295c0de9 Make lint suppression less aggressive for SMSHelper 2019-06-05 22:17:02 -06:00
Nicolas Fella
ba5a925075 Require KitKat for SMS plugin 2019-04-19 23:55:46 +02:00
Nicolas Fella
d7c8f61c80 Unify coding style 2019-04-19 23:47:18 +02:00
Nicolas Fella
f1194e88c2 Use Log.e instead of printStackTrace 2019-03-31 20:09:44 +02:00
Simon Redman
b725e81c37 Re-add READ_SMS permission to SMS plugin
Previously was bugged: If the SMS plugin was enabled but the Telephony was not, the SMS plugin would not have worked. Good thing nobody noticed! :)
2019-03-21 21:10:22 -06:00
Simon Redman
12fb67a7aa Change hard-coded string to use library-provided constant
Does this cause problems with older SDKs? I don't think so. (If there are problems, I assume they were already there)
2019-03-21 11:12:43 -06:00
Albert Vaca
aada931d6a Re-enable SMS plugin now that we know the secrets to approval 2019-03-20 23:11:58 +01:00
Albert Vaca
13e6f2d250 Emergency update to fix Play Store's policy violation
- Make TelephonyPlugin only handle calls and not texts
- Disable SMSPlugin.
- Stop using READ_CALL_LOG permission (for contact names)
2019-03-19 09:00:45 +01:00
Albert Vaca Cintora
78b38b5a00 Use ClassIndex to create a list of plugins in compile time
Instead of manually initializing a map statically.
2019-02-11 20:08:18 +01:00
Erik Duisters
f684fbe8ef Migrate from android support libraries to androidx
Summary: Use the new AndroidX libraries instead of the legacy support libraries

Test Plan: Apply patch and verify everything works as before

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: shubham, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17818
2018-12-27 16:43:34 +01:00
Simon Redman
dda6a5104c [Android] Change ThreadID to long
Summary: Change ThreadID to long

Test Plan:
Messages should send and receive as before. Additionally, if your device has assigned extremely large ThreadIDs, the SMS plugin should no longer crash.

This patch corresponds to the KDE-side revision D17516

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17517
2018-12-11 18:02:53 -07:00
Simon Redman
da629f9756 [Android] Make message syncronization interface capable of handling future changes
Summary:
Update packet type with proper field names and commenting

Send new "event" field

Test Plan:
- Install corresponding Desktop-side patch D16599
- Verify that it is still possible to synchronize messages the same as it was before

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16600
2018-11-15 16:56:25 -07:00
Simon Redman
a647c8e447 Re-indent example packet comments 2018-11-01 12:52:30 -06:00
Nicolas Fella
e1096f5bc8 Make final where possible 2018-10-27 00:01:30 +02:00
Nicolas Fella
a49a145d69 Only use required access modifiers 2018-10-26 23:59:20 +02:00
Nicolas Fella
74d2b2e828 Fix javadoc warning 2018-10-26 23:09:24 +02:00
Nicolas Fella
405792b707 Autoformat code 2018-09-29 19:25:10 +02:00
Simon Redman
df42f992c8 [Android] New-style Message received handling
Summary:
Mark old-style SMS packet sending as deprecated (but still supported for backwards-compatibility with old Desktop apps)

Implement a ContentObserver on the Messages database, then send an update to the remote for all incoming or outgoing messages

Test Plan:
1. DBus
  - Connect Android to desktop
  - Subscribe to /modules/kdeconnect/devices/<device_id>/org.kdeconnect.device.conversations/conversationUpdated
  - Receive a new message (text yourself?)
  - Verify that something comes back on dbus (This endpoint is updated by D15409. With that patch you should see the new Message object, before you should just get the (meaningless) conversation ID)

2. SMS App
  - Relies on D15409 - See instructions there

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D15360
2018-09-17 09:06:42 -06:00
Simon Redman
0cc3639aa1 [Android] Cleanup SMS plugin and document deprecated SMS-relevant Telephony packet types
Summary:
- Rename all SMS-handling packets to indicate that they belong to the SMS plugin
- Define TELEPHONY_REQUEST_MUTE packet to replace TELEPHONY_REQUEST packet

Please see KDE-side patch here: D15543

Test Plan: See test plan in D15543

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: nicolasfella, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D15544
2018-09-16 16:07:19 -06:00
Nicolas Fella
665354c5d5 Split Telephony and SMS plugin on Android
Test Plan:
Get called: Notification appears as before.
Get SMS: Notification shows and it appears in SMS app after reconnect.
Write SMS from app: It shows up on the phone

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D14612
2018-08-15 17:12:45 +02:00