use of com.android.internal.telephony.uicc.euicc.EuiccCard in project android_frameworks_opt_telephony by LineageOS.
the class EuiccCardController method setNickname.
@Override
public void setNickname(String callingPackage, String cardId, String iccid, String nickname, ISetNicknameCallback callback) {
try {
checkCallingPackage(callingPackage);
} catch (SecurityException se) {
try {
callback.onComplete(EuiccCardManager.RESULT_CALLER_NOT_ALLOWED);
} catch (RemoteException re) {
loge("callback onComplete failure after checkCallingPackage.", re);
}
return;
}
EuiccCard card = getEuiccCard(cardId);
if (card == null) {
try {
callback.onComplete(EuiccCardManager.RESULT_EUICC_NOT_FOUND);
} catch (RemoteException exception) {
loge("setNickname callback failure.", exception);
}
return;
}
AsyncResultCallback<Void> cardCb = new AsyncResultCallback<Void>() {
@Override
public void onResult(Void result) {
try {
callback.onComplete(EuiccCardManager.RESULT_OK);
} catch (RemoteException exception) {
loge("setNickname callback failure.", exception);
}
}
@Override
public void onException(Throwable e) {
try {
loge("setNickname callback onException: ", e);
callback.onComplete(getResultCode(e));
} catch (RemoteException exception) {
loge("setNickname callback failure.", exception);
}
}
};
card.setNickname(iccid, nickname, cardCb, mEuiccMainThreadHandler);
}
use of com.android.internal.telephony.uicc.euicc.EuiccCard in project android_frameworks_opt_telephony by LineageOS.
the class EuiccCardController method cancelSession.
@Override
public void cancelSession(String callingPackage, String cardId, byte[] transactionId, @EuiccCardManager.CancelReason int reason, ICancelSessionCallback callback) {
try {
checkCallingPackage(callingPackage);
} catch (SecurityException se) {
try {
callback.onComplete(EuiccCardManager.RESULT_CALLER_NOT_ALLOWED, null);
} catch (RemoteException re) {
loge("callback onComplete failure after checkCallingPackage.", re);
}
return;
}
EuiccCard card = getEuiccCard(cardId);
if (card == null) {
try {
callback.onComplete(EuiccCardManager.RESULT_EUICC_NOT_FOUND, null);
} catch (RemoteException exception) {
loge("cancelSession callback failure.", exception);
}
return;
}
AsyncResultCallback<byte[]> cardCb = new AsyncResultCallback<byte[]>() {
@Override
public void onResult(byte[] result) {
try {
callback.onComplete(EuiccCardManager.RESULT_OK, result);
} catch (RemoteException exception) {
loge("cancelSession callback failure.", exception);
}
}
@Override
public void onException(Throwable e) {
try {
loge("cancelSession callback onException: ", e);
callback.onComplete(getResultCode(e), null);
} catch (RemoteException exception) {
loge("cancelSession callback failure.", exception);
}
}
};
card.cancelSession(transactionId, reason, cardCb, mEuiccMainThreadHandler);
}
use of com.android.internal.telephony.uicc.euicc.EuiccCard in project android_frameworks_opt_telephony by LineageOS.
the class EuiccCardController method getDefaultSmdpAddress.
@Override
public void getDefaultSmdpAddress(String callingPackage, String cardId, IGetDefaultSmdpAddressCallback callback) {
try {
checkCallingPackage(callingPackage);
} catch (SecurityException se) {
try {
callback.onComplete(EuiccCardManager.RESULT_CALLER_NOT_ALLOWED, null);
} catch (RemoteException re) {
loge("callback onComplete failure after checkCallingPackage.", re);
}
return;
}
EuiccCard card = getEuiccCard(cardId);
if (card == null) {
try {
callback.onComplete(EuiccCardManager.RESULT_EUICC_NOT_FOUND, null);
} catch (RemoteException exception) {
loge("getDefaultSmdpAddress callback failure.", exception);
}
return;
}
AsyncResultCallback<String> cardCb = new AsyncResultCallback<String>() {
@Override
public void onResult(String result) {
try {
callback.onComplete(EuiccCardManager.RESULT_OK, result);
} catch (RemoteException exception) {
loge("getDefaultSmdpAddress callback failure.", exception);
}
}
@Override
public void onException(Throwable e) {
try {
loge("getDefaultSmdpAddress callback onException: ", e);
callback.onComplete(getResultCode(e), null);
} catch (RemoteException exception) {
loge("getDefaultSmdpAddress callback failure.", exception);
}
}
};
card.getDefaultSmdpAddress(cardCb, mEuiccMainThreadHandler);
}
use of com.android.internal.telephony.uicc.euicc.EuiccCard in project android_frameworks_opt_telephony by LineageOS.
the class EuiccCardController method getEuiccCard.
private EuiccCard getEuiccCard(String cardId) {
UiccController controller = UiccController.getInstance();
int slotId = controller.getUiccSlotForCardId(cardId);
if (slotId != UiccController.INVALID_SLOT_ID) {
UiccSlot slot = controller.getUiccSlot(slotId);
if (slot.isEuicc()) {
return (EuiccCard) controller.getUiccCardForSlot(slotId);
}
}
loge("EuiccCard is null. CardId : " + cardId);
return null;
}
use of com.android.internal.telephony.uicc.euicc.EuiccCard in project android_frameworks_opt_telephony by LineageOS.
the class EuiccCardController method resetMemory.
@Override
public void resetMemory(String callingPackage, String cardId, @EuiccCardManager.ResetOption int options, IResetMemoryCallback callback) {
try {
checkCallingPackage(callingPackage);
} catch (SecurityException se) {
try {
callback.onComplete(EuiccCardManager.RESULT_CALLER_NOT_ALLOWED);
} catch (RemoteException re) {
loge("callback onComplete failure after checkCallingPackage.", re);
}
return;
}
EuiccCard card = getEuiccCard(cardId);
if (card == null) {
try {
callback.onComplete(EuiccCardManager.RESULT_EUICC_NOT_FOUND);
} catch (RemoteException exception) {
loge("resetMemory callback failure.", exception);
}
return;
}
AsyncResultCallback<Void> cardCb = new AsyncResultCallback<Void>() {
@Override
public void onResult(Void result) {
Log.i(TAG, "Request subscription info list refresh after reset memory.");
SubscriptionController.getInstance().requestEmbeddedSubscriptionInfoListRefresh(mUiccController.convertToPublicCardId(cardId));
try {
callback.onComplete(EuiccCardManager.RESULT_OK);
} catch (RemoteException exception) {
loge("resetMemory callback failure.", exception);
}
}
@Override
public void onException(Throwable e) {
try {
loge("resetMemory callback onException: ", e);
callback.onComplete(getResultCode(e));
} catch (RemoteException exception) {
loge("resetMemory callback failure.", exception);
}
}
};
card.resetMemory(options, cardCb, mEuiccMainThreadHandler);
}
Aggregations