Loading core/java/android/telephony/TelephonyCallback.java +10 −1 Original line number Diff line number Diff line Loading @@ -582,6 +582,14 @@ public class TelephonyCallback { @RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE) public static final int EVENT_LINK_CAPACITY_ESTIMATE_CHANGED = 37; /** * Event to norify the Anbr information from Radio to Ims. * * @see ImsCallSessionImplBase#callSessionNotifyAnbr. * * @hide */ public static final int EVENT_TRIGGER_NOTIFY_ANBR = 38; /** * @hide Loading Loading @@ -623,7 +631,8 @@ public class TelephonyCallback { EVENT_DATA_ENABLED_CHANGED, EVENT_ALLOWED_NETWORK_TYPE_LIST_CHANGED, EVENT_LEGACY_CALL_STATE_CHANGED, EVENT_LINK_CAPACITY_ESTIMATE_CHANGED EVENT_LINK_CAPACITY_ESTIMATE_CHANGED, EVENT_TRIGGER_NOTIFY_ANBR }) @Retention(RetentionPolicy.SOURCE) public @interface TelephonyEvent { Loading telephony/java/android/telephony/ims/ImsCallSession.java +49 −0 Original line number Diff line number Diff line Loading @@ -520,6 +520,14 @@ public class ImsCallSession { @NonNull Set<RtpHeaderExtension> extensions) { // no-op } /** * Called when radio to send ANBRQ message to the access network to query the desired * bitrate. */ public void callSessionSendAnbrQuery(int mediaType, int direction, int bitsPerSecond) { // no-op } } private final IImsCallSession miSession; Loading Loading @@ -1223,6 +1231,27 @@ public class ImsCallSession { } } /** * Deliver the bitrate for the indicated media type, direction and bitrate to the upper layer. * * @param mediaType MediaType is used to identify media stream such as audio or video. * @param direction Direction of this packet stream (e.g. uplink or downlink). * @param bitsPerSecond This value is the bitrate received from the NW through the Recommended * bitrate MAC Control Element message and ImsStack converts this value from MAC bitrate * to audio/video codec bitrate (defined in TS26.114). */ public void callSessionNotifyAnbr(int mediaType, int direction, int bitsPerSecond) { if (mClosed) { return; } try { miSession.callSessionNotifyAnbr(mediaType, direction, bitsPerSecond); } catch (RemoteException e) { Log.e(TAG, "callSessionNotifyAnbr" + e); } } /** * A listener type for receiving notification on IMS call session events. * When an event is generated for an {@link IImsCallSession}, Loading Loading @@ -1716,6 +1745,26 @@ public class ImsCallSession { } }, mListenerExecutor); } /** * ANBR Query received. * * @param mediaType MediaType is used to identify media stream such as audio or video. * @param direction Direction of this packet stream (e.g. uplink or downlink). * @param bitsPerSecond This value is the bitrate requested by the other party UE through * RTP CMR, RTCPAPP or TMMBR, and ImsStack converts this value to the MAC bitrate * (defined in TS36.321, range: 0 ~ 8000 kbit/s). */ @Override public void callSessionSendAnbrQuery(int mediaType, int direction, int bitsPerSecond) { Log.d(TAG, "callSessionSendAnbrQuery in ImsCallSession"); TelephonyUtils.runWithCleanCallingIdentity(()-> { if (mListener != null) { mListener.callSessionSendAnbrQuery(mediaType, direction, bitsPerSecond); } }, mListenerExecutor); } } /** Loading telephony/java/android/telephony/ims/ImsCallSessionListener.java +70 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.telephony.ims; import android.annotation.IntDef; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; Loading @@ -25,9 +27,12 @@ import android.telephony.CallQuality; import android.telephony.ServiceState; import android.telephony.ims.aidl.IImsCallSessionListener; import android.telephony.ims.stub.ImsCallSessionImplBase; import android.util.Log; import com.android.ims.internal.IImsCallSession; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.Objects; import java.util.Set; Loading @@ -44,7 +49,7 @@ import java.util.Set; // ImsCallSessionListenerConverter is also changed. @SystemApi public class ImsCallSessionListener { private static final String TAG = "ImsCallSessionListener"; private final IImsCallSessionListener mListener; /** @hide */ Loading Loading @@ -808,5 +813,69 @@ public class ImsCallSessionListener { e.rethrowFromSystemServer(); } } /** @hide */ @IntDef(flag = true, value = { MEDIA_STREAM_TYPE_AUDIO, MEDIA_STREAM_TYPE_VIDEO, }) @Retention(RetentionPolicy.SOURCE) public @interface MediaStreamType {} /** * Media Stream Type - Audio * @hide */ public static final int MEDIA_STREAM_TYPE_AUDIO = 1; /** * Media Stream Type - Video * @hide */ public static final int MEDIA_STREAM_TYPE_VIDEO = 2; /** @hide */ @IntDef(flag = true, value = { MEDIA_STREAM_DIRECTION_UPLINK, MEDIA_STREAM_DIRECTION_DOWNLINK, }) @Retention(RetentionPolicy.SOURCE) public @interface MediaStreamDirection {} /** * Media Stream Direction - Uplink * @hide */ public static final int MEDIA_STREAM_DIRECTION_UPLINK = 1; /** * Media Stream Direction - Downlink * @hide */ public static final int MEDIA_STREAM_DIRECTION_DOWNLINK = 2; /** * Access Network Bitrate Recommendation Query (ANBRQ), see 3GPP TS 26.114. * This API triggers radio to send ANBRQ message to the access network to query the * desired bitrate. * * @param mediaType {@link MediaStreamType} is used to identify media stream such as * audio or video. * @param direction {@link MediaStreamDirection} of this packet stream (e.g. uplink * or downlink). * @param bitsPerSecond This value is the bitrate requested by the other party UE through * RTP CMR, RTCPAPP or TMMBR, and ImsStack converts this value to the MAC bitrate * (defined in TS36.321, range: 0 ~ 8000 kbit/s). * @hide */ public final void callSessionSendAnbrQuery(@MediaStreamType int mediaType, @MediaStreamDirection int direction, @IntRange(from = 0) int bitsPerSecond) { Log.d(TAG, "callSessionSendAnbrQuery in imscallsessonListener"); try { mListener.callSessionSendAnbrQuery(mediaType, direction, bitsPerSecond); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } } telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl +13 −0 Original line number Diff line number Diff line Loading @@ -171,4 +171,17 @@ oneway interface IImsCallSessionListener { * @param extensions the RTP header extensions received. */ void callSessionRtpHeaderExtensionsReceived(in List<RtpHeaderExtension> extensions); /** * Access Network Bitrate Recommendation Query (ANBRQ), see 3GPP TS 26.114. * This API triggers radio to send ANBRQ message to the access network to query the desired * bitrate. * * @param mediaType MediaType is used to identify media stream such as audio or video. * @param direction Direction of this packet stream (e.g. uplink or downlink). * @param bitsPerSecond This value is the bitrate requested by the other party UE * through RTP CMR, RTCPAPP or TMMBR, and ImsStack converts this value to the MAC bitrate * (defined in TS36.321, range: 0 ~ 8000 kbit/s). */ void callSessionSendAnbrQuery(int mediaType, int direction, int bitsPerSecond); } telephony/java/android/telephony/ims/compat/stub/ImsCallSessionImplBase.java +21 −0 Original line number Diff line number Diff line Loading @@ -416,6 +416,21 @@ public class ImsCallSessionImplBase extends IImsCallSession.Stub { // no-op; not supported in compat layer. } /** * Deliver the bitrate for the indicated media type, direction and bitrate to the upper layer. * * @param mediaType MediaType is used to identify media stream such as audio or video. * @param direction Direction of this packet stream (e.g. uplink or downlink). * @param bitsPerSecond This value is the bitrate received from the NW through the Recommended * bitrate MAC Control Element message and ImsStack converts this value from MAC bitrate * to audio/video codec bitrate (defined in TS26.114). * @hide */ @Override public void callSessionNotifyAnbr(int mediaType, int direction, int bitsPerSecond) { // no-op; not supported in compat layer. } /** * There are two different ImsCallSessionListeners that need to reconciled here, we need to * convert the "old" version of the com.android.ims.internal.IImsCallSessionListener to the Loading Loading @@ -662,5 +677,11 @@ public class ImsCallSessionImplBase extends IImsCallSession.Stub { public void callQualityChanged(CallQuality callQuality) throws RemoteException { mNewListener.callQualityChanged(callQuality); } @Override public void callSessionSendAnbrQuery(int mediaType, int direction, int bitsPerSecond) throws RemoteException { mNewListener.callSessionSendAnbrQuery(mediaType, direction, bitsPerSecond); } } } Loading
core/java/android/telephony/TelephonyCallback.java +10 −1 Original line number Diff line number Diff line Loading @@ -582,6 +582,14 @@ public class TelephonyCallback { @RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE) public static final int EVENT_LINK_CAPACITY_ESTIMATE_CHANGED = 37; /** * Event to norify the Anbr information from Radio to Ims. * * @see ImsCallSessionImplBase#callSessionNotifyAnbr. * * @hide */ public static final int EVENT_TRIGGER_NOTIFY_ANBR = 38; /** * @hide Loading Loading @@ -623,7 +631,8 @@ public class TelephonyCallback { EVENT_DATA_ENABLED_CHANGED, EVENT_ALLOWED_NETWORK_TYPE_LIST_CHANGED, EVENT_LEGACY_CALL_STATE_CHANGED, EVENT_LINK_CAPACITY_ESTIMATE_CHANGED EVENT_LINK_CAPACITY_ESTIMATE_CHANGED, EVENT_TRIGGER_NOTIFY_ANBR }) @Retention(RetentionPolicy.SOURCE) public @interface TelephonyEvent { Loading
telephony/java/android/telephony/ims/ImsCallSession.java +49 −0 Original line number Diff line number Diff line Loading @@ -520,6 +520,14 @@ public class ImsCallSession { @NonNull Set<RtpHeaderExtension> extensions) { // no-op } /** * Called when radio to send ANBRQ message to the access network to query the desired * bitrate. */ public void callSessionSendAnbrQuery(int mediaType, int direction, int bitsPerSecond) { // no-op } } private final IImsCallSession miSession; Loading Loading @@ -1223,6 +1231,27 @@ public class ImsCallSession { } } /** * Deliver the bitrate for the indicated media type, direction and bitrate to the upper layer. * * @param mediaType MediaType is used to identify media stream such as audio or video. * @param direction Direction of this packet stream (e.g. uplink or downlink). * @param bitsPerSecond This value is the bitrate received from the NW through the Recommended * bitrate MAC Control Element message and ImsStack converts this value from MAC bitrate * to audio/video codec bitrate (defined in TS26.114). */ public void callSessionNotifyAnbr(int mediaType, int direction, int bitsPerSecond) { if (mClosed) { return; } try { miSession.callSessionNotifyAnbr(mediaType, direction, bitsPerSecond); } catch (RemoteException e) { Log.e(TAG, "callSessionNotifyAnbr" + e); } } /** * A listener type for receiving notification on IMS call session events. * When an event is generated for an {@link IImsCallSession}, Loading Loading @@ -1716,6 +1745,26 @@ public class ImsCallSession { } }, mListenerExecutor); } /** * ANBR Query received. * * @param mediaType MediaType is used to identify media stream such as audio or video. * @param direction Direction of this packet stream (e.g. uplink or downlink). * @param bitsPerSecond This value is the bitrate requested by the other party UE through * RTP CMR, RTCPAPP or TMMBR, and ImsStack converts this value to the MAC bitrate * (defined in TS36.321, range: 0 ~ 8000 kbit/s). */ @Override public void callSessionSendAnbrQuery(int mediaType, int direction, int bitsPerSecond) { Log.d(TAG, "callSessionSendAnbrQuery in ImsCallSession"); TelephonyUtils.runWithCleanCallingIdentity(()-> { if (mListener != null) { mListener.callSessionSendAnbrQuery(mediaType, direction, bitsPerSecond); } }, mListenerExecutor); } } /** Loading
telephony/java/android/telephony/ims/ImsCallSessionListener.java +70 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.telephony.ims; import android.annotation.IntDef; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; Loading @@ -25,9 +27,12 @@ import android.telephony.CallQuality; import android.telephony.ServiceState; import android.telephony.ims.aidl.IImsCallSessionListener; import android.telephony.ims.stub.ImsCallSessionImplBase; import android.util.Log; import com.android.ims.internal.IImsCallSession; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.Objects; import java.util.Set; Loading @@ -44,7 +49,7 @@ import java.util.Set; // ImsCallSessionListenerConverter is also changed. @SystemApi public class ImsCallSessionListener { private static final String TAG = "ImsCallSessionListener"; private final IImsCallSessionListener mListener; /** @hide */ Loading Loading @@ -808,5 +813,69 @@ public class ImsCallSessionListener { e.rethrowFromSystemServer(); } } /** @hide */ @IntDef(flag = true, value = { MEDIA_STREAM_TYPE_AUDIO, MEDIA_STREAM_TYPE_VIDEO, }) @Retention(RetentionPolicy.SOURCE) public @interface MediaStreamType {} /** * Media Stream Type - Audio * @hide */ public static final int MEDIA_STREAM_TYPE_AUDIO = 1; /** * Media Stream Type - Video * @hide */ public static final int MEDIA_STREAM_TYPE_VIDEO = 2; /** @hide */ @IntDef(flag = true, value = { MEDIA_STREAM_DIRECTION_UPLINK, MEDIA_STREAM_DIRECTION_DOWNLINK, }) @Retention(RetentionPolicy.SOURCE) public @interface MediaStreamDirection {} /** * Media Stream Direction - Uplink * @hide */ public static final int MEDIA_STREAM_DIRECTION_UPLINK = 1; /** * Media Stream Direction - Downlink * @hide */ public static final int MEDIA_STREAM_DIRECTION_DOWNLINK = 2; /** * Access Network Bitrate Recommendation Query (ANBRQ), see 3GPP TS 26.114. * This API triggers radio to send ANBRQ message to the access network to query the * desired bitrate. * * @param mediaType {@link MediaStreamType} is used to identify media stream such as * audio or video. * @param direction {@link MediaStreamDirection} of this packet stream (e.g. uplink * or downlink). * @param bitsPerSecond This value is the bitrate requested by the other party UE through * RTP CMR, RTCPAPP or TMMBR, and ImsStack converts this value to the MAC bitrate * (defined in TS36.321, range: 0 ~ 8000 kbit/s). * @hide */ public final void callSessionSendAnbrQuery(@MediaStreamType int mediaType, @MediaStreamDirection int direction, @IntRange(from = 0) int bitsPerSecond) { Log.d(TAG, "callSessionSendAnbrQuery in imscallsessonListener"); try { mListener.callSessionSendAnbrQuery(mediaType, direction, bitsPerSecond); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } }
telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl +13 −0 Original line number Diff line number Diff line Loading @@ -171,4 +171,17 @@ oneway interface IImsCallSessionListener { * @param extensions the RTP header extensions received. */ void callSessionRtpHeaderExtensionsReceived(in List<RtpHeaderExtension> extensions); /** * Access Network Bitrate Recommendation Query (ANBRQ), see 3GPP TS 26.114. * This API triggers radio to send ANBRQ message to the access network to query the desired * bitrate. * * @param mediaType MediaType is used to identify media stream such as audio or video. * @param direction Direction of this packet stream (e.g. uplink or downlink). * @param bitsPerSecond This value is the bitrate requested by the other party UE * through RTP CMR, RTCPAPP or TMMBR, and ImsStack converts this value to the MAC bitrate * (defined in TS36.321, range: 0 ~ 8000 kbit/s). */ void callSessionSendAnbrQuery(int mediaType, int direction, int bitsPerSecond); }
telephony/java/android/telephony/ims/compat/stub/ImsCallSessionImplBase.java +21 −0 Original line number Diff line number Diff line Loading @@ -416,6 +416,21 @@ public class ImsCallSessionImplBase extends IImsCallSession.Stub { // no-op; not supported in compat layer. } /** * Deliver the bitrate for the indicated media type, direction and bitrate to the upper layer. * * @param mediaType MediaType is used to identify media stream such as audio or video. * @param direction Direction of this packet stream (e.g. uplink or downlink). * @param bitsPerSecond This value is the bitrate received from the NW through the Recommended * bitrate MAC Control Element message and ImsStack converts this value from MAC bitrate * to audio/video codec bitrate (defined in TS26.114). * @hide */ @Override public void callSessionNotifyAnbr(int mediaType, int direction, int bitsPerSecond) { // no-op; not supported in compat layer. } /** * There are two different ImsCallSessionListeners that need to reconciled here, we need to * convert the "old" version of the com.android.ims.internal.IImsCallSessionListener to the Loading Loading @@ -662,5 +677,11 @@ public class ImsCallSessionImplBase extends IImsCallSession.Stub { public void callQualityChanged(CallQuality callQuality) throws RemoteException { mNewListener.callQualityChanged(callQuality); } @Override public void callSessionSendAnbrQuery(int mediaType, int direction, int bitsPerSecond) throws RemoteException { mNewListener.callSessionSendAnbrQuery(mediaType, direction, bitsPerSecond); } } }