Merge "Turn speakerphone on at DIALING state."
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 5fd4fca..0d57c8a 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -916,14 +916,12 @@
void markCallAsDialing(Call call) {
setCallState(call, CallState.DIALING);
+ maybeMoveToSpeakerPhone(call);
}
void markCallAsActive(Call call) {
setCallState(call, CallState.ACTIVE);
-
- if (call.getStartWithSpeakerphoneOn()) {
- setAudioRoute(AudioState.ROUTE_SPEAKER);
- }
+ maybeMoveToSpeakerPhone(call);
}
void markCallAsOnHold(Call call) {
@@ -1457,6 +1455,16 @@
}
/**
+ * Checks to see if the call should be on speakerphone and if so, set it.
+ */
+ private void maybeMoveToSpeakerPhone(Call call) {
+ if (call.getStartWithSpeakerphoneOn()) {
+ setAudioRoute(AudioState.ROUTE_SPEAKER);
+ call.setStartWithSpeakerphoneOn(false);
+ }
+ }
+
+ /**
* Creates a new call for an existing connection.
*
* @param callId The id of the new call.