diff options
author | mdooley <mdooley@google.com> | 2017-11-16 21:25:00 -0800 |
---|---|---|
committer | zachh <zachh@google.com> | 2017-11-18 07:34:02 +0000 |
commit | 22ff338e7383592443da291587442deb5f4e6758 (patch) | |
tree | 0cef544e68491f4c067b4e41b1b5d80909363394 /java/com/android/voicemail/impl/transcribe/TranscriptionBackfillService.java | |
parent | e53711736e4da5ae7f722e54182f1cb51082d45c (diff) |
Don't transcribe voicemail unless carrier allows OTT transcription
Added a carrier config and check to see if the carrier allows over
the top voicemail transcription, and if not do not attempt transcription.
Bug: 68951869
Test: manual and unit test
PiperOrigin-RevId: 176065849
Change-Id: I69df1f2867420d7fdcc7f0a31e0e6c26da67abb1
Diffstat (limited to 'java/com/android/voicemail/impl/transcribe/TranscriptionBackfillService.java')
-rw-r--r-- | java/com/android/voicemail/impl/transcribe/TranscriptionBackfillService.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/java/com/android/voicemail/impl/transcribe/TranscriptionBackfillService.java b/java/com/android/voicemail/impl/transcribe/TranscriptionBackfillService.java index f7f643932..8161e71f7 100644 --- a/java/com/android/voicemail/impl/transcribe/TranscriptionBackfillService.java +++ b/java/com/android/voicemail/impl/transcribe/TranscriptionBackfillService.java @@ -25,6 +25,7 @@ import android.net.Uri; import android.support.annotation.WorkerThread; import android.support.v4.app.JobIntentService; import android.support.v4.os.BuildCompat; +import android.telecom.PhoneAccountHandle; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.ThreadUtil; import com.android.dialer.constants.ScheduledJobIds; @@ -38,7 +39,7 @@ import java.util.List; public class TranscriptionBackfillService extends JobIntentService { /** Schedule a task to scan the database for untranscribed voicemails */ - public static boolean scheduleTask(Context context) { + public static boolean scheduleTask(Context context, PhoneAccountHandle account) { if (BuildCompat.isAtLeastO()) { LogUtil.enterBlock("TranscriptionBackfillService.transcribeOldVoicemails"); ComponentName componentName = new ComponentName(context, TranscriptionBackfillService.class); @@ -46,15 +47,17 @@ public class TranscriptionBackfillService extends JobIntentService { new JobInfo.Builder(ScheduledJobIds.VVM_TRANSCRIPTION_BACKFILL_JOB, componentName) .setRequiredNetworkType(JobInfo.NETWORK_TYPE_UNMETERED); JobScheduler scheduler = context.getSystemService(JobScheduler.class); - return scheduler.enqueue(builder.build(), makeWorkItem()) == JobScheduler.RESULT_SUCCESS; + return scheduler.enqueue(builder.build(), makeWorkItem(account)) + == JobScheduler.RESULT_SUCCESS; } else { LogUtil.i("TranscriptionBackfillService.transcribeOldVoicemails", "not supported"); return false; } } - private static JobWorkItem makeWorkItem() { + private static JobWorkItem makeWorkItem(PhoneAccountHandle account) { Intent intent = new Intent(); + intent.putExtra(TranscriptionService.EXTRA_ACCOUNT_HANDLE, account); return new JobWorkItem(intent); } |