diff options
Diffstat (limited to 'java/com/android/voicemail/impl/VoicemailClientImpl.java')
-rw-r--r-- | java/com/android/voicemail/impl/VoicemailClientImpl.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/java/com/android/voicemail/impl/VoicemailClientImpl.java b/java/com/android/voicemail/impl/VoicemailClientImpl.java index 9bb14f2dc..ff1a18d32 100644 --- a/java/com/android/voicemail/impl/VoicemailClientImpl.java +++ b/java/com/android/voicemail/impl/VoicemailClientImpl.java @@ -37,6 +37,7 @@ import com.android.voicemail.impl.settings.VoicemailChangePinActivity; import com.android.voicemail.impl.settings.VoicemailSettingsFragment; import com.android.voicemail.impl.sync.VvmAccountManager; import com.android.voicemail.impl.transcribe.TranscriptionBackfillService; +import com.android.voicemail.impl.transcribe.TranscriptionConfigProvider; import java.util.List; import javax.inject.Inject; @@ -120,6 +121,30 @@ public class VoicemailClientImpl implements VoicemailClient { } @Override + public boolean isVoicemailTranscriptionAvailable(Context context) { + if (!BuildCompat.isAtLeastO()) { + LogUtil.i( + "VoicemailClientImpl.isVoicemailTranscriptionAvailable", "not running on O or later"); + return false; + } + + TranscriptionConfigProvider provider = new TranscriptionConfigProvider(context); + if (!provider.isVoicemailTranscriptionEnabled()) { + LogUtil.i( + "VoicemailClientImpl.isVoicemailTranscriptionAvailable", "feature disabled by config"); + return false; + } + + return true; + } + + @Override + public boolean isVoicemailDonationEnabled(Context context, PhoneAccountHandle account) { + return isVoicemailTranscriptionAvailable(context) + && VisualVoicemailSettingsUtil.isVoicemailDonationEnabled(context, account); + } + + @Override public Intent getSetPinIntent(Context context, PhoneAccountHandle phoneAccountHandle) { Intent intent = new Intent(context, VoicemailChangePinActivity.class); intent.putExtra(VoicemailChangePinActivity.EXTRA_PHONE_ACCOUNT_HANDLE, phoneAccountHandle); |