Loading src/com/android/server/telecom/Call.java +4 −0 Original line number Diff line number Diff line Loading @@ -1433,6 +1433,10 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, if ((mConnectionProperties & Connection.PROPERTY_IS_RTT) == Connection.PROPERTY_IS_RTT) { createRttStreams(); if (isEmergencyCall()) { mCallsManager.setAudioRoute(CallAudioState.ROUTE_SPEAKER, null); mCallsManager.mute(false); } } mWasHighDefAudio = (connectionProperties & Connection.PROPERTY_HIGH_DEF_AUDIO) == Connection.PROPERTY_HIGH_DEF_AUDIO; Loading src/com/android/server/telecom/CallAudioRouteStateMachine.java +8 −1 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ public class CallAudioRouteStateMachine extends StateMachine { put(MUTE_ON, "MUTE_ON"); put(MUTE_OFF, "MUTE_OFF"); put(TOGGLE_MUTE, "TOGGLE_MUTE"); put(MUTE_EXTERNALLY_CHANGED, "MUTE_EXTERNALLY_CHANGED"); put(SWITCH_FOCUS, "SWITCH_FOCUS"); Loading Loading @@ -1236,7 +1237,13 @@ public class CallAudioRouteStateMachine extends StateMachine { public void onReceive(Context context, Intent intent) { Log.startSession("CARSM.mCR"); if (AudioManager.ACTION_MICROPHONE_MUTE_CHANGED.equals(intent.getAction())) { if (mCallsManager.hasEmergencyCall()) { Log.i(this, "Mute was externally changed when there's an emergency call. " + "Forcing mute back off."); sendInternalMessage(MUTE_OFF); } else { sendInternalMessage(MUTE_EXTERNALLY_CHANGED); } } else { Log.w(this, "Received non-mute-change intent"); } Loading src/com/android/server/telecom/CallsManager.java +18 −0 Original line number Diff line number Diff line Loading @@ -836,6 +836,15 @@ public class CallsManager extends Call.ListenerBase return false; } public boolean hasEmergencyRttCall() { for (Call call : mCalls) { if (call.isEmergencyCall() && call.isRttCall()) { return true; } } return false; } @VisibleForTesting public boolean hasOnlyDisconnectedCalls() { if (mCalls.size() == 0) { Loading Loading @@ -1799,6 +1808,10 @@ public class CallsManager extends Call.ListenerBase /** Called by the in-call UI to change the mute state. */ void mute(boolean shouldMute) { if (hasEmergencyCall() && shouldMute) { Log.i(this, "Refusing to turn on mute because we're in an emergency call"); shouldMute = false; } mCallAudioManager.mute(shouldMute); } Loading @@ -1807,6 +1820,11 @@ public class CallsManager extends Call.ListenerBase * speaker phone. */ void setAudioRoute(int route, String bluetoothAddress) { if (hasEmergencyRttCall() && route != CallAudioState.ROUTE_SPEAKER) { Log.i(this, "In an emergency RTT call. Forcing route to speaker."); route = CallAudioState.ROUTE_SPEAKER; bluetoothAddress = null; } mCallAudioManager.setAudioRoute(route, bluetoothAddress); } Loading Loading
src/com/android/server/telecom/Call.java +4 −0 Original line number Diff line number Diff line Loading @@ -1433,6 +1433,10 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, if ((mConnectionProperties & Connection.PROPERTY_IS_RTT) == Connection.PROPERTY_IS_RTT) { createRttStreams(); if (isEmergencyCall()) { mCallsManager.setAudioRoute(CallAudioState.ROUTE_SPEAKER, null); mCallsManager.mute(false); } } mWasHighDefAudio = (connectionProperties & Connection.PROPERTY_HIGH_DEF_AUDIO) == Connection.PROPERTY_HIGH_DEF_AUDIO; Loading
src/com/android/server/telecom/CallAudioRouteStateMachine.java +8 −1 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ public class CallAudioRouteStateMachine extends StateMachine { put(MUTE_ON, "MUTE_ON"); put(MUTE_OFF, "MUTE_OFF"); put(TOGGLE_MUTE, "TOGGLE_MUTE"); put(MUTE_EXTERNALLY_CHANGED, "MUTE_EXTERNALLY_CHANGED"); put(SWITCH_FOCUS, "SWITCH_FOCUS"); Loading Loading @@ -1236,7 +1237,13 @@ public class CallAudioRouteStateMachine extends StateMachine { public void onReceive(Context context, Intent intent) { Log.startSession("CARSM.mCR"); if (AudioManager.ACTION_MICROPHONE_MUTE_CHANGED.equals(intent.getAction())) { if (mCallsManager.hasEmergencyCall()) { Log.i(this, "Mute was externally changed when there's an emergency call. " + "Forcing mute back off."); sendInternalMessage(MUTE_OFF); } else { sendInternalMessage(MUTE_EXTERNALLY_CHANGED); } } else { Log.w(this, "Received non-mute-change intent"); } Loading
src/com/android/server/telecom/CallsManager.java +18 −0 Original line number Diff line number Diff line Loading @@ -836,6 +836,15 @@ public class CallsManager extends Call.ListenerBase return false; } public boolean hasEmergencyRttCall() { for (Call call : mCalls) { if (call.isEmergencyCall() && call.isRttCall()) { return true; } } return false; } @VisibleForTesting public boolean hasOnlyDisconnectedCalls() { if (mCalls.size() == 0) { Loading Loading @@ -1799,6 +1808,10 @@ public class CallsManager extends Call.ListenerBase /** Called by the in-call UI to change the mute state. */ void mute(boolean shouldMute) { if (hasEmergencyCall() && shouldMute) { Log.i(this, "Refusing to turn on mute because we're in an emergency call"); shouldMute = false; } mCallAudioManager.mute(shouldMute); } Loading @@ -1807,6 +1820,11 @@ public class CallsManager extends Call.ListenerBase * speaker phone. */ void setAudioRoute(int route, String bluetoothAddress) { if (hasEmergencyRttCall() && route != CallAudioState.ROUTE_SPEAKER) { Log.i(this, "In an emergency RTT call. Forcing route to speaker."); route = CallAudioState.ROUTE_SPEAKER; bluetoothAddress = null; } mCallAudioManager.setAudioRoute(route, bluetoothAddress); } Loading