summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authormdooley <mdooley@google.com>2017-09-19 12:24:32 -0700
committerEric Erfanian <erfanian@google.com>2017-09-19 13:14:00 -0700
commit69996319e81ae195ff7f45cc292bfea239af27e5 (patch)
tree3dfc9527855b2df0228369dd9af84a005b0b2009 /java
parent218fff34d5a6b0a7191c9a3bba403945144528c1 (diff)
Only enable voicemail transcription on android O and later
Bug: 65648343 Test: updated unit tests (already submitted in previous cl) PiperOrigin-RevId: 169280819 Change-Id: I5950087765ffd038c31b872c6468951472980407
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java4
-rw-r--r--java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java4
2 files changed, 6 insertions, 2 deletions
diff --git a/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java b/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java
index 9b3bbd08e..f5ea95d35 100644
--- a/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java
+++ b/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java
@@ -22,6 +22,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
+import android.os.Build;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.telecom.PhoneAccountHandle;
@@ -139,7 +140,8 @@ public class VoicemailTosMessageCreator {
}
private boolean isVoicemailTranscriptionEnabled() {
- return ConfigProviderBindings.get(context).getBoolean("voicemail_transcription_enabled", false);
+ return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
+ && ConfigProviderBindings.get(context).getBoolean("voicemail_transcription_enabled", false);
}
private void showDeclineTosDialog(final PhoneAccountHandle handle) {
diff --git a/java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java b/java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java
index 83f04dab8..4bb9a261b 100644
--- a/java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java
+++ b/java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java
@@ -16,6 +16,7 @@
package com.android.voicemail.impl.transcribe;
import android.content.Context;
+import android.os.Build;
import com.android.dialer.configprovider.ConfigProviderBindings;
/** Provides configuration values needed to connect to the transcription server. */
@@ -27,7 +28,8 @@ public class TranscriptionConfigProvider {
}
public boolean isVoicemailTranscriptionEnabled() {
- return ConfigProviderBindings.get(context).getBoolean("voicemail_transcription_enabled", false);
+ return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
+ && ConfigProviderBindings.get(context).getBoolean("voicemail_transcription_enabled", false);
}
public String getServerAddress() {