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

Commit bbb7c1bd authored by Hunsuk Choi's avatar Hunsuk Choi
Browse files

Add isN1ModeEnabled and setN1ModeEnabled to RadioNetworkProxy

Bug: 255450196
Test: build
Change-Id: I4cda580a8d36ed76ecbc7253743cbe9393564b5d
parent 04615356
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -477,6 +477,28 @@ public class NetworkResponse extends IRadioNetworkResponse.Stub {
        RadioResponse.responseVoid(HAL_SERVICE_NETWORK, mRil, responseInfo);
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error.
     * @param isEnabled Indicates whether N1 mode is enabled or not.
     */
    public void isN1ModeEnabledResponse(RadioResponseInfo responseInfo, boolean isEnabled) {
        RILRequest rr = mRil.processResponse(HAL_SERVICE_NETWORK, responseInfo);

        if (rr != null) {
            if (responseInfo.error == RadioError.NONE) {
                RadioResponse.sendMessageResponse(rr.mResult, isEnabled);
            }
            mRil.processResponseDone(rr, responseInfo, isEnabled);
        }
    }

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

    @Override
    public String getInterfaceHash() {
        return IRadioNetworkResponse.HASH;
+29 −0
Original line number Diff line number Diff line
@@ -932,4 +932,33 @@ public class RadioNetworkProxy extends RadioServiceProxy {
        }
        // Only supported on AIDL.
    }

    /**
     * Checks whether N1 mode is enabled.
     *
     * @param serial Serial number of the request.
     * @throws RemoteException
     */
    public void isN1ModeEnabled(int serial) throws RemoteException {
        if (isEmpty()) return;
        if (isAidl()) {
            mNetworkProxy.isN1ModeEnabled(serial);
        }
        // Only supported on AIDL.
    }

    /**
     * Enables or disables N1 mode.
     *
     * @param serial Serial number of request.
     * @param enable Indicates whether to enable N1 mode or not.
     * @throws RemoteException
     */
    public void setN1ModeEnabled(int serial, boolean enable) throws RemoteException {
        if (isEmpty()) return;
        if (isAidl()) {
            mNetworkProxy.setN1ModeEnabled(serial, enable);
        }
        // Only supported on AIDL.
    }
}