use of com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback 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.async.AsyncResultCallback 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);
}
use of com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback in project android_frameworks_opt_telephony by LineageOS.
the class EuiccCard method loadEidAndNotifyRegistrants.
// For RadioConfig<1.2 we don't know the EID when constructing the EuiccCard, so callers may
// need to register to be notified when we have the EID
@VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
protected void loadEidAndNotifyRegistrants() {
Handler euiccMainThreadHandler = new Handler();
AsyncResultCallback<String> cardCb = new AsyncResultCallback<String>() {
@Override
public void onResult(String result) {
if (mEidReadyRegistrants != null) {
mEidReadyRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
}
}
@Override
public void onException(Throwable e) {
// Still notifying registrants even getting eid fails.
if (mEidReadyRegistrants != null) {
mEidReadyRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
}
mEid = "";
mCardId = "";
Rlog.e(LOG_TAG, "Failed loading eid", e);
}
};
getEid(cardCb, euiccMainThreadHandler);
}
Aggregations