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

Commit a1bf6ae4 authored by Thomas Nguyen's avatar Thomas Nguyen
Browse files

Provide attribution tag when sending text message

The attribution tag will be used for accounting by the security team.

Bug: 294384641
Test: SMS, MMS, call with live network.
atest android.telephony.cts.SmsManagerTest

Change-Id: I9cd2d1df3237aeaac73cf753b5c14da13ec5f912
parent 24c938c9
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -842,7 +842,7 @@ public final class SmsManager {
                        ISms iSms = getISmsServiceOrThrow();
                        if (iSms != null) {
                            iSms.sendTextForSubscriberWithOptions(subId,
                                    null, null, destinationAddress,
                                    null, getAttributionTag(), destinationAddress,
                                    scAddress,
                                    text, sentIntent, deliveryIntent, persistMessage, finalPriority,
                                    expectMore, finalValidity);
@@ -864,7 +864,7 @@ public final class SmsManager {
                ISms iSms = getISmsServiceOrThrow();
                if (iSms != null) {
                    iSms.sendTextForSubscriberWithOptions(getSubscriptionId(),
                            null, null, destinationAddress,
                            null, getAttributionTag(), destinationAddress,
                            scAddress,
                            text, sentIntent, deliveryIntent, persistMessage, finalPriority,
                            expectMore, finalValidity);
@@ -1513,8 +1513,8 @@ public final class SmsManager {
            public void onSuccess(int subId) {
                try {
                    ISms iSms = getISmsServiceOrThrow();
                    iSms.sendDataForSubscriber(subId, null, null, destinationAddress, scAddress,
                            destinationPort & 0xFFFF, data, sentIntent, deliveryIntent);
                    iSms.sendDataForSubscriber(subId, null, getAttributionTag(), destinationAddress,
                            scAddress, destinationPort & 0xFFFF, data, sentIntent, deliveryIntent);
                } catch (RemoteException e) {
                    Log.e(TAG, "sendDataMessage: Couldn't send SMS - Exception: " + e.getMessage());
                    notifySmsError(sentIntent, RESULT_REMOTE_EXCEPTION);