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

Commit 2bf96d9b authored by Beverly's avatar Beverly
Browse files

Fingerprint enrollment vibrate unchanged by dnd

Turning on dnd (and not allowing touch sounds) doesn't
prevent the vibrations for fingerprint enrollment in settings,
because now it'll have the correct sonification attributes
that aren't muted by DND.

Bug: 76016723
Test: manual
Change-Id: I51cb14b25a2555628ff475c3a1b9e55fb3234c14
parent 7ac7d7b6
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.hardware.fingerprint.FingerprintManager;
import android.media.AudioAttributes;
import android.os.Bundle;
import android.os.UserHandle;
import android.os.VibrationEffect;
@@ -78,6 +79,11 @@ public class FingerprintEnrollEnrolling extends FingerprintEnrollBase

    private static final VibrationEffect VIBRATE_EFFECT_ERROR =
            VibrationEffect.createWaveform(new long[] {0, 5, 55, 60}, -1);
    private static final AudioAttributes FINGERPRINT_ENROLLING_SONFICATION_ATTRIBUTES =
            new AudioAttributes.Builder()
                    .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
                    .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
                    .build();

    private ProgressBar mProgressBar;
    private ObjectAnimator mProgressAnim;
@@ -376,7 +382,7 @@ public class FingerprintEnrollEnrolling extends FingerprintEnrollBase
            mErrorText.setTranslationY(0f);
        }
        if (isResumed()) {
            mVibrator.vibrate(VIBRATE_EFFECT_ERROR);
            mVibrator.vibrate(VIBRATE_EFFECT_ERROR, FINGERPRINT_ENROLLING_SONFICATION_ATTRIBUTES);
        }
    }