Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0afd6bab authored by uabdullah's avatar uabdullah Committed by Copybara-Service
Browse files

Update what happens when donation is rejected & use correct donation availability check

Checking donation is not a simple config check, but everything that donation availability is dependent on via the isVoicemailDonationAvailable() helper method. We update the code accordingly.

When the user declines the promo for donation, we should also update the toggle accordingly.

Bug: 74033229
Test: N/A
PiperOrigin-RevId: 191011808
Change-Id: I6e4ff9914355deed72175179fc7b9009f2395ef5
parent 26bc51ec
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -356,6 +356,9 @@ public class PhoneCallDetailsHelper
        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);
+3 −1
Original line number Diff line number Diff line
@@ -116,7 +116,9 @@ public class TranscriptionTaskAsync extends TranscriptionTask {
    // 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