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

Commit bd8ad1b8 authored by Dominik Maier's avatar Dominik Maier
Browse files

Add isNullCipherAndIntegrityEnabled interface

Bug: b/237529943
Test: m
Change-Id: Ib6d27473fb2ce6f79849844ae928613607a7a641
parent 06ad9752
Loading
Loading
Loading
Loading
+24 −7
Original line number Diff line number Diff line
@@ -477,6 +477,30 @@ 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
     */
    public void setNullCipherAndIntegrityEnabledResponse(RadioResponseInfo responseInfo) {
        RadioResponse.responseVoid(HAL_SERVICE_NETWORK, mRil, responseInfo);
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error.
     * @param isEnabled Indicates whether null cipher and integrity is enabled, indicating
     *                  potentially unencrypted communication
     */
    public void isNullCipherAndIntegrityEnabledResponse(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.
     * @param isEnabled Indicates whether N1 mode is enabled or not.
@@ -525,11 +549,4 @@ public class NetworkResponse extends IRadioNetworkResponse.Stub {
        return IRadioNetworkResponse.VERSION;
    }

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

}
+14 −0
Original line number Diff line number Diff line
@@ -933,6 +933,20 @@ public class RadioNetworkProxy extends RadioServiceProxy {
        // Only supported on AIDL.
    }

    /**
     * Get if null ciphering / null integrity is permitted.
     * @param serial Serial number of the request.
     * @throws RemoteException
     *
     */
    public void isNullCipherAndIntegrityEnabled(int serial) throws RemoteException {
        if (isEmpty()) return;
        if (isAidl()) {
            mNetworkProxy.isNullCipherAndIntegrityEnabled(serial);
        }
        // Only supported on AIDL.
    }

    /**
     * Checks whether N1 mode is enabled.
     *