summaryrefslogtreecommitdiff
path: root/java/com/android/voicemail/impl/fetch/VoicemailFetchedCallback.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/voicemail/impl/fetch/VoicemailFetchedCallback.java')
-rw-r--r--java/com/android/voicemail/impl/fetch/VoicemailFetchedCallback.java18
1 files changed, 2 insertions, 16 deletions
diff --git a/java/com/android/voicemail/impl/fetch/VoicemailFetchedCallback.java b/java/com/android/voicemail/impl/fetch/VoicemailFetchedCallback.java
index d15ce12ef..f386fce0e 100644
--- a/java/com/android/voicemail/impl/fetch/VoicemailFetchedCallback.java
+++ b/java/com/android/voicemail/impl/fetch/VoicemailFetchedCallback.java
@@ -23,12 +23,9 @@ import android.provider.VoicemailContract.Voicemails;
import android.support.annotation.Nullable;
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
-import com.android.dialer.common.Assert;
-import com.android.dialer.common.concurrent.ThreadUtil;
import com.android.voicemail.impl.R;
import com.android.voicemail.impl.VvmLog;
import com.android.voicemail.impl.imap.VoicemailPayload;
-import com.android.voicemail.impl.transcribe.TranscriptionService;
import java.io.IOException;
import java.io.OutputStream;
import org.apache.commons.io.IOUtils;
@@ -59,7 +56,6 @@ public class VoicemailFetchedCallback {
* @param voicemailPayload The object containing the content data for the voicemail
*/
public void setVoicemailContent(@Nullable VoicemailPayload voicemailPayload) {
- Assert.isWorkerThread();
if (voicemailPayload == null) {
VvmLog.i(TAG, "Payload not found, message has unsupported format");
ContentValues values = new ContentValues();
@@ -94,23 +90,13 @@ public class VoicemailFetchedCallback {
ContentValues values = new ContentValues();
values.put(Voicemails.MIME_TYPE, voicemailPayload.getMimeType());
values.put(Voicemails.HAS_CONTENT, true);
- if (updateVoicemail(values)) {
- ThreadUtil.postOnUiThread(
- () -> {
- if (!TranscriptionService.transcribeVoicemail(mContext, mUri)) {
- VvmLog.w(TAG, String.format("Failed to schedule transcription for %s", mUri));
- }
- });
- }
+ updateVoicemail(values);
}
- private boolean updateVoicemail(ContentValues values) {
+ private void updateVoicemail(ContentValues values) {
int updatedCount = mContentResolver.update(mUri, values, null, null);
if (updatedCount != 1) {
VvmLog.e(TAG, "Updating voicemail should have updated 1 row, was: " + updatedCount);
- return false;
- } else {
- return true;
}
}
}