diff options
Diffstat (limited to 'java/com/android/voicemail/impl')
-rw-r--r-- | java/com/android/voicemail/impl/VoicemailClientImpl.java | 16 | ||||
-rw-r--r-- | java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/java/com/android/voicemail/impl/VoicemailClientImpl.java b/java/com/android/voicemail/impl/VoicemailClientImpl.java index 14fa1d80b..2add59ec7 100644 --- a/java/com/android/voicemail/impl/VoicemailClientImpl.java +++ b/java/com/android/voicemail/impl/VoicemailClientImpl.java @@ -136,6 +136,22 @@ public class VoicemailClientImpl implements VoicemailClient { } @Override + public boolean isVoicemailDonationAvailable(Context context) { + if (!isVoicemailTranscriptionAvailable(context)) { + LogUtil.i("VoicemailClientImpl.isVoicemailDonationAvailable", "transcription not available"); + return false; + } + + TranscriptionConfigProvider provider = new TranscriptionConfigProvider(context); + if (!provider.isVoicemailDonationAvailable()) { + LogUtil.i("VoicemailClientImpl.isVoicemailDonationAvailable", "feature disabled by config"); + return false; + } + + return true; + } + + @Override public boolean isVoicemailDonationEnabled(Context context, PhoneAccountHandle account) { return isVoicemailTranscriptionAvailable(context) && VisualVoicemailSettingsUtil.isVoicemailDonationEnabled(context, account); diff --git a/java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java b/java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java index 5da450312..f4996a097 100644 --- a/java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java +++ b/java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java @@ -75,9 +75,9 @@ public class TranscriptionConfigProvider { .getLong("voicemail_transcription_get_transcript_poll_interval_millis", 1000L); } - public boolean isVoicemailDonationEnabled() { + public boolean isVoicemailDonationAvailable() { return ConfigProviderBindings.get(context) - .getBoolean("voicemail_transcription_donation_enabled", false); + .getBoolean("voicemail_transcription_donation_available", false); } @Override |