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

Commit 930f8062 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."...

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

Change-Id: I9aaaa940445cafb43102853d8384584979e68f5a
parents 2c3ba51c 90943499
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);