Add audio mode and audio focus support to Telecomm
This CL adds support for:
- audio focus
- switching to speaker phone
- mute
- wired headset
Bluetooth support is coming in a different CL.
Change-Id: Iaf4013ea747548451cff45b48bcbb5b1dd1b8498
diff --git a/src/com/android/telecomm/CallServiceWrapper.java b/src/com/android/telecomm/CallServiceWrapper.java
index 46e99cb..0722ec6 100644
--- a/src/com/android/telecomm/CallServiceWrapper.java
+++ b/src/com/android/telecomm/CallServiceWrapper.java
@@ -19,6 +19,7 @@
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
+import android.telecomm.CallAudioState;
import android.telecomm.CallInfo;
import android.telecomm.CallService;
import android.telecomm.CallServiceDescriptor;
@@ -147,7 +148,7 @@
}
/** See {@link ICallService#hold}. */
- public void hold(String callId) {
+ void hold(String callId) {
if (isServiceValid("hold")) {
try {
mServiceInterface.hold(callId);
@@ -158,7 +159,7 @@
}
/** See {@link ICallService#unhold}. */
- public void unhold(String callId) {
+ void unhold(String callId) {
if (isServiceValid("unhold")) {
try {
mServiceInterface.unhold(callId);
@@ -168,6 +169,17 @@
}
}
+ /** See {@link ICallService#onAudioStateChanged}. */
+ void onAudioStateChanged(String activeCallId, CallAudioState audioState) {
+ if (isServiceValid("onAudioStateChanged")) {
+ try {
+ mServiceInterface.onAudioStateChanged(activeCallId, audioState);
+ } catch (RemoteException e) {
+ Log.e(this, e, "Failed to update audio state for call %s", activeCallId);
+ }
+ }
+ }
+
/**
* Starts retrieval of details for an incoming call. Details are returned through the
* call-service adapter using the specified call ID. Upon failure, the specified error callback