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

Commit a14ab34c authored by asing_lin's avatar asing_lin Committed by Abhisek Devkota
Browse files

Implement [BugID:1136] [PM99_SNT][SQV_PR]

Mobile editing a SMS (content for all emoticons) to fit the machine,
with the machine side part of the expression display a question mark.

TICKET: SAMBAR-1162
Change-Id: Ib467d4b3b6ec32c7b739ff6136d9c907909ee516
parent 52b8ef0a
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import com.android.internal.telephony.SmsMessageBase.SubmitPduBase;
import com.android.internal.telephony.Sms7BitEncodingTranslator;

import java.lang.Math;
import java.text.BreakIterator;	//[PM99] bug#1136 asing
import java.util.ArrayList;
import java.util.Arrays;

@@ -365,6 +366,7 @@ public class SmsMessage {
        // below cleanly if these MAX_* constants were defined more
        // flexibly...

        Rlog.e(LOG_TAG, "fragmentText");
        int limit;
        if (ted.codeUnitSize == SmsConstants.ENCODING_7BIT) {
            int udhLength;
@@ -425,7 +427,18 @@ public class SmsMessage {
                            ted.languageTable, ted.languageShiftTable);
                }
            } else {  // Assume unicode.
                nextPos = pos + Math.min(limit / 2, textLen - pos);
//[PM99] bug#1136 asing s {      
				
                nextPos = Math.min(pos + limit / 2, textLen);
				
		  if (nextPos < textLen) {
		      BreakIterator breakIterator = BreakIterator.getCharacterInstance();
                    breakIterator.setText(newMsgBody.toString());
                    if (!breakIterator.isBoundary(nextPos)) {
                        nextPos = breakIterator.preceding(nextPos);
                    }
                }
//[PM99] bug#1136 asing e {
            }
            if ((nextPos <= pos) || (nextPos > textLen)) {
                Rlog.e(LOG_TAG, "fragmentText failed (" + pos + " >= " + nextPos + " or " +