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

Commit 7c2b8a37 authored by Shufeng Hou's avatar Shufeng Hou Committed by Dan Pasanen
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.

Fixes Lineage: BUGBASH-56

Change-Id: I396588579a3be3b3210e619179d2a57211904644
CRs-Fixed: 900840
parent 39087bf4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1776,8 +1776,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);
                }
            }

            mWakeAndUnlocking = false;
            setShowingLocked(false);