Loading res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -46,4 +46,8 @@ <!-- DTMF key to be used for LCH hold tone --> <string name="Lch_dtmf_key" translatable="false">D</string> <!-- Flag indicating if the speed up audio on mt call code should be executed --> <bool name="config_speed_up_audio_on_mt_calls">false</bool> </resources> src/com/android/server/telecom/CallAudioManager.java +28 −4 Original line number Diff line number Diff line Loading @@ -43,6 +43,9 @@ final class CallAudioManager extends CallsManagerListenerBase private boolean mIsTonePlaying; private boolean mWasSpeakerOn; private int mMostRecentlyUsedMode = AudioManager.MODE_IN_CALL; private boolean mSpeedUpAudioForMtCall = false; private Context mContext; private String mSubId; CallAudioManager(Context context, StatusBarNotifier statusBarNotifier, WiredHeadsetManager wiredHeadsetManager) { Loading @@ -54,6 +57,7 @@ final class CallAudioManager extends CallsManagerListenerBase saveAudioState(getInitialAudioState(null)); mAudioFocusStreamType = STREAM_NONE; mContext = context; } AudioState getAudioState() { Loading Loading @@ -102,8 +106,21 @@ final class CallAudioManager extends CallsManagerListenerBase mBluetoothManager.connectBluetoothAudio(); route = AudioState.ROUTE_BLUETOOTH; } setSystemAudioState(false /* isMute */, route, mAudioState.supportedRouteMask); if (mContext == null) { Log.d(this, "Speedup Audio Path enhancement: Context is null"); } else if (mContext.getResources().getBoolean( com.android.server.telecom.R.bool.config_speed_up_audio_on_mt_calls)) { Log.d(this, "Speedup Audio Path enhancement"); mSpeedUpAudioForMtCall = true; mSubId = call.getTargetPhoneAccount().getId(); if (mIsRinging) { setIsRinging(false); } else { updateAudioStreamAndMode(); } } } @Override Loading Loading @@ -262,7 +279,11 @@ final class CallAudioManager extends CallsManagerListenerBase private void onCallUpdated(Call call) { boolean wasNotVoiceCall = mAudioFocusStreamType != AudioManager.STREAM_VOICE_CALL; updateAudioStreamAndMode(); if ((call != null) && (call.getState() == CallState.ACTIVE) && call.getTargetPhoneAccount().getId().equals(mSubId) && mSpeedUpAudioForMtCall) { Log.d(this,"Reset mSpeedUpAudioForMtCall"); mSpeedUpAudioForMtCall = false; } // 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 @@ -336,7 +357,8 @@ final class CallAudioManager extends CallsManagerListenerBase private void updateAudioStreamAndMode() { Log.i(this, "updateAudioStreamAndMode, mIsRinging: %b, mIsTonePlaying: %b", mIsRinging, mIsTonePlaying); if (mIsRinging) { Log.v(this, "updateAudioStreamAndMode, mSpeedUpAudioForMtCall: %b", mSpeedUpAudioForMtCall); if (mIsRinging && !mSpeedUpAudioForMtCall) { requestAudioFocusAndSetMode(AudioManager.STREAM_RING, AudioManager.MODE_RINGTONE); } else { Call call = getForegroundCall(); Loading Loading @@ -384,6 +406,7 @@ final class CallAudioManager extends CallsManagerListenerBase Log.v(this, "abandoning audio focus"); mAudioManager.abandonAudioFocusForCall(); mAudioFocusStreamType = STREAM_NONE; mSpeedUpAudioForMtCall = false; } } Loading @@ -403,6 +426,7 @@ final class CallAudioManager extends CallsManagerListenerBase mAudioManager.setMode(AudioManager.MODE_NORMAL); } mAudioManager.setMode(newMode); Log.d(this, "SetMode Done"); mMostRecentlyUsedMode = newMode; } } Loading Loading @@ -488,7 +512,7 @@ final class CallAudioManager extends CallsManagerListenerBase // We ignore any foreground call that is in the ringing state because we deal with ringing // calls exclusively through the mIsRinging variable set by {@link Ringer}. if (call != null && call.getState() == CallState.RINGING) { if (call != null && call.getState() == CallState.RINGING && !mSpeedUpAudioForMtCall ) { call = null; } return call; Loading Loading
res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -46,4 +46,8 @@ <!-- DTMF key to be used for LCH hold tone --> <string name="Lch_dtmf_key" translatable="false">D</string> <!-- Flag indicating if the speed up audio on mt call code should be executed --> <bool name="config_speed_up_audio_on_mt_calls">false</bool> </resources>
src/com/android/server/telecom/CallAudioManager.java +28 −4 Original line number Diff line number Diff line Loading @@ -43,6 +43,9 @@ final class CallAudioManager extends CallsManagerListenerBase private boolean mIsTonePlaying; private boolean mWasSpeakerOn; private int mMostRecentlyUsedMode = AudioManager.MODE_IN_CALL; private boolean mSpeedUpAudioForMtCall = false; private Context mContext; private String mSubId; CallAudioManager(Context context, StatusBarNotifier statusBarNotifier, WiredHeadsetManager wiredHeadsetManager) { Loading @@ -54,6 +57,7 @@ final class CallAudioManager extends CallsManagerListenerBase saveAudioState(getInitialAudioState(null)); mAudioFocusStreamType = STREAM_NONE; mContext = context; } AudioState getAudioState() { Loading Loading @@ -102,8 +106,21 @@ final class CallAudioManager extends CallsManagerListenerBase mBluetoothManager.connectBluetoothAudio(); route = AudioState.ROUTE_BLUETOOTH; } setSystemAudioState(false /* isMute */, route, mAudioState.supportedRouteMask); if (mContext == null) { Log.d(this, "Speedup Audio Path enhancement: Context is null"); } else if (mContext.getResources().getBoolean( com.android.server.telecom.R.bool.config_speed_up_audio_on_mt_calls)) { Log.d(this, "Speedup Audio Path enhancement"); mSpeedUpAudioForMtCall = true; mSubId = call.getTargetPhoneAccount().getId(); if (mIsRinging) { setIsRinging(false); } else { updateAudioStreamAndMode(); } } } @Override Loading Loading @@ -262,7 +279,11 @@ final class CallAudioManager extends CallsManagerListenerBase private void onCallUpdated(Call call) { boolean wasNotVoiceCall = mAudioFocusStreamType != AudioManager.STREAM_VOICE_CALL; updateAudioStreamAndMode(); if ((call != null) && (call.getState() == CallState.ACTIVE) && call.getTargetPhoneAccount().getId().equals(mSubId) && mSpeedUpAudioForMtCall) { Log.d(this,"Reset mSpeedUpAudioForMtCall"); mSpeedUpAudioForMtCall = false; } // 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 @@ -336,7 +357,8 @@ final class CallAudioManager extends CallsManagerListenerBase private void updateAudioStreamAndMode() { Log.i(this, "updateAudioStreamAndMode, mIsRinging: %b, mIsTonePlaying: %b", mIsRinging, mIsTonePlaying); if (mIsRinging) { Log.v(this, "updateAudioStreamAndMode, mSpeedUpAudioForMtCall: %b", mSpeedUpAudioForMtCall); if (mIsRinging && !mSpeedUpAudioForMtCall) { requestAudioFocusAndSetMode(AudioManager.STREAM_RING, AudioManager.MODE_RINGTONE); } else { Call call = getForegroundCall(); Loading Loading @@ -384,6 +406,7 @@ final class CallAudioManager extends CallsManagerListenerBase Log.v(this, "abandoning audio focus"); mAudioManager.abandonAudioFocusForCall(); mAudioFocusStreamType = STREAM_NONE; mSpeedUpAudioForMtCall = false; } } Loading @@ -403,6 +426,7 @@ final class CallAudioManager extends CallsManagerListenerBase mAudioManager.setMode(AudioManager.MODE_NORMAL); } mAudioManager.setMode(newMode); Log.d(this, "SetMode Done"); mMostRecentlyUsedMode = newMode; } } Loading Loading @@ -488,7 +512,7 @@ final class CallAudioManager extends CallsManagerListenerBase // We ignore any foreground call that is in the ringing state because we deal with ringing // calls exclusively through the mIsRinging variable set by {@link Ringer}. if (call != null && call.getState() == CallState.RINGING) { if (call != null && call.getState() == CallState.RINGING && !mSpeedUpAudioForMtCall ) { call = null; } return call; Loading