Loading src/java/com/android/internal/telephony/VisualVoicemailSmsFilter.java +16 −2 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ package com.android.internal.telephony; import static com.android.internal.telephony.SmsConstants.ENCODING_8BIT; import android.annotation.Nullable; import android.content.ComponentName; import android.content.Context; Loading Loading @@ -294,7 +296,18 @@ public class VisualVoicemailSmsFilter { result.firstMessage = message; } String body = message.getMessageBody(); if (body == null && message.getUserData() != null) { /* * For visual voice mail SMS message, UTF-8 is used by default * {@link com.android.internal.telephony.SmsController#sendVisualVoicemailSmsForSubscriber} * * If config_sms_decode_gsm_8bit_data is enabled, GSM-8bit will be used to decode the * received message. However, the message is most likely encoded with UTF-8. Therefore, * we need to retry decoding the received message with UTF-8. */ if ((body == null || message.getReceivedEncodingType() == ENCODING_8BIT) && message.getUserData() != null) { Log.d(TAG, "getFullMessage decode using UTF-8"); // Attempt to interpret the user data as UTF-8. UTF-8 string over data SMS using // 8BIT data coding scheme is our recommended way to send VVM SMS and is used in CTS // Tests. The OMTP visual voicemail specification does not specify the SMS type and Loading @@ -303,7 +316,8 @@ public class VisualVoicemailSmsFilter { try { body = decoder.decode(byteBuffer).toString(); } catch (CharacterCodingException e) { // User data is not decode-able as UTF-8. Ignoring. Log.e(TAG, "getFullMessage: got CharacterCodingException" + " when decoding with UTF-8, e = " + e); return null; } } Loading Loading
src/java/com/android/internal/telephony/VisualVoicemailSmsFilter.java +16 −2 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ package com.android.internal.telephony; import static com.android.internal.telephony.SmsConstants.ENCODING_8BIT; import android.annotation.Nullable; import android.content.ComponentName; import android.content.Context; Loading Loading @@ -294,7 +296,18 @@ public class VisualVoicemailSmsFilter { result.firstMessage = message; } String body = message.getMessageBody(); if (body == null && message.getUserData() != null) { /* * For visual voice mail SMS message, UTF-8 is used by default * {@link com.android.internal.telephony.SmsController#sendVisualVoicemailSmsForSubscriber} * * If config_sms_decode_gsm_8bit_data is enabled, GSM-8bit will be used to decode the * received message. However, the message is most likely encoded with UTF-8. Therefore, * we need to retry decoding the received message with UTF-8. */ if ((body == null || message.getReceivedEncodingType() == ENCODING_8BIT) && message.getUserData() != null) { Log.d(TAG, "getFullMessage decode using UTF-8"); // Attempt to interpret the user data as UTF-8. UTF-8 string over data SMS using // 8BIT data coding scheme is our recommended way to send VVM SMS and is used in CTS // Tests. The OMTP visual voicemail specification does not specify the SMS type and Loading @@ -303,7 +316,8 @@ public class VisualVoicemailSmsFilter { try { body = decoder.decode(byteBuffer).toString(); } catch (CharacterCodingException e) { // User data is not decode-able as UTF-8. Ignoring. Log.e(TAG, "getFullMessage: got CharacterCodingException" + " when decoding with UTF-8, e = " + e); return null; } } Loading