summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwyen <twyen@google.com>2018-04-02 14:45:57 -0700
committerCopybara-Service <copybara-piper@google.com>2018-04-02 16:25:47 -0700
commit512ae93076377d771979f86e59913a85211169a0 (patch)
treeaddc0f3effc997c2b1563bcf57ab1f440e686740
parent8b25da85e94169782ba770c5813bd77f8fc29e60 (diff)
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
-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>