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

Commit 7f59b0cf authored by Sooraj Sasindran's avatar Sooraj Sasindran Committed by Android (Google) Code Review
Browse files

Merge "get smsc with phone identitiy to send message" into udc-dev

parents bbcea6c8 743f183c
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -457,13 +457,18 @@ public class SmsDispatchersController extends Handler {
        }
    }

    private String getSmscAddressFromUSIM(String callingPkg) {
    private String getSmscAddressFromUSIMWithPhoneIdentity(String callingPkg) {
        final long identity = Binder.clearCallingIdentity();
        try {
            IccSmsInterfaceManager iccSmsIntMgr = mPhone.getIccSmsInterfaceManager();
            if (iccSmsIntMgr != null) {
                return iccSmsIntMgr.getSmscAddressFromIccEf(callingPkg);
            } else {
                Rlog.d(TAG, "getSmscAddressFromIccEf iccSmsIntMgr is null");
            }
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
        return null;
    }

@@ -1300,7 +1305,7 @@ public class SmsDispatchersController extends Handler {
    protected void sendData(String callingPackage, String destAddr, String scAddr, int destPort,
            byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent, boolean isForVvm) {
        if (TextUtils.isEmpty(scAddr)) {
            scAddr = getSmscAddressFromUSIM(callingPackage);
            scAddr = getSmscAddressFromUSIMWithPhoneIdentity(callingPackage);
        }

        if (mDomainSelectionResolverProxy.isDomainSelectionSupported()) {
@@ -1539,7 +1544,7 @@ public class SmsDispatchersController extends Handler {
            int priority, boolean expectMore, int validityPeriod, boolean isForVvm,
            long messageId, boolean skipShortCodeCheck) {
        if (TextUtils.isEmpty(scAddr)) {
            scAddr = getSmscAddressFromUSIM(callingPkg);
            scAddr = getSmscAddressFromUSIMWithPhoneIdentity(callingPkg);
        }

        if (mDomainSelectionResolverProxy.isDomainSelectionSupported()) {
@@ -1688,7 +1693,7 @@ public class SmsDispatchersController extends Handler {
            boolean persistMessage, int priority, boolean expectMore, int validityPeriod,
            long messageId) {
        if (TextUtils.isEmpty(scAddr)) {
            scAddr = getSmscAddressFromUSIM(callingPkg);
            scAddr = getSmscAddressFromUSIMWithPhoneIdentity(callingPkg);
        }

        if (mDomainSelectionResolverProxy.isDomainSelectionSupported()) {