Disable transcrption downloads for T-Mobile.
In this CL, the client will stop treating text/* attachments as transcrptions for T-mobile. Transcriptions are already disabled by the device type sent during provisioning so this will not affect any existing functionality. This prevents other data on the server showing up as transcription.
Bug: 77342321
Test: TAP, exact behavior not testable.
PiperOrigin-RevId: 191350836
Change-Id: I758996c3fef75ece7cecf0f7a0b4df7ace970d80
diff --git a/java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java b/java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java
index 8896bc7..032153d 100644
--- a/java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java
+++ b/java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java
@@ -88,6 +88,7 @@
"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 @@
}
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 1f04edb..02453f7 100644
--- a/java/com/android/voicemail/impl/imap/ImapHelper.java
+++ b/java/com/android/voicemail/impl/imap/ImapHelper.java
@@ -571,7 +571,7 @@
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 4c5efcc..87d37b5 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>