summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwyen <twyen@google.com>2018-04-02 23:50:42 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-04-02 23:50:42 +0000
commitf092b956df89b667da30f374063c7e219d0fcfbf (patch)
tree8f77b7705c70b420d20b2992002feddb8bd8c5ee
parent80c471d8e406d260576cc890bf46e9c6f8eb23af (diff)
parentc523f95bad9e9d04a19ac79b199bd0ab1b93315e (diff)
Merge "Disable transcrption downloads for T-Mobile." am: c81fbd75f1
am: c523f95bad Change-Id: Ieb9d3f28a75e866521496cef24e4efd4fd928558
-rw-r--r--java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java10
-rw-r--r--java/com/android/voicemail/impl/imap/ImapHelper.java2
-rw-r--r--java/com/android/voicemail/impl/res/xml/vvm_config.xml31
3 files changed, 28 insertions, 15 deletions
diff --git a/java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java b/java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java
index 8896bc740..032153d77 100644
--- a/java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java
+++ b/java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java
@@ -88,6 +88,7 @@ public class OmtpVvmCarrierConfigHelper {
"vvm_disabled_capabilities_string_array";
public static final String KEY_VVM_CLIENT_PREFIX_STRING = "vvm_client_prefix_string";
+ private static final String KEY_IGNORE_TRANSCRIPTION_BOOL = "vvm_ignore_transcription";
@Nullable private static PersistableBundle overrideConfigForTest;
@@ -517,4 +518,13 @@ public class OmtpVvmCarrierConfigHelper {
}
return false;
}
+
+ /**
+ * Suppress the behavior of treating any text attachment with MIME "text/*" as transcription,
+ * default to false.
+ */
+ public boolean ignoreTranscription() {
+ Assert.checkArgument(isValid());
+ return (boolean) getValue(KEY_IGNORE_TRANSCRIPTION_BOOL, false);
+ }
}
diff --git a/java/com/android/voicemail/impl/imap/ImapHelper.java b/java/com/android/voicemail/impl/imap/ImapHelper.java
index 1f04edbef..02453f7da 100644
--- a/java/com/android/voicemail/impl/imap/ImapHelper.java
+++ b/java/com/android/voicemail/impl/imap/ImapHelper.java
@@ -571,7 +571,7 @@ public class ImapHelper implements Closeable {
if (bodyPartMimeType.startsWith("audio/")) {
messageStructureWrapper.messageStructure = message;
- } else if (bodyPartMimeType.startsWith("text/")) {
+ } else if (!config.ignoreTranscription() && bodyPartMimeType.startsWith("text/")) {
messageStructureWrapper.transcriptionBodyPart = bodyPart;
} else {
VvmLog.v(TAG, "Unknown bodyPart MIME: " + bodyPartMimeType);
diff --git a/java/com/android/voicemail/impl/res/xml/vvm_config.xml b/java/com/android/voicemail/impl/res/xml/vvm_config.xml
index 4c5efcc1c..87d37b559 100644
--- a/java/com/android/voicemail/impl/res/xml/vvm_config.xml
+++ b/java/com/android/voicemail/impl/res/xml/vvm_config.xml
@@ -66,16 +66,16 @@
</string-array>
<int
- name="vvm_port_number_int"
- value="20481"/>
+ name="vvm_port_number_int"
+ value="20481"/>
<string name="vvm_destination_number_string">21101</string>
<string-array name="carrier_vvm_package_name_string_array">
<item value="com.orange.vvm"/>
</string-array>
<string name="vvm_type_string">vvm_type_omtp</string>
<boolean
- name="vvm_cellular_data_required_bool"
- value="true"/>
+ name="vvm_cellular_data_required_bool"
+ value="true"/>
<string-array name="vvm_disabled_capabilities_string_array">
<!-- a bug -->
<item value="STARTTLS"/>
@@ -105,11 +105,11 @@
</string-array>
<int
- name="vvm_port_number_int"
- value="1808"/>
+ name="vvm_port_number_int"
+ value="1808"/>
<int
- name="vvm_ssl_port_number_int"
- value="993"/>
+ name="vvm_ssl_port_number_int"
+ value="993"/>
<string name="vvm_destination_number_string">122</string>
<string-array name="carrier_vvm_package_name_string_array">
<item value="com.tmobile.vvm.application"/>
@@ -120,6 +120,9 @@
<item value="AUTH=DIGEST-MD5"/>
</string-array>
<string name="vvm_carrier_allows_ott_transcription_string">true</string>
+ <boolean
+ name="vvm_ignore_transcription"
+ value="false"/>
</pbundle_as_map>
<pbundle_as_map>
@@ -198,17 +201,17 @@
</string-array>
<int
- name="vvm_port_number_int"
- value="0"/>
+ name="vvm_port_number_int"
+ value="0"/>
<string name="vvm_destination_number_string">900080006200</string>
<string name="vvm_type_string">vvm_type_vvm3</string>
<string name="vvm_client_prefix_string">//VZWVVM</string>
<boolean
- name="vvm_cellular_data_required_bool"
- value="true"/>
+ name="vvm_cellular_data_required_bool"
+ value="true"/>
<boolean
- name="vvm_legacy_mode_enabled_bool"
- value="true"/>
+ name="vvm_legacy_mode_enabled_bool"
+ value="true"/>
<!-- VVM3 specific value for the voicemail management gateway to use if the SMS didn't provide
one -->
<string name="default_vmg_url">https://mobile.vzw.com/VMGIMS/VMServices</string>