Rename AudioState to CallAudioState

Deprecate AudioState class and make methods @SystemApi where
necessary to minimize impact to SystemApi
Replace usages of AudioState inside Telecom sub-systems
Fire both onCallAudioStateChanged and onAudioStateChanged callbacks
for backward compatibility
Support both setAudioState and setCallAudioState for all classes

Bug: 21040387
Bug: 21088300
Change-Id: I3ec7b3afdaa344c6d639d1c421f1842d67f7d0f7
diff --git a/telecomm/java/android/telecom/RemoteConference.java b/telecomm/java/android/telecom/RemoteConference.java
index b59584b..095a88f 100644
--- a/telecomm/java/android/telecom/RemoteConference.java
+++ b/telecomm/java/android/telecom/RemoteConference.java
@@ -18,6 +18,7 @@
 
 import com.android.internal.telecom.IConnectionService;
 
+import android.annotation.SystemApi;
 import android.os.Handler;
 import android.os.RemoteException;
 
@@ -355,14 +356,27 @@
      * can include audio routing (Bluetooth, Speaker, etc) and muting state.
      *
      * @see android.telecom.AudioState
+     * @deprecated Use {@link #setCallAudioState(CallAudioState)} instead.
+     * @hide
      */
+    @SystemApi
+    @Deprecated
     public void setAudioState(AudioState state) {
+        setCallAudioState(new CallAudioState(state));
+    }
+
+    /**
+     * Request to change the conference's audio routing to the specified state. The specified state
+     * can include audio routing (Bluetooth, Speaker, etc) and muting state.
+     */
+    public void setCallAudioState(CallAudioState state) {
         try {
-            mConnectionService.onAudioStateChanged(mId, state);
+            mConnectionService.onCallAudioStateChanged(mId, state);
         } catch (RemoteException e) {
         }
     }
 
+
     /**
      * Returns a list of independent connections that can me merged with this conference.
      *