summaryrefslogtreecommitdiffstats
path: root/telecomm/java/android/telecom/Connection.java
diff options
context:
space:
mode:
Diffstat (limited to 'telecomm/java/android/telecom/Connection.java')
-rw-r--r--telecomm/java/android/telecom/Connection.java36
1 files changed, 31 insertions, 5 deletions
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index 2ee5d25..f39f813 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -20,6 +20,7 @@ import com.android.internal.os.SomeArgs;
import com.android.internal.telecom.IVideoCallback;
import com.android.internal.telecom.IVideoProvider;
+import android.annotation.SystemApi;
import android.net.Uri;
import android.os.Handler;
import android.os.IBinder;
@@ -817,7 +818,7 @@ public abstract class Connection implements Conferenceable {
Collections.unmodifiableList(mConferenceables);
private int mState = STATE_NEW;
- private AudioState mAudioState;
+ private CallAudioState mCallAudioState;
private Uri mAddress;
private int mAddressPresentation;
private String mCallerDisplayName;
@@ -892,9 +893,22 @@ public abstract class Connection implements Conferenceable {
* @return The audio state of the connection, describing how its audio is currently
* being routed by the system. This is {@code null} if this Connection
* does not directly know about its audio state.
+ * @deprecated Use {@link #getCallAudioState()} instead.
+ * @hide
*/
+ @SystemApi
+ @Deprecated
public final AudioState getAudioState() {
- return mAudioState;
+ return new AudioState(mCallAudioState);
+ }
+
+ /**
+ * @return The audio state of the connection, describing how its audio is currently
+ * being routed by the system. This is {@code null} if this Connection
+ * does not directly know about its audio state.
+ */
+ public final CallAudioState getCallAudioState() {
+ return mCallAudioState;
}
/**
@@ -968,11 +982,12 @@ public abstract class Connection implements Conferenceable {
* @param state The new audio state.
* @hide
*/
- final void setAudioState(AudioState state) {
+ final void setCallAudioState(CallAudioState state) {
checkImmutable();
Log.d(this, "setAudioState %s", state);
- mAudioState = state;
- onAudioStateChanged(state);
+ mCallAudioState = state;
+ onAudioStateChanged(getAudioState());
+ onCallAudioStateChanged(state);
}
/**
@@ -1359,10 +1374,21 @@ public abstract class Connection implements Conferenceable {
* Notifies this Connection that the {@link #getAudioState()} property has a new value.
*
* @param state The new connection audio state.
+ * @deprecated Use {@link #onCallAudioStateChanged(CallAudioState)} instead.
+ * @hide
*/
+ @SystemApi
+ @Deprecated
public void onAudioStateChanged(AudioState state) {}
/**
+ * Notifies this Connection that the {@link #getCallAudioState()} property has a new value.
+ *
+ * @param state The new connection audio state.
+ */
+ public void onCallAudioStateChanged(CallAudioState state) {}
+
+ /**
* Notifies this Connection of an internal state change. This method is called after the
* state is changed.
*