From f96269ab4d5081fafc9be94d110806a21031dc5e Mon Sep 17 00:00:00 2001 From: rago Date: Tue, 26 Mar 2019 10:34:04 -0700 Subject: [PATCH] Enabling HW detection while phone ringing Updated logic to allow HotWord detection while phone is ringing (still not off-hook). Test: Manual Testing Bug: 124762676 Change-Id: Idce6d39a5589aee6d5baa4e5bcd8d98b3e13b239 --- .../com/android/server/soundtrigger/SoundTriggerHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java b/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java index 3d7cbb51a3adb..94352b21db878 100644 --- a/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java +++ b/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java @@ -889,7 +889,7 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { public void onCallStateChanged(int state, String arg1) { if (DBG) Slog.d(TAG, "onCallStateChanged: " + state); synchronized (mLock) { - onCallStateChangedLocked(TelephonyManager.CALL_STATE_IDLE != state); + onCallStateChangedLocked(TelephonyManager.CALL_STATE_OFFHOOK == state); } } } @@ -924,7 +924,7 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { long token = Binder.clearCallingIdentity(); try { // Get the current call state synchronously for the first recognition. - mCallActive = mTelephonyManager.getCallState() != TelephonyManager.CALL_STATE_IDLE; + mCallActive = mTelephonyManager.getCallState() == TelephonyManager.CALL_STATE_OFFHOOK; // Register for call state changes when the first call to start recognition occurs. mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE);