File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed
telephony/java/com/android/internal/telephony Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -379,18 +379,19 @@ public void setAudioMode() {
379379 mode = AudioManager .MODE_RINGTONE ;
380380 break ;
381381 case OFFHOOK :
382- Phone fgPhone = getFgPhone ();
383- // While foreground call is in DIALING,
384- // ALERTING, ACTIVE and DISCONNECTING state
385- if (getActiveFgCallState () != Call .State .IDLE
386- && getActiveFgCallState () != Call .State .DISCONNECTED ) {
387- if (fgPhone instanceof SipPhone ) {
388- // enable IN_COMMUNICATION audio mode for sipPhone
389- mode = AudioManager .MODE_IN_COMMUNICATION ;
390- } else {
391- // enable IN_CALL audio mode for telephony
392- mode = AudioManager .MODE_IN_CALL ;
393- }
382+ Phone offhookPhone = getFgPhone ();
383+ if (getActiveFgCallState () == Call .State .IDLE ) {
384+ // There is no active Fg calls, the OFFHOOK state
385+ // is set by the Bg call. So set the phone to bgPhone.
386+ offhookPhone = getBgPhone ();
387+ }
388+
389+ if (offhookPhone instanceof SipPhone ) {
390+ // enable IN_COMMUNICATION audio mode for sipPhone
391+ mode = AudioManager .MODE_IN_COMMUNICATION ;
392+ } else {
393+ // enable IN_CALL audio mode for telephony
394+ mode = AudioManager .MODE_IN_CALL ;
394395 }
395396 break ;
396397 }
You can’t perform that action at this time.
0 commit comments