diff options
Diffstat (limited to 'java/com/android/voicemail/impl/transcribe')
-rw-r--r-- | java/com/android/voicemail/impl/transcribe/TranscriptionBackfillService.java | 7 | ||||
-rw-r--r-- | java/com/android/voicemail/impl/transcribe/TranscriptionDbHelper.java | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/java/com/android/voicemail/impl/transcribe/TranscriptionBackfillService.java b/java/com/android/voicemail/impl/transcribe/TranscriptionBackfillService.java index 8161e71f7..8fc40ee99 100644 --- a/java/com/android/voicemail/impl/transcribe/TranscriptionBackfillService.java +++ b/java/com/android/voicemail/impl/transcribe/TranscriptionBackfillService.java @@ -22,6 +22,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.net.Uri; +import android.os.Bundle; import android.support.annotation.WorkerThread; import android.support.v4.app.JobIntentService; import android.support.v4.os.BuildCompat; @@ -66,6 +67,10 @@ public class TranscriptionBackfillService extends JobIntentService { protected void onHandleWork(Intent intent) { LogUtil.enterBlock("TranscriptionBackfillService.onHandleWork"); + Bundle bundle = intent.getExtras(); + final PhoneAccountHandle account = + (PhoneAccountHandle) bundle.get(TranscriptionService.EXTRA_ACCOUNT_HANDLE); + TranscriptionDbHelper dbHelper = new TranscriptionDbHelper(this); List<Uri> untranscribed = dbHelper.getUntranscribedVoicemails(); LogUtil.i( @@ -75,7 +80,7 @@ public class TranscriptionBackfillService extends JobIntentService { for (Uri uri : untranscribed) { ThreadUtil.postOnUiThread( () -> { - TranscriptionService.scheduleNewVoicemailTranscriptionJob(this, uri, null, false); + TranscriptionService.scheduleNewVoicemailTranscriptionJob(this, uri, account, false); }); } } diff --git a/java/com/android/voicemail/impl/transcribe/TranscriptionDbHelper.java b/java/com/android/voicemail/impl/transcribe/TranscriptionDbHelper.java index 24c07cc37..6ffb8485d 100644 --- a/java/com/android/voicemail/impl/transcribe/TranscriptionDbHelper.java +++ b/java/com/android/voicemail/impl/transcribe/TranscriptionDbHelper.java @@ -87,7 +87,14 @@ public class TranscriptionDbHelper { Assert.isWorkerThread(); List<Uri> untranscribed = new ArrayList<>(); String whereClause = - Voicemails.TRANSCRIPTION + " is NULL AND " + VoicemailCompat.TRANSCRIPTION_STATE + "=?"; + "(" + + Voicemails.TRANSCRIPTION + + " is NULL OR " + + Voicemails.TRANSCRIPTION + + " = '')" + + " AND " + + VoicemailCompat.TRANSCRIPTION_STATE + + "=?"; String[] whereArgs = {String.valueOf(VoicemailCompat.TRANSCRIPTION_NOT_STARTED)}; try (Cursor cursor = contentResolver.query(uri, PROJECTION, whereClause, whereArgs, null)) { if (cursor == null) { |