Loading src/com/android/server/telecom/CallAudioManager.java +17 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ final class CallAudioManager extends CallsManagerListenerBase private boolean mIsTonePlaying; private boolean mWasSpeakerOn; private int mMostRecentlyUsedMode = AudioManager.MODE_IN_CALL; private Call mCallToSpeedUpMTAudio = null; CallAudioManager(Context context, StatusBarNotifier statusBarNotifier, WiredHeadsetManager wiredHeadsetManager) { Loading Loading @@ -106,6 +107,12 @@ final class CallAudioManager extends CallsManagerListenerBase } setSystemAudioState(false /* isMute */, route, mAudioState.getSupportedRouteMask()); if (call.can(android.telecom.Call.Details.CAPABILITY_SPEED_UP_MT_AUDIO)) { Log.v(this, "Speed up audio setup for IMS MT call."); mCallToSpeedUpMTAudio = call; updateAudioStreamAndMode(); } } @Override Loading Loading @@ -282,6 +289,10 @@ final class CallAudioManager extends CallsManagerListenerBase boolean wasNotVoiceCall = mAudioFocusStreamType != AudioManager.STREAM_VOICE_CALL; updateAudioStreamAndMode(); if (call != null && call.getState() == CallState.ACTIVE && call == mCallToSpeedUpMTAudio) { mCallToSpeedUpMTAudio = null; } // If we transition from not voice call to voice call, we need to set an initial state. if (wasNotVoiceCall && mAudioFocusStreamType == AudioManager.STREAM_VOICE_CALL) { setInitialAudioState(call, true /* force */); Loading Loading @@ -361,7 +372,11 @@ final class CallAudioManager extends CallsManagerListenerBase Call foregroundCall = getForegroundCall(); Call waitingForAccountSelectionCall = CallsManager.getInstance().getFirstCallWithState(CallState.PRE_DIAL_WAIT); if (foregroundCall != null && waitingForAccountSelectionCall == null) { Call call = CallsManager.getInstance().getForegroundCall(); if (foregroundCall == null && call != null && call == mCallToSpeedUpMTAudio) { requestAudioFocusAndSetMode(AudioManager.STREAM_VOICE_CALL, AudioManager.MODE_IN_CALL); } else if (foregroundCall != null && waitingForAccountSelectionCall == null) { // In the case where there is a call that is waiting for account selection, // this will fall back to abandonAudioFocus() below, which temporarily exits // the in-call audio mode. This is to allow TalkBack to speak the "Call with" Loading Loading @@ -412,6 +427,7 @@ final class CallAudioManager extends CallsManagerListenerBase Log.v(this, "abandoning audio focus"); mAudioManager.abandonAudioFocusForCall(); mAudioFocusStreamType = STREAM_NONE; mCallToSpeedUpMTAudio = null; } } Loading Loading
src/com/android/server/telecom/CallAudioManager.java +17 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ final class CallAudioManager extends CallsManagerListenerBase private boolean mIsTonePlaying; private boolean mWasSpeakerOn; private int mMostRecentlyUsedMode = AudioManager.MODE_IN_CALL; private Call mCallToSpeedUpMTAudio = null; CallAudioManager(Context context, StatusBarNotifier statusBarNotifier, WiredHeadsetManager wiredHeadsetManager) { Loading Loading @@ -106,6 +107,12 @@ final class CallAudioManager extends CallsManagerListenerBase } setSystemAudioState(false /* isMute */, route, mAudioState.getSupportedRouteMask()); if (call.can(android.telecom.Call.Details.CAPABILITY_SPEED_UP_MT_AUDIO)) { Log.v(this, "Speed up audio setup for IMS MT call."); mCallToSpeedUpMTAudio = call; updateAudioStreamAndMode(); } } @Override Loading Loading @@ -282,6 +289,10 @@ final class CallAudioManager extends CallsManagerListenerBase boolean wasNotVoiceCall = mAudioFocusStreamType != AudioManager.STREAM_VOICE_CALL; updateAudioStreamAndMode(); if (call != null && call.getState() == CallState.ACTIVE && call == mCallToSpeedUpMTAudio) { mCallToSpeedUpMTAudio = null; } // If we transition from not voice call to voice call, we need to set an initial state. if (wasNotVoiceCall && mAudioFocusStreamType == AudioManager.STREAM_VOICE_CALL) { setInitialAudioState(call, true /* force */); Loading Loading @@ -361,7 +372,11 @@ final class CallAudioManager extends CallsManagerListenerBase Call foregroundCall = getForegroundCall(); Call waitingForAccountSelectionCall = CallsManager.getInstance().getFirstCallWithState(CallState.PRE_DIAL_WAIT); if (foregroundCall != null && waitingForAccountSelectionCall == null) { Call call = CallsManager.getInstance().getForegroundCall(); if (foregroundCall == null && call != null && call == mCallToSpeedUpMTAudio) { requestAudioFocusAndSetMode(AudioManager.STREAM_VOICE_CALL, AudioManager.MODE_IN_CALL); } else if (foregroundCall != null && waitingForAccountSelectionCall == null) { // In the case where there is a call that is waiting for account selection, // this will fall back to abandonAudioFocus() below, which temporarily exits // the in-call audio mode. This is to allow TalkBack to speak the "Call with" Loading Loading @@ -412,6 +427,7 @@ final class CallAudioManager extends CallsManagerListenerBase Log.v(this, "abandoning audio focus"); mAudioManager.abandonAudioFocusForCall(); mAudioFocusStreamType = STREAM_NONE; mCallToSpeedUpMTAudio = null; } } Loading