use of android.telephony.ImsiEncryptionInfo in project android_frameworks_opt_telephony by LineageOS.
the class CarrierKeyDownloadManager method savePublicKey.
/**
* Save the public key
* @param publicKey public key.
* @param type key-type.
* @param identifier which is an opaque string.
* @param expirationDate expiration date of the key.
* @param mcc
* @param mnc
*/
@VisibleForTesting
public void savePublicKey(PublicKey publicKey, int type, String identifier, long expirationDate, String mcc, String mnc) {
ImsiEncryptionInfo imsiEncryptionInfo = new ImsiEncryptionInfo(mcc, mnc, type, identifier, publicKey, new Date(expirationDate));
mPhone.setCarrierInfoForImsiEncryption(imsiEncryptionInfo);
}
use of android.telephony.ImsiEncryptionInfo in project android_frameworks_opt_telephony by LineageOS.
the class RIL method setCarrierInfoForImsiEncryption.
@Override
public void setCarrierInfoForImsiEncryption(ImsiEncryptionInfo imsiEncryptionInfo, Message result) {
checkNotNull(imsiEncryptionInfo, "ImsiEncryptionInfo cannot be null.");
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_1)) {
android.hardware.radio.V1_1.IRadio radioProxy11 = (android.hardware.radio.V1_1.IRadio) radioProxy;
RILRequest rr = obtainRequest(RIL_REQUEST_SET_CARRIER_INFO_IMSI_ENCRYPTION, result, mRILDefaultWorkSource);
if (RILJ_LOGD)
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
try {
android.hardware.radio.V1_1.ImsiEncryptionInfo halImsiInfo = new android.hardware.radio.V1_1.ImsiEncryptionInfo();
halImsiInfo.mnc = imsiEncryptionInfo.getMnc();
halImsiInfo.mcc = imsiEncryptionInfo.getMcc();
halImsiInfo.keyIdentifier = imsiEncryptionInfo.getKeyIdentifier();
if (imsiEncryptionInfo.getExpirationTime() != null) {
halImsiInfo.expirationTime = imsiEncryptionInfo.getExpirationTime().getTime();
}
for (byte b : imsiEncryptionInfo.getPublicKey().getEncoded()) {
halImsiInfo.carrierKey.add(new Byte(b));
}
radioProxy11.setCarrierInfoForImsiEncryption(rr.mSerial, halImsiInfo);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setCarrierInfoForImsiEncryption", e);
}
} else if (result != null) {
AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
result.sendToTarget();
}
}
}
use of android.telephony.ImsiEncryptionInfo in project android_frameworks_opt_telephony by LineageOS.
the class ImsiEncryptionInfoTest method setUp.
@Before
public void setUp() throws Exception {
mPublicKey = createPublicKey(TEST_CERT);
mImsiEncryptionInfo = new ImsiEncryptionInfo("310", "270", TelephonyManager.KEY_TYPE_WLAN, "key1=value", mPublicKey, mDate);
}
Aggregations