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

Commit 590c8c89 authored by Jack Nudelman's avatar Jack Nudelman Committed by Automerger Merge Worker
Browse files

Allow for DataThrottling APIs to be call the radio impl. am: 95162a3a

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1518379

Change-Id: I51aafef3de90f1a8827917115fa5ba0f0f098d8a
parents 291939d0 95162a3a
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -2585,4 +2585,17 @@ public interface CommandsInterface {
     * @param callId Identifier associated with the data call
     */
    default void cancelHandover(Message result, int callId) {};


    /**
     * Control the data throttling at modem.
     *
     * @param result Message that will be sent back to the requester
     * @param workSource calling Worksource
     * @param dataThrottlingAction the DataThrottlingAction that is being requested.
     * Defined in android.hardware.radio@1.6.types.
     * @param completionWindowSecs seconds in which data throttling action has to be achieved.
     */
    default void setDataThrottling(Message result, WorkSource workSource,
            int dataThrottlingAction, int completionWindowSecs) {};
}
+14 −0
Original line number Diff line number Diff line
@@ -4189,6 +4189,20 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
                obtainMessage(EVENT_CONFIG_LCE));
    }

    /**
     * Control the data throttling at modem.
     *
     * @param result Message that will be sent back to the requester
     * @param workSource calling Worksource
     * @param dataThrottlingAction the DataThrottlingAction that is being requested. Defined in
     * android.telephony.TelephonyManger.
     * @param completionWindowSecs seconds in which data throttling action has to be achieved.
     */
    public void setDataThrottling(Message result, WorkSource workSource,
            int dataThrottlingAction, int completionWindowSecs) {
        mCi.setDataThrottling(result, workSource, dataThrottlingAction, completionWindowSecs);
    }

    /**
     * Set allowed carriers
     */
+46 −0
Original line number Diff line number Diff line
@@ -4870,6 +4870,50 @@ public class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    /**
     * Control the data throttling at modem.
     *
     * @param result Message that will be sent back to the requester
     * @param workSource calling Worksource
     * @param dataThrottlingAction the DataThrottlingAction that is being requested. Defined in
     * android.hardware.radio@1.6.types.
     * @param completionWindowSecs seconds in which full throttling has to be achieved.
     */
    @Override
    public void setDataThrottling(Message result, WorkSource workSource, int dataThrottlingAction,
            int completionWindowSecs) {
        IRadio radioProxy = getRadioProxy(result);
        if (radioProxy != null) {
            if (mRadioVersion.less(RADIO_HAL_VERSION_1_6)) {
                if (result != null) {
                    AsyncResult.forMessage(result, null,
                            CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
                    result.sendToTarget();
                }
                return;
            }

            android.hardware.radio.V1_6.IRadio radioProxy16 =
                    (android.hardware.radio.V1_6.IRadio) radioProxy;
            RILRequest rr = obtainRequest(RIL_REQUEST_SET_DATA_THROTTLING, result,
                    workSource == null ? mRILDefaultWorkSource : workSource);

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

            try {
                radioProxy16.setDataThrottling(rr.mSerial, dataThrottlingAction,
                        completionWindowSecs);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(rr, "setDataThrottling", e);
            }
        }
    }

    /**
     * This will only be called if the LCE service is started in PULL mode, which is
     * only enabled when using Radio HAL versions 1.1 and earlier.
@@ -6708,6 +6752,8 @@ public class RIL extends BaseCommands implements CommandsInterface {
                return "RIL_REQUEST_START_HANDOVER";
            case RIL_REQUEST_CANCEL_HANDOVER:
                return "RIL_REQUEST_CANCEL_HANDOVER";
            case RIL_REQUEST_SET_DATA_THROTTLING:
                return "RIL_REQUEST_SET_DATA_THROTTLING";
            default: return "<unknown request>";
        }
    }