summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Amit Mahajan <amitmahajan@google.com> 2019-06-21 10:23:14 -0700
committer android-build-merger <android-build-merger@google.com> 2019-06-21 10:23:14 -0700
commitd364e2a7fbc21fd2a30774592dff1483e7e5af54 (patch)
tree11cd3751937ce5337e3e579155ebf2f5351f7113
parent6f916a687cf6c3db52cfdb812361414e4998dabf (diff)
parenta187edb1170e1db0fe83c471695e53fb6de24966 (diff)
Merge "Replace the IDD with the '+' sign" am: 3fdedfab76
am: a187edb117 Change-Id: Idcd55e1c7f2a0d62ac3c966ebd1678450f173b9a
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/SmsMessage.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
index 9ad8befb394d..4bd0213f3672 100644
--- a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
+++ b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
@@ -16,6 +16,9 @@
package com.android.internal.telephony.cdma;
+import static com.android.internal.telephony.TelephonyProperties.PROPERTY_OPERATOR_IDP_STRING;
+
+import android.content.res.Resources;
import android.os.Parcel;
import android.os.SystemProperties;
import android.telephony.PhoneNumberUtils;
@@ -23,9 +26,8 @@ import android.telephony.SmsCbLocation;
import android.telephony.SmsCbMessage;
import android.telephony.cdma.CdmaSmsCbProgramData;
import android.telephony.Rlog;
-import android.util.Log;
import android.text.TextUtils;
-import android.content.res.Resources;
+import android.util.Log;
import com.android.internal.telephony.GsmAlphabet.TextEncodingDetails;
import com.android.internal.telephony.SmsAddress;
@@ -750,8 +752,16 @@ public class SmsMessage extends SmsMessageBase {
}
private void decodeSmsDisplayAddress(SmsAddress addr) {
+ // PCD(Plus Code Dialing)
+ // 1) Replaces IDD(International Direct Dialing) with the '+' if address starts with it.
+ // TODO: Skip it for EF SMS(SUBMIT and DELIVER) because the IDD depends on current network?
+ // 2) Adds the '+' prefix if TON is International
+ // 3) Keeps the '+' if address starts with the '+'
+ String idd = SystemProperties.get(PROPERTY_OPERATOR_IDP_STRING, null);
addr.address = new String(addr.origBytes);
- if (addr.ton == CdmaSmsAddress.TON_INTERNATIONAL_OR_IP) {
+ if (!TextUtils.isEmpty(idd) && addr.address.startsWith(idd)) {
+ addr.address = "+" + addr.address.substring(idd.length());
+ } else if (addr.ton == CdmaSmsAddress.TON_INTERNATIONAL_OR_IP) {
if (addr.address.charAt(0) != '+') {
addr.address = "+" + addr.address;
}