From b19c1e01e2cb8ab065c96f35289bb64fe13519b9 Mon Sep 17 00:00:00 2001 From: Josh Tsuji Date: Mon, 28 Jun 2021 15:52:43 -0400 Subject: Play sounds only once, on keyguard exit. Fixes: 192083598 Test: unlock in every which way and hear 1 unlock sound instead of 2 Change-Id: I9219a85de1c934a903acb038840b6182ef0a3c55 --- .../com/android/systemui/keyguard/KeyguardViewMediator.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 88e9f69620ed..4f32b4613543 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -2178,12 +2178,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, mDrawnCallback = null; } - // only play "unlock" noises if not on a call (since the incall UI - // disables the keyguard) - if (TelephonyManager.EXTRA_STATE_IDLE.equals(mPhoneState)) { - playSounds(false); - } - LatencyTracker.getInstance(mContext) .onActionEnd(LatencyTracker.ACTION_LOCKSCREEN_UNLOCK); @@ -2301,6 +2295,13 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, } private void onKeyguardExitFinished() { + // only play "unlock" noises if not on a call (since the incall UI + // disables the keyguard) + if (TelephonyManager.EXTRA_STATE_IDLE.equals(mPhoneState)) { + Log.i("TEST", "playSounds: false"); + playSounds(false); + } + setShowingLocked(false); mWakeAndUnlocking = false; mDismissCallbackRegistry.notifyDismissSucceeded(); -- cgit v1.2.3-59-g8ed1b