diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-11-29 20:53:07 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-11-29 20:53:07 +0000 |
commit | b500efc0b02591031c349a69235fc26cde991536 (patch) | |
tree | 0145604277fbcf00e8bf48b835a5a9d7fb922e40 /java/com/android/voicemail/impl/transcribe/TranscriptionUtils.java | |
parent | 0e029e7f6d270eda757ccd5981ea4c18489fbdd5 (diff) | |
parent | b9ca335dbbc3325643549f6fbf2dac06a5502d26 (diff) |
Merge changes Ie04496dc,Ib2998f03,I6cf53e50,Id6eaaad2
* changes:
Delete voicemails when disabling visual voicemail
Switching to alarms and exponential backoff while polling for transcription result
Format number for SIM selection
Disable phone number formatting on the dialpad when making domestic call to Argentina mobile numbers.
Diffstat (limited to 'java/com/android/voicemail/impl/transcribe/TranscriptionUtils.java')
-rw-r--r-- | java/com/android/voicemail/impl/transcribe/TranscriptionUtils.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/java/com/android/voicemail/impl/transcribe/TranscriptionUtils.java b/java/com/android/voicemail/impl/transcribe/TranscriptionUtils.java index 36b1400be..3bd14731f 100644 --- a/java/com/android/voicemail/impl/transcribe/TranscriptionUtils.java +++ b/java/com/android/voicemail/impl/transcribe/TranscriptionUtils.java @@ -18,6 +18,8 @@ package com.android.voicemail.impl.transcribe; import android.annotation.TargetApi; import android.content.Context; import android.net.Uri; +import android.os.Build.VERSION_CODES; +import android.support.annotation.Nullable; import android.util.Base64; import com.android.dialer.common.Assert; import com.google.internal.communications.voicemailtranscription.v1.AudioFormat; @@ -47,11 +49,14 @@ public class TranscriptionUtils { : AudioFormat.AUDIO_FORMAT_UNSPECIFIED; } - @TargetApi(android.os.Build.VERSION_CODES.O) - static String getFingerprintFor(ByteString data) { + @TargetApi(VERSION_CODES.O) + static String getFingerprintFor(ByteString data, @Nullable String salt) { Assert.checkArgument(data != null); try { MessageDigest md = MessageDigest.getInstance("MD5"); + if (salt != null) { + md.update(salt.getBytes()); + } byte[] md5Bytes = md.digest(data.toByteArray()); return Base64.encodeToString(md5Bytes, Base64.DEFAULT); } catch (NoSuchAlgorithmException e) { |