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

Commit eabf2012 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Ensure setHapticsChannelsMuted is set false when haptics should be on." into qt-dev

parents 0fd0ebfa 8202bd8c
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -214,11 +214,13 @@ public class AsyncRingtonePlayer {

                Log.i(this, "handlePlay: hasHaptics=%b, isVibrationEnabled=%b", hasHaptics,
                        isVibrationEnabled);
                if (!isVibrationEnabled && hasHaptics) {
                    Log.i(this, "handlePlay: muting haptic channel");
                if (hasHaptics) {
                    AudioAttributes attributes = mRingtone.getAudioAttributes();
                    Log.d(this, "handlePlay: %s haptic channel",
                            (isVibrationEnabled ? "unmuting" : "muting"));
                    mRingtone.setAudioAttributes(
                            new AudioAttributes.Builder()
                                .setHapticChannelsMuted(true)
                            new AudioAttributes.Builder(attributes)
                                    .setHapticChannelsMuted(!isVibrationEnabled)
                                    .build());
                }
                mHapticsFuture.complete(hasHaptics);