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

Commit 90943499 authored by Tyler Gunn's avatar Tyler Gunn Committed by android-build-merger
Browse files

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

am: eabf2012

Change-Id: I2f343782ce8531273d3e91cfb174e3d0f87b723d
parents ebdf0a0c eabf2012
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);