* RIL_VERSION = 15 : New commands added:
* RIL_REQUEST_SEND_DEVICE_STATE,
* RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER,
- * RIL_REQUEST_SET_SIM_CARD_POWER
+ * RIL_REQUEST_SET_SIM_CARD_POWER,
+ * RIL_REQUEST_SET_CARRIER_INFO_IMSI_ENCRYPTION,
+ * RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION
* The new parameters for RIL_REQUEST_SETUP_DATA_CALL,
* Updated data structures: RIL_DataProfileInfo_v15, RIL_InitialAttachApn_v15
* New data structure RIL_DataRegistrationStateResponse,
*/
} RIL_CarrierRestrictions;
+typedef struct {
+ const uint8_t * carrierKey; /* Public Key from the Carrier used to encrypt the
+ * IMSI/IMPI.
+ */
+ const char * KeyIdentifier; /* The keyIdentifier Attribute value pair that helps
+ * a server locate the private key to decrypt the
+ * permanent identity.
+ */
+} RIL_CarrierInfoForImsiEncryption;
+
/* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
typedef enum {
CALL_FAIL_UNOBTAINABLE_NUMBER = 1,
* INVALID_ARGUMENTS
*/
#define RIL_REQUEST_SET_SIM_CARD_POWER 140
+
+/**
+ * RIL_REQUEST_SET_CARRIER_INFO_IMSI_ENCRYPTION
+ *
+ * Provide Carrier specific information to the modem that will be used to
+ * encrypt the IMSI and IMPI. Sent by the framework during boot, carrier
+ * switch and everytime we receive a new certificate.
+ *
+ * "data" is the RIL_CarrierInfoForImsiEncryption * structure.
+ *
+ * "response" is NULL
+ *
+ * Valid errors:
+ * RIL_E_SUCCESS
+ * RIL_E_RADIO_NOT_AVAILABLE
+ * SIM_ABSENT
+ * RIL_E_REQUEST_NOT_SUPPORTED
+ * INVALID_ARGUMENTS
+ * MODEM_INTERNAL_FAILURE
+ */
+#define RIL_REQUEST_SET_CARRIER_INFO_IMSI_ENCRYPTION 141
+
/***********************************************************************/
/**
*/
#define RIL_UNSOL_PCO_DATA 1046
+/**
+ * RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION
+ *
+ * Called when the modem needs Carrier specific information that will
+ * be used to encrypt IMSI and IMPI.
+ *
+ * "data" is NULL
+ *
+ */
+#define RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION 1047
+
/***********************************************************************/
#define LOG_TAG "RILC"
-#include <android/hardware/radio/1.0/IRadio.h>
+#include <android/hardware/radio/1.1/IRadio.h>
+#include <android/hardware/radio/1.1/IRadioResponse.h>
+#include <android/hardware/radio/1.1/IRadioIndication.h>
+
#include <android/hardware/radio/deprecated/1.0/IOemHook.h>
#include <hwbinder/IPCThreadState.h>
void convertRilCellInfoListToHal(void *response, size_t responseLen, hidl_vec<CellInfo>& records);
-struct RadioImpl : public IRadio {
+struct RadioImpl : public ::android::hardware::radio::V1_1::IRadio {
int32_t mSlotId;
sp<IRadioResponse> mRadioResponse;
sp<IRadioIndication> mRadioIndication;
Return<void> responseAcknowledgement();
+ Return<void> setCarrierInfoForImsiEncryption(int32_t serial,
+ const ::android::hardware::hidl_vec<uint8_t>& carrierKey,
+ const hidl_string& keyIdentifier);
+
void checkReturnStatus(Return<void>& ret);
};
return Void();
}
+Return<void> RadioImpl::setCarrierInfoForImsiEncryption(int32_t serial,
+ const ::android::hardware::hidl_vec<uint8_t>& carrierKey,
+ const hidl_string& keyIdentifier) {
+ RLOGD("setCarrierInfoForImsiEncryption: serial %d", serial);
+ dispatchRaw(serial, mSlotId, RIL_REQUEST_SET_CARRIER_INFO_IMSI_ENCRYPTION, carrierKey);
+ return Void();
+}
+
/***************************************************************************************************
* RESPONSE FUNCTIONS
* Functions above are used for requests going from framework to vendor code. The ones below are
return 0;
}
+int radio::setCarrierInfoForImsiEncryptionResponse(int slotId,
+ int responseType, int serial, RIL_Errno e,
+ void *response, size_t responseLen) {
+ RLOGD("setCarrierInfoForImsiEncryptionResponse: serial %d", serial);
+ if (radioService[slotId]->mRadioResponse != NULL) {
+ RadioResponseInfo responseInfo = {};
+ populateResponseInfo(responseInfo, serial, responseType, e);
+ Return<sp<::android::hardware::radio::V1_1::IRadioResponse>> ret =
+ ::android::hardware::radio::V1_1::IRadioResponse::castFrom(
+ radioService[slotId]->mRadioResponse);
+ if (ret.isOk()) {
+ sp<::android::hardware::radio::V1_1::IRadioResponse> radioResponseV1_1 = ret;
+ Return<void> retStatus
+ = radioResponseV1_1->setCarrierInfoForImsiEncryptionResponse(responseInfo);
+ radioService[slotId]->checkReturnStatus(retStatus);
+ } else {
+ RLOGE("setCarrierInfoForImsiEncryptionResponse: ret.isOk() == false for "
+ "radioService[%d]" , slotId);
+ }
+ } else {
+ RLOGE("setCarrierInfoForImsiEncryptionResponse: radioService[%d]->mRadioResponse == NULL",
+ slotId);
+ }
+ return 0;
+}
+
int radio::setIndicationFilterResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responselen) {
return 0;
}
+int radio::carrierInfoForImsiEncryption(int slotId,
+ int indicationType, int token, RIL_Errno e, void *response,
+ size_t responseLen) {
+ if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
+ if (response == NULL || responseLen == 0) {
+ RLOGE("carrierInfoForImsiEncryption: invalid response");
+ return 0;
+ }
+ RLOGD("carrierInfoForImsiEncryption");
+ Return<sp<::android::hardware::radio::V1_1::IRadioIndication>> ret =
+ ::android::hardware::radio::V1_1::IRadioIndication::castFrom(
+ radioService[slotId]->mRadioIndication);
+ if (ret.isOk()) {
+ sp<::android::hardware::radio::V1_1::IRadioIndication> radioIndicationV1_1 = ret;
+ Return<void> retStatus = radioIndicationV1_1->carrierInfoForImsiEncryption(
+ convertIntToRadioIndicationType(indicationType));
+ radioService[slotId]->checkReturnStatus(retStatus);
+ } else {
+ RLOGE("carrierInfoForImsiEncryptionResponse: ret.isOk() == false for radioService[%d]",
+ slotId);
+ }
+ } else {
+ RLOGE("carrierInfoForImsiEncryption: radioService[%d]->mRadioIndication == NULL", slotId);
+ }
+
+ return 0;
+}
+
int radio::oemHookRawInd(int slotId,
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
radioService[i]->mSlotId = i;
oemHookService[i] = new OemHookImpl;
oemHookService[i]->mSlotId = i;
- RLOGD("registerService: starting IRadio %s", serviceNames[i]);
+ RLOGD("registerService: starting android::hardware::radio::V1_1::IRadio %s",
+ serviceNames[i]);
android::status_t status = radioService[i]->registerAsService(serviceNames[i]);
status = oemHookService[i]->registerAsService(serviceNames[i]);