Merge "Fix for GSM-8bit encoding error" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
84d043ebd7
@@ -1019,6 +1019,17 @@ public class SmsMessage {
|
|||||||
return mWrappedSmsMessage.isReplyPathPresent();
|
return mWrappedSmsMessage.isReplyPathPresent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the encoding type of a received SMS message, which is specified using ENCODING_*
|
||||||
|
* GSM: defined in android.telephony.SmsConstants
|
||||||
|
* CDMA: defined in android.telephony.cdma.UserData
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public int getReceivedEncodingType() {
|
||||||
|
return mWrappedSmsMessage.getReceivedEncodingType();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines whether or not to use CDMA format for MO SMS.
|
* Determines whether or not to use CDMA format for MO SMS.
|
||||||
* If SMS over IMS is supported, then format is based on IMS SMS format,
|
* If SMS over IMS is supported, then format is based on IMS SMS format,
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.internal.telephony;
|
package com.android.internal.telephony;
|
||||||
|
|
||||||
|
import static com.android.internal.telephony.SmsConstants.ENCODING_UNKNOWN;
|
||||||
|
|
||||||
import android.compat.annotation.UnsupportedAppUsage;
|
import android.compat.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.telephony.SmsMessage;
|
import android.telephony.SmsMessage;
|
||||||
@@ -93,6 +95,15 @@ public abstract class SmsMessageBase {
|
|||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
|
||||||
protected boolean mMwiDontStore;
|
protected boolean mMwiDontStore;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The encoding type of a received SMS message, which is specified using ENCODING_*
|
||||||
|
* GSM: defined in android.telephony.SmsConstants
|
||||||
|
* CDMA: defined in android.telephony.cdma.UserData
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
protected int mReceivedEncodingType = ENCODING_UNKNOWN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates status for messages stored on the ICC.
|
* Indicates status for messages stored on the ICC.
|
||||||
*/
|
*/
|
||||||
@@ -512,4 +523,8 @@ public abstract class SmsMessageBase {
|
|||||||
|
|
||||||
return mRecipientAddress.getAddressString();
|
return mRecipientAddress.getAddressString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getReceivedEncodingType() {
|
||||||
|
return mReceivedEncodingType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -780,6 +780,7 @@ public class SmsMessage extends SmsMessageBase {
|
|||||||
mUserData = mBearerData.userData.payload;
|
mUserData = mBearerData.userData.payload;
|
||||||
mUserDataHeader = mBearerData.userData.userDataHeader;
|
mUserDataHeader = mBearerData.userData.userDataHeader;
|
||||||
mMessageBody = mBearerData.userData.payloadStr;
|
mMessageBody = mBearerData.userData.payloadStr;
|
||||||
|
mReceivedEncodingType = mBearerData.userData.msgEncoding;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mOriginatingAddress != null) {
|
if (mOriginatingAddress != null) {
|
||||||
@@ -860,6 +861,9 @@ public class SmsMessage extends SmsMessageBase {
|
|||||||
Rlog.w(LOG_TAG, "BearerData.decode() returned null");
|
Rlog.w(LOG_TAG, "BearerData.decode() returned null");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (bData.userData != null) {
|
||||||
|
mReceivedEncodingType = bData.userData.msgEncoding;
|
||||||
|
}
|
||||||
|
|
||||||
if (Rlog.isLoggable(LOGGABLE_TAG, Log.VERBOSE)) {
|
if (Rlog.isLoggable(LOGGABLE_TAG, Log.VERBOSE)) {
|
||||||
Rlog.d(LOG_TAG, "MT raw BearerData = " + HexDump.toHexString(mEnvelope.bearerData));
|
Rlog.d(LOG_TAG, "MT raw BearerData = " + HexDump.toHexString(mEnvelope.bearerData));
|
||||||
|
|||||||
@@ -1404,10 +1404,10 @@ public class SmsMessage extends SmsMessageBase {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 1: // 8 bit data
|
case 1: // 8 bit data
|
||||||
//Support decoding the user data payload as pack GSM 8-bit (a GSM alphabet string
|
// Support decoding the user data payload as pack GSM 8-bit (a GSM alphabet
|
||||||
//that's stored in 8-bit unpacked format) characters.
|
// string that's stored in 8-bit unpacked format) characters.
|
||||||
if (r.getBoolean(com.android.internal.
|
if (r.getBoolean(com.android.internal
|
||||||
R.bool.config_sms_decode_gsm_8bit_data)) {
|
.R.bool.config_sms_decode_gsm_8bit_data)) {
|
||||||
encodingType = ENCODING_8BIT;
|
encodingType = ENCODING_8BIT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1492,6 +1492,7 @@ public class SmsMessage extends SmsMessageBase {
|
|||||||
encodingType == ENCODING_7BIT);
|
encodingType == ENCODING_7BIT);
|
||||||
this.mUserData = p.getUserData();
|
this.mUserData = p.getUserData();
|
||||||
this.mUserDataHeader = p.getUserDataHeader();
|
this.mUserDataHeader = p.getUserDataHeader();
|
||||||
|
this.mReceivedEncodingType = encodingType;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Look for voice mail indication in TP_UDH TS23.040 9.2.3.24
|
* Look for voice mail indication in TP_UDH TS23.040 9.2.3.24
|
||||||
|
|||||||
Reference in New Issue
Block a user