diff options
author | Daniel Sandler <dsandler@google.com> | 2010-02-22 13:09:48 -0500 |
---|---|---|
committer | Daniel Sandler <dsandler@google.com> | 2010-02-22 13:27:55 -0500 |
commit | f2d8e74c0230f53acdc6f94652961e4adb0e134a (patch) | |
tree | 399c104fff2f11d66127f9b19f16f4d4d4d19059 /policy | |
parent | 43cfa0e2d3b070c782247fa20e9e15090b441033 (diff) | |
download | frameworks_base-f2d8e74c0230f53acdc6f94652961e4adb0e134a.zip frameworks_base-f2d8e74c0230f53acdc6f94652961e4adb0e134a.tar.gz frameworks_base-f2d8e74c0230f53acdc6f94652961e4adb0e134a.tar.bz2 |
Suppress unlock noises while in-call.
Bug: 2458106
Diffstat (limited to 'policy')
-rw-r--r-- | policy/com/android/internal/policy/impl/KeyguardViewMediator.java | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/policy/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/com/android/internal/policy/impl/KeyguardViewMediator.java index f82d1a9..1a2898f 100644 --- a/policy/com/android/internal/policy/impl/KeyguardViewMediator.java +++ b/policy/com/android/internal/policy/impl/KeyguardViewMediator.java @@ -225,6 +225,9 @@ public class KeyguardViewMediator implements KeyguardViewCallback, private boolean mScreenOn = false; + // last known state of the cellular connection + private String mPhoneState = TelephonyManager.EXTRA_STATE_IDLE; + /** * we send this intent when the keyguard is dismissed. */ @@ -683,19 +686,21 @@ public class KeyguardViewMediator implements KeyguardViewCallback, if (mDelayedShowingSequence == sequence) { doKeyguard(); } - } else if (TelephonyManager.ACTION_PHONE_STATE_CHANGED.equals(action) - && TelephonyManager.EXTRA_STATE_IDLE.equals(intent.getStringExtra( - TelephonyManager.EXTRA_STATE)) // call ending - && !mScreenOn // screen off - && mExternallyEnabled) { // not disabled by any app - - // note: this is a way to gracefully reenable the keyguard when the call - // ends and the screen is off without always reenabling the keyguard - // each time the screen turns off while in call (and having an occasional ugly - // flicker while turning back on the screen and disabling the keyguard again). - if (DEBUG) Log.d(TAG, "screen is off and call ended, let's make sure the " - + "keyguard is showing"); - doKeyguard(); + } else if (TelephonyManager.ACTION_PHONE_STATE_CHANGED.equals(action)) { + mPhoneState = intent.getStringExtra(TelephonyManager.EXTRA_STATE); + + if (TelephonyManager.EXTRA_STATE_IDLE.equals(mPhoneState) // call ending + && !mScreenOn // screen off + && mExternallyEnabled) { // not disabled by any app + + // note: this is a way to gracefully reenable the keyguard when the call + // ends and the screen is off without always reenabling the keyguard + // each time the screen turns off while in call (and having an occasional ugly + // flicker while turning back on the screen and disabling the keyguard again). + if (DEBUG) Log.d(TAG, "screen is off and call ended, let's make sure the " + + "keyguard is showing"); + doKeyguard(); + } } } }; @@ -977,7 +982,11 @@ public class KeyguardViewMediator implements KeyguardViewCallback, return; } - playSounds(false); + // 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); + } mKeyguardViewManager.hide(); mShowing = false; |