From 40c9b670330eb2ecfc7786b5dc6d3e4ac0444041 Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Wed, 17 May 2017 23:13:33 +0200 Subject: [PATCH] Fixing sent SMS not appearing in the SMS app on old phones BUG: 368069 --- AndroidManifest.xml | 1 + .../Plugins/TelepathyPlugin/TelepathyPlugin.java | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 2d5ad843..7142f7b3 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -24,6 +24,7 @@ + diff --git a/src/org/kde/kdeconnect/Plugins/TelepathyPlugin/TelepathyPlugin.java b/src/org/kde/kdeconnect/Plugins/TelepathyPlugin/TelepathyPlugin.java index 67a5ce86..bd454fef 100644 --- a/src/org/kde/kdeconnect/Plugins/TelepathyPlugin/TelepathyPlugin.java +++ b/src/org/kde/kdeconnect/Plugins/TelepathyPlugin/TelepathyPlugin.java @@ -20,6 +20,9 @@ package org.kde.kdeconnect.Plugins.TelepathyPlugin; +import android.content.ContentValues; +import android.net.Uri; +import android.provider.Telephony; import android.telephony.SmsManager; import android.util.Log; @@ -73,6 +76,11 @@ public class TelepathyPlugin extends Plugin { // properly handles that case smsManager.sendMultipartTextMessage(phoneNo, null, parts, null, null); + ContentValues values = new ContentValues(); + values.put("address", phoneNo); + values.put("body", sms); + context.getContentResolver().insert(Uri.parse("content://sms/sent"), values); + //TODO: Notify other end } catch (Exception e) { //TODO: Notify other end