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

Commit d69b1133 authored by Zongheng Wang's avatar Zongheng Wang Committed by Gerrit Code Review
Browse files

Merge "Use public API to get SMS encode data"

parents 470e1867 c8680b80
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -520,15 +520,11 @@ public class BluetoothMapSmsPdu {
        int activePhone = context.getSystemService(TelephonyManager.class)
                .getCurrentPhoneType();
        int phoneType;
        GsmAlphabet.TextEncodingDetails ted = (PHONE_TYPE_CDMA == activePhone)
                ? com.android.internal.telephony.cdma.SmsMessage.calculateLength(
                (CharSequence) messageText, false, true)
                : com.android.internal.telephony.gsm.SmsMessage.calculateLength(
                        (CharSequence) messageText, false);
        int[] ted = SmsMessage.calculateLength((CharSequence) messageText, false);

        SmsPdu newPdu;
        String destinationAddress;
        int msgCount = ted.msgCount;
        int msgCount = ted[0];
        int encoding;
        int languageTable;
        int languageShiftTable;
@@ -540,9 +536,9 @@ public class BluetoothMapSmsPdu {

        // Default to GSM, as this code should not be used, if we neither have CDMA not GSM.
        phoneType = (activePhone == PHONE_TYPE_CDMA) ? SMS_TYPE_CDMA : SMS_TYPE_GSM;
        encoding = ted.codeUnitSize;
        languageTable = ted.languageTable;
        languageShiftTable = ted.languageShiftTable;
        encoding = ted[3];
        languageTable = ted[4];
        languageShiftTable = ted[5];
        destinationAddress = PhoneNumberUtils.stripSeparators(address);
        if (destinationAddress == null || destinationAddress.length() < 2) {
            destinationAddress =