Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00f698bd authored by Helen's avatar Helen Committed by Hunsuk Choi
Browse files

Update ANBR apis

Bug: 224905346
Test: Build
Change-Id: I6db876fa44c72287b6b9a714f11fb0482a30874d
Merged-In: I6db876fa44c72287b6b9a714f11fb0482a30874d
parent 79b8fcd1
Loading
Loading
Loading
Loading
+3 −12
Original line number Diff line number Diff line
@@ -2873,21 +2873,12 @@ public interface CommandsInterface {
     */
    default void stopImsTraffic(String token, Message result) {}

    /**
     * Enable or disable the ANBR feature
     *
     * @param qosSessionId QoS session ID is used to identify media stream such as audio or video
     * @param isEnabled True if Anbr feature is enabled, false otherwise
     */
    default void setAnbrEnabled(int qosSessionId, boolean isEnabled, Message result) {}

    /**
     * Triggers radio to send ANBRQ message to the network.
     *
     * @param qosSessionId QoS session ID is used to identify media stream such as audio or video.
     * @param imsdirection Direction of this packet stream (e.g. uplink or downlink).
     * @param mediaType Media type 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 The bit rate requested by the opponent UE.
     */
    default void sendAnbrQuery(int qosSessionId, int imsdirection, int bitsPerSecond,
            Message result) {}
    default void sendAnbrQuery(int mediaType, int direction, int bitsPerSecond, Message result) {}
}
+0 −7
Original line number Diff line number Diff line
@@ -87,13 +87,6 @@ public class ImsResponse extends IRadioImsResponse.Stub {
        RadioResponse.responseVoid(RIL.IMS_SERVICE, mRil, info);
    }

    /**
     * @param info Response info struct containing response type, serial no. and error.
     */
    public void setAnbrEnabledResponse(RadioResponseInfo info) {
        RadioResponse.responseVoid(RIL.IMS_SERVICE, mRil, info);
    }

    /**
     * @param info Response info struct containing response type, serial no. and error.
     */
+2 −32
Original line number Diff line number Diff line
@@ -5248,37 +5248,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
    }

    @Override
    public void setAnbrEnabled(int qosSessionId, boolean isEnabled, Message result) {
        RadioImsProxy imsProxy = getRadioServiceProxy(RadioImsProxy.class, result);
        if (imsProxy.isEmpty()) return;
        if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_2_1)) {
            RILRequest rr = obtainRequest(RIL_REQUEST_SET_ANBR_ENABLED, result,
                    mRILDefaultWorkSource);

            if (RILJ_LOGD) {
                // Do not log function arg for privacy
                riljLog(rr.serialString() + "> " + RILUtils.requestToString(rr.mRequest));
            }

            try {
                imsProxy.setAnbrEnabled(rr.mSerial, qosSessionId, isEnabled);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(IMS_SERVICE, "setAnbrEnabled", e);
            }
        } else {
            if (RILJ_LOGD) {
                Rlog.d(RILJ_LOG_TAG, "setAnbrEnabled: REQUEST_NOT_SUPPORTED");
            }
            if (result != null) {
                AsyncResult.forMessage(result, null,
                        CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
                result.sendToTarget();
            }
        }
    }

    @Override
    public void sendAnbrQuery(int qosSessionId, int imsdirection, int bitsPerSecond,
    public void sendAnbrQuery(int mediaType, int direction, int bitsPerSecond,
            Message result) {
        RadioImsProxy imsProxy = getRadioServiceProxy(RadioImsProxy.class, result);
        if (imsProxy.isEmpty()) return;
@@ -5291,7 +5261,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
            }

            try {
                imsProxy.sendAnbrQuery(rr.mSerial, qosSessionId, imsdirection, bitsPerSecond);
                imsProxy.sendAnbrQuery(rr.mSerial, mediaType, direction, bitsPerSecond);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(IMS_SERVICE, "sendAnbrQuery", e);
            }
+0 −3
Original line number Diff line number Diff line
@@ -147,7 +147,6 @@ import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SEPARATE_C
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SETUP_DATA_CALL;
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_ALLOWED_CARRIERS;
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_ALLOWED_NETWORK_TYPES_BITMAP;
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_ANBR_ENABLED;
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_BAND_MODE;
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_CALL_FORWARD;
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_CALL_WAITING;
@@ -5060,8 +5059,6 @@ public class RILUtils {
                return "START_IMS_TRAFFIC";
            case RIL_REQUEST_STOP_IMS_TRAFFIC:
                return "STOP_IMS_TRAFFIC";
            case RIL_REQUEST_SET_ANBR_ENABLED:
                return "SET_ANBR_ENABLED";
            case RIL_REQUEST_SEND_ANBR_QUERY:
                return "SEND_ANBR_QUERY";
            default:
+4 −17
Original line number Diff line number Diff line
@@ -135,32 +135,19 @@ public class RadioImsProxy extends RadioServiceProxy {
        }
    }

    /**
     * Call IRadioIms#setAnbrEnabled
     * @param serial Serial number of request
     * @throws RemoteException
     */
    public void setAnbrEnabled(int serial, int qosSessionId, boolean isEnabled)
            throws RemoteException {
        if (isEmpty()) return;
        if (isAidl()) {
            mImsProxy.setAnbrEnabled(serial, qosSessionId, isEnabled);
        }
    }

    /**
     * Calls IRadioIms#sendAnbrQuery.
     * @param serial Serial number of request.
     * @param qosSessionId QoS session ID is used to identify media stream such as audio or video.
     * @param imsdirection Direction of this packet stream (e.g. uplink or downlink).
     * @param mediaType Media type 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 The bit rate requested by the opponent UE.
     * @throws RemoteException.
     */
    public void sendAnbrQuery(int serial, int qosSessionId, int imsdirection, int bitsPerSecond)
    public void sendAnbrQuery(int serial, int mediaType, int direction, int bitsPerSecond)
            throws RemoteException {
        if (isEmpty()) return;
        if (isAidl()) {
            mImsProxy.sendAnbrQuery(serial, qosSessionId, imsdirection, bitsPerSecond);
            mImsProxy.sendAnbrQuery(serial, mediaType, direction, bitsPerSecond);
        }
    }
}