Merge "Update what happens when donation is rejected & use correct donation availability check"
diff --git a/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java b/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java
index 096488a..680424a 100644
--- a/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java
+++ b/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java
@@ -356,6 +356,9 @@
         new DialogInterface.OnClickListener() {
           @Override
           public void onClick(final DialogInterface dialog, final int button) {
+            VoicemailComponent.get(context)
+                .getVoicemailClient()
+                .setVoicemailDonationEnabled(context, details.accountHandle, false);
             dialog.cancel();
             recordPromoShown(context);
             ratingView.setVisibility(View.GONE);
diff --git a/java/com/android/voicemail/impl/transcribe/TranscriptionTaskAsync.java b/java/com/android/voicemail/impl/transcribe/TranscriptionTaskAsync.java
index f6035fd..60a6811 100644
--- a/java/com/android/voicemail/impl/transcribe/TranscriptionTaskAsync.java
+++ b/java/com/android/voicemail/impl/transcribe/TranscriptionTaskAsync.java
@@ -116,7 +116,9 @@
     // Generate the transcript id locally if configured to do so, or if voicemail donation is
     // available (because rating donating voicemails requires locally generated voicemail ids).
     if (configProvider.useClientGeneratedVoicemailIds()
-        || configProvider.isVoicemailDonationAvailable()) {
+        || VoicemailComponent.get(context)
+            .getVoicemailClient()
+            .isVoicemailDonationAvailable(context, phoneAccountHandle)) {
       // The server currently can't handle repeated transcription id's so if we add the Uri to the
       // fingerprint (which contains the voicemail id) which is different each time a voicemail is
       // downloaded.  If this becomes a problem then it should be possible to change the server