Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 366ca99d authored by Hemant Gupta's avatar Hemant Gupta Committed by Andre Eisenbach
Browse files

MAP: Send message without persisting to avoid duplicate entries.

Usecase:
1) Establish MAP session
2) Send message from carkit

Issue:
Message entry seen twice in messaging app.

Root Cause:
Message written to database was duplicated using
telephony API.

Fix:
use API SmsManager.sendMultipartTextMessageWithoutPersisting which
wont rewrite message in database.

Test: Message duplication is not seen after applying the above change.

Fixes: 70270156
Change-Id: Ib0472a190bd0779cbd54f5163e66016de12be869
parent cf77de70
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -3176,8 +3176,13 @@ public class BluetoothMapContentObserver {

            Log.d(TAG, "sendMessage to " + msgInfo.phone);

            smsMng.sendMultipartTextMessage(msgInfo.phone, null, parts, sentIntents,
                    deliveryIntents);
            if (parts.size() == 1) {
                smsMng.sendTextMessageWithoutPersisting(msgInfo.phone, null, parts.get(0),
                        sentIntents.get(0), deliveryIntents.get(0));
            } else {
                smsMng.sendMultipartTextMessageWithoutPersisting(msgInfo.phone, null, parts,
                        sentIntents, deliveryIntents);
            }
        }
    }