summaryrefslogtreecommitdiffstats
path: root/telecomm/java/android/telecom/InCallService.java
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2015-05-13 14:14:54 -0700
committerYorke Lee <yorkelee@google.com>2015-05-13 14:58:15 -0700
commit4af5935c71f1e31ef1aec27661c4ef60545a0924 (patch)
treed04fc16471211040e00b7ce66665c461ab0a0dfa /telecomm/java/android/telecom/InCallService.java
parent4201be08a1cb1358e7ee30f81927b7c11f477ea3 (diff)
downloadframeworks_base-4af5935c71f1e31ef1aec27661c4ef60545a0924.zip
frameworks_base-4af5935c71f1e31ef1aec27661c4ef60545a0924.tar.gz
frameworks_base-4af5935c71f1e31ef1aec27661c4ef60545a0924.tar.bz2
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
Diffstat (limited to 'telecomm/java/android/telecom/InCallService.java')
-rw-r--r--telecomm/java/android/telecom/InCallService.java42
1 files changed, 35 insertions, 7 deletions
diff --git a/telecomm/java/android/telecom/InCallService.java b/telecomm/java/android/telecom/InCallService.java
index 182a7f5..e37cff7 100644
--- a/telecomm/java/android/telecom/InCallService.java
+++ b/telecomm/java/android/telecom/InCallService.java
@@ -52,7 +52,7 @@ public abstract class InCallService extends Service {
private static final int MSG_ADD_CALL = 2;
private static final int MSG_UPDATE_CALL = 3;
private static final int MSG_SET_POST_DIAL_WAIT = 4;
- private static final int MSG_ON_AUDIO_STATE_CHANGED = 5;
+ private static final int MSG_ON_CALL_AUDIO_STATE_CHANGED = 5;
private static final int MSG_BRING_TO_FOREGROUND = 6;
private static final int MSG_ON_CAN_ADD_CALL_CHANGED = 7;
@@ -87,8 +87,8 @@ public abstract class InCallService extends Service {
}
break;
}
- case MSG_ON_AUDIO_STATE_CHANGED:
- mPhone.internalAudioStateChanged((AudioState) msg.obj);
+ case MSG_ON_CALL_AUDIO_STATE_CHANGED:
+ mPhone.internalCallAudioStateChanged((CallAudioState) msg.obj);
break;
case MSG_BRING_TO_FOREGROUND:
mPhone.internalBringToForeground(msg.arg1 == 1);
@@ -133,8 +133,8 @@ public abstract class InCallService extends Service {
}
@Override
- public void onAudioStateChanged(AudioState audioState) {
- mHandler.obtainMessage(MSG_ON_AUDIO_STATE_CHANGED, audioState).sendToTarget();
+ public void onCallAudioStateChanged(CallAudioState callAudioState) {
+ mHandler.obtainMessage(MSG_ON_CALL_AUDIO_STATE_CHANGED, callAudioState).sendToTarget();
}
@Override
@@ -156,6 +156,10 @@ public abstract class InCallService extends Service {
InCallService.this.onAudioStateChanged(audioState);
}
+ public void onCallAudioStateChanged(Phone phone, CallAudioState callAudioState) {
+ InCallService.this.onCallAudioStateChanged(callAudioState);
+ };
+
/** ${inheritDoc} */
@Override
public void onBringToForeground(Phone phone, boolean showDialpad) {
@@ -248,14 +252,27 @@ public abstract class InCallService extends Service {
*
* @return An object encapsulating the audio state. Returns null if the service is not
* fully initialized.
+ * @deprecated Use {@link #getCallAudioState()} instead.
+ * @hide
*/
+ @Deprecated
public final AudioState getAudioState() {
return mPhone == null ? null : mPhone.getAudioState();
}
/**
+ * Obtains the current phone call audio state.
+ *
+ * @return An object encapsulating the audio state. Returns null if the service is not
+ * fully initialized.
+ */
+ public final CallAudioState getCallAudioState() {
+ return mPhone == null ? null : mPhone.getCallAudioState();
+ }
+
+ /**
* Sets the microphone mute state. When this request is honored, there will be change to
- * the {@link #getAudioState()}.
+ * the {@link #getCallAudioState()}.
*
* @param state {@code true} if the microphone should be muted; {@code false} otherwise.
*/
@@ -267,7 +284,7 @@ public abstract class InCallService extends Service {
/**
* Sets the audio route (speaker, bluetooth, etc...). When this request is honored, there will
- * be change to the {@link #getAudioState()}.
+ * be change to the {@link #getCallAudioState()}.
*
* @param route The audio route to use.
*/
@@ -311,11 +328,22 @@ public abstract class InCallService extends Service {
* Called when the audio state changes.
*
* @param audioState The new {@link AudioState}.
+ * @deprecated Use {@link #onCallAudioStateChanged(CallAudioState) instead}.
+ * @hide
*/
+ @Deprecated
public void onAudioStateChanged(AudioState audioState) {
}
/**
+ * Called when the audio state changes.
+ *
+ * @param audioState The new {@link CallAudioState}.
+ */
+ public void onCallAudioStateChanged(CallAudioState audioState) {
+ }
+
+ /**
* Called to bring the in-call screen to the foreground. The in-call experience should
* respond immediately by coming to the foreground to inform the user of the state of
* ongoing {@code Call}s.