diff options
author | mdooley <mdooley@google.com> | 2017-12-12 16:14:13 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-12-12 16:17:51 -0800 |
commit | ad2ea23c5762bee680a74d56664644b578625cd2 (patch) | |
tree | f4ee31279134b3e77880ca1675826bc46b51fa04 /java/com/android/voicemail/impl/transcribe | |
parent | d588387ecd4a26c0e5930652cf43371abe47ab74 (diff) |
Cleanup. Changing voicemail_transcription_enabled to voicemail_transcription_available
Follow the convention that features allowed by server configuration flags use the
word 'available' and when a feature is allowed by the user via settings then use the
word 'enabled'
Bug: 37340510
Test: manual and updated unit tests
PiperOrigin-RevId: 178831467
Change-Id: I5691fd7db45a70908d32cdac2b049fe76e6a0680
Diffstat (limited to 'java/com/android/voicemail/impl/transcribe')
-rw-r--r-- | java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java | 5 | ||||
-rw-r--r-- | java/com/android/voicemail/impl/transcribe/TranscriptionService.java | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java b/java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java index 3d1755b64..54a1ae4d4 100644 --- a/java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java +++ b/java/com/android/voicemail/impl/transcribe/TranscriptionConfigProvider.java @@ -28,9 +28,10 @@ public class TranscriptionConfigProvider { this.context = context; } - public boolean isVoicemailTranscriptionEnabled() { + public boolean isVoicemailTranscriptionAvailable() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O - && ConfigProviderBindings.get(context).getBoolean("voicemail_transcription_enabled", false); + && ConfigProviderBindings.get(context) + .getBoolean("voicemail_transcription_available", false); } public String getServerAddress() { diff --git a/java/com/android/voicemail/impl/transcribe/TranscriptionService.java b/java/com/android/voicemail/impl/transcribe/TranscriptionService.java index a19ab6208..0f5300358 100644 --- a/java/com/android/voicemail/impl/transcribe/TranscriptionService.java +++ b/java/com/android/voicemail/impl/transcribe/TranscriptionService.java @@ -142,8 +142,8 @@ public class TranscriptionService extends JobService { public boolean onStartJob(JobParameters params) { Assert.isMainThread(); LogUtil.enterBlock("TranscriptionService.onStartJob"); - if (!getConfigProvider().isVoicemailTranscriptionEnabled()) { - LogUtil.i("TranscriptionService.onStartJob", "transcription not enabled, exiting."); + if (!getConfigProvider().isVoicemailTranscriptionAvailable()) { + LogUtil.i("TranscriptionService.onStartJob", "transcription not available, exiting."); return false; } else if (TextUtils.isEmpty(getConfigProvider().getServerAddress())) { LogUtil.i("TranscriptionService.onStartJob", "transcription server not configured, exiting."); |