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

Unverified Commit f9167828 authored by Shufeng Hou's avatar Shufeng Hou Committed by Michael Bestas
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 87f9a163
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3146,8 +3146,10 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
        // 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);
        mWakeAndUnlocking = false;