Loading android/app/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,9 @@ <!-- Flag whether or not to keep polling AG with CLCC for call information every 2 seconds --> <bool name="hfp_clcc_poll_during_call">true</bool> <!-- Time delay in milliseconds between consecutive polling AG with CLCC for call info --> <integer name="hfp_clcc_poll_interval_during_call">2000</integer> <!-- Package that is providing the exposure notification service --> <string name="exposure_notification_package">com.google.android.gms</string> Loading android/app/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java +13 −4 Original line number Diff line number Diff line Loading @@ -483,7 +483,9 @@ public class HeadsetClientStateMachine extends StateMachine { if (mCalls.size() > 0) { if (mService.getResources().getBoolean(R.bool.hfp_clcc_poll_during_call)) { sendMessageDelayed(QUERY_CURRENT_CALLS, QUERY_CURRENT_CALLS_WAIT_MILLIS); sendMessageDelayed(QUERY_CURRENT_CALLS, mService.getResources().getInteger( R.integer.hfp_clcc_poll_interval_during_call)); } else { if (getCall(BluetoothHeadsetClientCall.CALL_STATE_INCOMING) != null) { logD("Still have incoming call; polling"); Loading Loading @@ -1330,9 +1332,16 @@ public class HeadsetClientStateMachine extends StateMachine { break; case QUERY_CURRENT_CALLS: removeMessages(QUERY_CURRENT_CALLS); if (mCalls.size() > 0) { // If there are ongoing calls periodically check their status. sendMessageDelayed(QUERY_CURRENT_CALLS, QUERY_CURRENT_CALLS_WAIT_MILLIS); if (mCalls.size() > 1 && mService.getResources().getBoolean( R.bool.hfp_clcc_poll_during_call)) { sendMessageDelayed(QUERY_CURRENT_CALLS, mService.getResources().getInteger( R.integer.hfp_clcc_poll_interval_during_call)); } else if (mCalls.size() > 0) { sendMessageDelayed(QUERY_CURRENT_CALLS, QUERY_CURRENT_CALLS_WAIT_MILLIS); } queryCallsStart(); break; Loading android/app/tests/unit/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachineTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,8 @@ public class HeadsetClientStateMachineTest { mAudioManager); when(mHeadsetClientService.getResources()).thenReturn(mMockHfpResources); when(mMockHfpResources.getBoolean(R.bool.hfp_clcc_poll_during_call)).thenReturn(true); when(mMockHfpResources.getInteger(R.integer.hfp_clcc_poll_interval_during_call)) .thenReturn(2000); mNativeInterface = spy(NativeInterface.getInstance()); // This line must be called to make sure relevant objects are initialized properly Loading Loading
android/app/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,9 @@ <!-- Flag whether or not to keep polling AG with CLCC for call information every 2 seconds --> <bool name="hfp_clcc_poll_during_call">true</bool> <!-- Time delay in milliseconds between consecutive polling AG with CLCC for call info --> <integer name="hfp_clcc_poll_interval_during_call">2000</integer> <!-- Package that is providing the exposure notification service --> <string name="exposure_notification_package">com.google.android.gms</string> Loading
android/app/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java +13 −4 Original line number Diff line number Diff line Loading @@ -483,7 +483,9 @@ public class HeadsetClientStateMachine extends StateMachine { if (mCalls.size() > 0) { if (mService.getResources().getBoolean(R.bool.hfp_clcc_poll_during_call)) { sendMessageDelayed(QUERY_CURRENT_CALLS, QUERY_CURRENT_CALLS_WAIT_MILLIS); sendMessageDelayed(QUERY_CURRENT_CALLS, mService.getResources().getInteger( R.integer.hfp_clcc_poll_interval_during_call)); } else { if (getCall(BluetoothHeadsetClientCall.CALL_STATE_INCOMING) != null) { logD("Still have incoming call; polling"); Loading Loading @@ -1330,9 +1332,16 @@ public class HeadsetClientStateMachine extends StateMachine { break; case QUERY_CURRENT_CALLS: removeMessages(QUERY_CURRENT_CALLS); if (mCalls.size() > 0) { // If there are ongoing calls periodically check their status. sendMessageDelayed(QUERY_CURRENT_CALLS, QUERY_CURRENT_CALLS_WAIT_MILLIS); if (mCalls.size() > 1 && mService.getResources().getBoolean( R.bool.hfp_clcc_poll_during_call)) { sendMessageDelayed(QUERY_CURRENT_CALLS, mService.getResources().getInteger( R.integer.hfp_clcc_poll_interval_during_call)); } else if (mCalls.size() > 0) { sendMessageDelayed(QUERY_CURRENT_CALLS, QUERY_CURRENT_CALLS_WAIT_MILLIS); } queryCallsStart(); break; Loading
android/app/tests/unit/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachineTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,8 @@ public class HeadsetClientStateMachineTest { mAudioManager); when(mHeadsetClientService.getResources()).thenReturn(mMockHfpResources); when(mMockHfpResources.getBoolean(R.bool.hfp_clcc_poll_during_call)).thenReturn(true); when(mMockHfpResources.getInteger(R.integer.hfp_clcc_poll_interval_during_call)) .thenReturn(2000); mNativeInterface = spy(NativeInterface.getInstance()); // This line must be called to make sure relevant objects are initialized properly Loading