diff options
| author | 2022-12-13 17:12:10 +0000 | |
|---|---|---|
| committer | 2022-12-13 17:12:10 +0000 | |
| commit | 37f3eda7493b8f70ec1543965352b50eb2674a8d (patch) | |
| tree | f9b9504870b5a560c0eacc0d95da6b22ccf8380e | |
| parent | 497aa8cb660d40b5a26f3d699dddc229284e570e (diff) | |
| parent | 5922028e0302d485663f9191533f61d0b8c3d8f4 (diff) | |
Merge "Add setCallAudioHandler api for dynamic audio switching feature"
| -rw-r--r-- | core/api/system-current.txt | 3 | ||||
| -rw-r--r-- | telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl | 1 | ||||
| -rw-r--r-- | telephony/java/android/telephony/ims/feature/MmTelFeature.java | 56 |
3 files changed, 60 insertions, 0 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 6f341f25e288..b3cbba2b95da 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -15737,9 +15737,12 @@ package android.telephony.ims.feature { method public void onFeatureRemoved(); method public boolean queryCapabilityConfiguration(int, int); method @NonNull public final android.telephony.ims.feature.MmTelFeature.MmTelCapabilities queryCapabilityStatus(); + method public final void setCallAudioHandler(int); method public void setTerminalBasedCallWaitingStatus(boolean); method public void setUiTtyMode(int, @Nullable android.os.Message); method public int shouldProcessCall(@NonNull String[]); + field public static final int AUDIO_HANDLER_ANDROID = 0; // 0x0 + field public static final int AUDIO_HANDLER_BASEBAND = 1; // 0x1 field public static final String EXTRA_IS_UNKNOWN_CALL = "android.telephony.ims.feature.extra.IS_UNKNOWN_CALL"; field public static final String EXTRA_IS_USSD = "android.telephony.ims.feature.extra.IS_USSD"; field public static final int PROCESS_CALL_CSFB = 1; // 0x1 diff --git a/telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl b/telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl index 52464703c608..640426b45ba3 100644 --- a/telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl +++ b/telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl @@ -34,4 +34,5 @@ interface IImsMmTelListener { void onIncomingCall(IImsCallSession c, in Bundle extras); void onRejectedCall(in ImsCallProfile callProfile, in ImsReasonInfo reason); oneway void onVoiceMessageCountUpdate(int count); + oneway void onAudioModeIsVoipChanged(int imsAudioHandler); } diff --git a/telephony/java/android/telephony/ims/feature/MmTelFeature.java b/telephony/java/android/telephony/ims/feature/MmTelFeature.java index a380241c860b..4710c1f4dbf3 100644 --- a/telephony/java/android/telephony/ims/feature/MmTelFeature.java +++ b/telephony/java/android/telephony/ims/feature/MmTelFeature.java @@ -579,6 +579,17 @@ public class MmTelFeature extends ImsFeature { public void onVoiceMessageCountUpdate(int count) { } + + /** + * Called to set the audio handler for this connection. + * @param imsAudioHandler an {@link ImsAudioHandler} used to handle the audio + * for this IMS call. + * @hide + */ + @Override + public void onAudioModeIsVoipChanged(int imsAudioHandler) { + + } } /** @@ -628,6 +639,29 @@ public class MmTelFeature extends ImsFeature { public static final String EXTRA_IS_UNKNOWN_CALL = "android.telephony.ims.feature.extra.IS_UNKNOWN_CALL"; + /** @hide */ + @IntDef(flag = true, + value = { + AUDIO_HANDLER_ANDROID, + AUDIO_HANDLER_BASEBAND + }) + @Retention(RetentionPolicy.SOURCE) + public @interface ImsAudioHandler {} + + /** + * Audio Handler - Android + * @hide + */ + @SystemApi + public static final int AUDIO_HANDLER_ANDROID = 0; + + /** + * Audio Handler - Baseband + * @hide + */ + @SystemApi + public static final int AUDIO_HANDLER_BASEBAND = 1; + private IImsMmTelListener mListener; /** @@ -774,6 +808,28 @@ public class MmTelFeature extends ImsFeature { } /** + * Sets the audio handler for this connection. The vendor IMS stack will invoke this API + * to inform Telephony/Telecom layers about which audio handlers i.e. either Android or Modem + * shall be used for handling the IMS call audio. + * + * @param imsAudioHandler {@link MmTelFeature#ImsAudioHandler} used to handle the audio + * for this IMS call. + * @hide + */ + @SystemApi + public final void setCallAudioHandler(@ImsAudioHandler int imsAudioHandler) { + IImsMmTelListener listener = getListener(); + if (listener == null) { + throw new IllegalStateException("Session is not available."); + } + try { + listener.onAudioModeIsVoipChanged(imsAudioHandler); + } catch (RemoteException e) { + throw new RuntimeException(e); + } + } + + /** * Provides the MmTelFeature with the ability to return the framework Capability Configuration * for a provided Capability. If the framework calls {@link #changeEnabledCapabilities} and * includes a capability A to enable or disable, this method should return the correct enabled |