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

Commit d97c3417 authored by Shufeng Hou's avatar Shufeng Hou Committed by Steve Kondik
Browse files

SystemUI: Fix the unlock sound played repeatedly

Sometimes keyguardDone() may be invoked from PhoneWindowManager many times
in a short time, especially when app works with FLAG_DISMISS_KEYGUARD.

Make sure the unlock sound is only played when keyguard is showing and the
screen is on.

Change-Id: I396588579a3be3b3210e619179d2a57211904644
CRs-Fixed: 900840
parent 280b65c5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1671,8 +1671,10 @@ public class KeyguardViewMediator extends SystemUI {
            // only play "unlock" noises if not on a call (since the incall UI
            // disables the keyguard)
            if (TelephonyManager.EXTRA_STATE_IDLE.equals(mPhoneState)) {
                if (mShowing && mDeviceInteractive) {
                    playSounds(false);
                }
            }

            setShowingLocked(false);
            mStatusBarKeyguardViewManager.hide(startTime, fadeoutDuration);