2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-29 13:17:43 +00:00

[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
This commit is contained in:
Simon Redman 2018-12-11 18:02:39 -07:00
parent 6dd71e43a3
commit dda6a5104c
2 changed files with 5 additions and 5 deletions

View File

@ -214,10 +214,10 @@ public class SMSHelper {
* Represent an ID used to uniquely identify a message thread
*/
public static class ThreadID {
final Integer threadID;
final Long threadID;
static final String lookupColumn = Telephony.Sms.THREAD_ID;
public ThreadID(Integer threadID) {
public ThreadID(Long threadID) {
this.threadID = threadID;
}
@ -246,7 +246,7 @@ public class SMSHelper {
public final long m_date;
final int m_type;
final int m_read;
final int m_threadID;
final long m_threadID; // ThreadID is *int* for SMS messages but *long* for MMS
final int m_uID;
/**
@ -296,7 +296,7 @@ public class SMSHelper {
m_type = Integer.parseInt(messageInfo.get(Message.TYPE));
}
m_read = Integer.parseInt(messageInfo.get(Message.READ));
m_threadID = Integer.parseInt(messageInfo.get(Message.THREAD_ID));
m_threadID = Long.parseLong(messageInfo.get(Message.THREAD_ID));
m_uID = Integer.parseInt(messageInfo.get(Message.U_ID));
}

View File

@ -384,7 +384,7 @@ public class SMSPlugin extends Plugin {
}
private boolean handleRequestConversation(NetworkPacket packet) {
SMSHelper.ThreadID threadID = new SMSHelper.ThreadID(packet.getInt("threadID"));
SMSHelper.ThreadID threadID = new SMSHelper.ThreadID(packet.getLong("threadID"));
List<SMSHelper.Message> conversation = SMSHelper.getMessagesInThread(this.context, threadID);