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

Commit 811fa9de authored by Hunsuk Choi's avatar Hunsuk Choi
Browse files

Add triggerEpsFallback to RadioImsProxy

Bug: 234803835
Test: build & flash
Change-Id: I96cc54dd6633462f412548ad495195fbf2395dff
Merged-In: I96cc54dd6633462f412548ad495195fbf2395dff
parent 00f698bd
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2873,6 +2873,13 @@ public interface CommandsInterface {
     */
    default void stopImsTraffic(String token, Message result) {}

    /**
     * Triggers the UE initiated EPS fallback procedure.
     *
     * @param reason Specifies the reason for EPS fallback.
     */
    default void triggerEpsFallback(int reason, Message result) {}

    /**
     * Triggers radio to send ANBRQ message to the network.
     *
+7 −0
Original line number Diff line number Diff line
@@ -87,6 +87,13 @@ 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 triggerEpsFallbackResponse(RadioResponseInfo info) {
        RadioResponse.responseVoid(RIL.IMS_SERVICE, mRil, info);
    }

    /**
     * @param info Response info struct containing response type, serial no. and error.
     */
+10 −0
Original line number Diff line number Diff line
@@ -4885,6 +4885,16 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    public void setTerminalBasedCallWaitingSupported(boolean supported) {
    }

    /**
     * Triggers the UE initiated EPS fallback procedure.
     *
     * @param reason specifies the reason for EPS fallback.
     * @param response is callback message.
     */
    public void triggerEpsFallback(int reason, Message response) {
        mCi.triggerEpsFallback(reason, response);
    }

    /**
     * @return Telephony tester instance.
     */
+30 −0
Original line number Diff line number Diff line
@@ -5247,6 +5247,36 @@ public class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    @Override
    public void triggerEpsFallback(int reason, 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_TRIGGER_EPS_FALLBACK, result,
                    mRILDefaultWorkSource);

            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> " + RILUtils.requestToString(rr.mRequest)
                        + " reason=" + reason);
            }

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

    @Override
    public void sendAnbrQuery(int mediaType, int direction, int bitsPerSecond,
            Message result) {
+3 −0
Original line number Diff line number Diff line
@@ -203,6 +203,7 @@ import static com.android.internal.telephony.RILConstants.RIL_REQUEST_STOP_LCE;
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_STOP_NETWORK_SCAN;
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SWITCH_DUAL_SIM_CONFIG;
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE;
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_TRIGGER_EPS_FALLBACK;
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_UDUB;
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_UPDATE_IMS_REGISTRATION_INFO;
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_UPDATE_SIM_PHONEBOOK_RECORD;
@@ -5061,6 +5062,8 @@ public class RILUtils {
                return "STOP_IMS_TRAFFIC";
            case RIL_REQUEST_SEND_ANBR_QUERY:
                return "SEND_ANBR_QUERY";
            case RIL_REQUEST_TRIGGER_EPS_FALLBACK:
                return "TRIGGER_EPS_FALLBACK";
            default:
                return "<unknown request " + request + ">";
        }
Loading