use of com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback in project android_frameworks_opt_telephony by LineageOS.
the class EuiccCardController method getEuiccChallenge.
@Override
public void getEuiccChallenge(String callingPackage, String cardId, IGetEuiccChallengeCallback 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("getEuiccChallenge 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("getEuiccChallenge callback failure.", exception);
}
}
@Override
public void onException(Throwable e) {
try {
loge("getEuiccChallenge callback onException: ", e);
callback.onComplete(getResultCode(e), null);
} catch (RemoteException exception) {
loge("getEuiccChallenge callback failure.", exception);
}
}
};
card.getEuiccChallenge(cardCb, mEuiccMainThreadHandler);
}
use of com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback in project android_frameworks_opt_telephony by LineageOS.
the class EuiccCardController method switchToProfile.
@Override
public void switchToProfile(String callingPackage, String cardId, String iccid, boolean refresh, ISwitchToProfileCallback 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("switchToProfile callback failure.", exception);
}
return;
}
AsyncResultCallback<EuiccProfileInfo> profileCb = new AsyncResultCallback<EuiccProfileInfo>() {
@Override
public void onResult(EuiccProfileInfo profile) {
AsyncResultCallback<Void> switchCb = new AsyncResultCallback<Void>() {
@Override
public void onResult(Void result) {
try {
callback.onComplete(EuiccCardManager.RESULT_OK, profile);
} catch (RemoteException exception) {
loge("switchToProfile callback failure.", exception);
}
}
@Override
public void onException(Throwable e) {
try {
loge("switchToProfile callback onException: ", e);
callback.onComplete(getResultCode(e), profile);
} catch (RemoteException exception) {
loge("switchToProfile callback failure.", exception);
}
}
};
card.switchToProfile(iccid, refresh, switchCb, mEuiccMainThreadHandler);
}
@Override
public void onException(Throwable e) {
try {
loge("getProfile in switchToProfile callback onException: ", e);
callback.onComplete(getResultCode(e), null);
} catch (RemoteException exception) {
loge("switchToProfile callback failure.", exception);
}
}
};
card.getProfile(iccid, profileCb, mEuiccMainThreadHandler);
}
use of com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback in project android_frameworks_opt_telephony by LineageOS.
the class EuiccCardController method retrieveNotificationList.
@Override
public void retrieveNotificationList(String callingPackage, String cardId, @EuiccNotification.Event int events, IRetrieveNotificationListCallback 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("retrieveNotificationList callback failure.", exception);
}
return;
}
AsyncResultCallback<EuiccNotification[]> cardCb = new AsyncResultCallback<EuiccNotification[]>() {
@Override
public void onResult(EuiccNotification[] result) {
try {
callback.onComplete(EuiccCardManager.RESULT_OK, result);
} catch (RemoteException exception) {
loge("retrieveNotificationList callback failure.", exception);
}
}
@Override
public void onException(Throwable e) {
try {
loge("retrieveNotificationList callback onException: ", e);
callback.onComplete(getResultCode(e), null);
} catch (RemoteException exception) {
loge("retrieveNotificationList callback failure.", exception);
}
}
};
card.retrieveNotificationList(events, cardCb, mEuiccMainThreadHandler);
}
use of com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback 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.async.AsyncResultCallback 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);
}
Aggregations