use of android.os.AsyncResult in project android_frameworks_opt_telephony by LineageOS.
the class UiccController method onGetIccCardStatusDone.
private synchronized void onGetIccCardStatusDone(AsyncResult ar, Integer index) {
if (ar.exception != null) {
Rlog.e(LOG_TAG, "Error getting ICC status. " + "RIL_REQUEST_GET_ICC_STATUS should " + "never return an error", ar.exception);
return;
}
if (!isValidPhoneIndex(index)) {
Rlog.e(LOG_TAG, "onGetIccCardStatusDone: invalid index : " + index);
return;
}
IccCardStatus status = (IccCardStatus) ar.result;
logWithLocalLog("onGetIccCardStatusDone: phoneId " + index + " IccCardStatus: " + status);
int slotId = status.physicalSlotIndex;
if (VDBG)
log("onGetIccCardStatusDone: phoneId " + index + " physicalSlotIndex " + slotId);
if (slotId == INVALID_SLOT_ID) {
slotId = index;
}
if (eidIsNotSupported(status)) {
// we will never get EID from the HAL, so set mDefaultEuiccCardId to UNSUPPORTED_CARD_ID
if (DBG)
log("eid is not supported");
mDefaultEuiccCardId = UNSUPPORTED_CARD_ID;
}
mPhoneIdToSlotId[index] = slotId;
if (VDBG)
logPhoneIdToSlotIdMapping();
if (mUiccSlots[slotId] == null) {
if (VDBG) {
log("Creating mUiccSlots[" + slotId + "]; mUiccSlots.length = " + mUiccSlots.length);
}
mUiccSlots[slotId] = new UiccSlot(mContext, true);
}
mUiccSlots[slotId].update(mCis[index], status, index, slotId);
UiccCard card = mUiccSlots[slotId].getUiccCard();
if (card == null) {
if (DBG)
log("mUiccSlots[" + slotId + "] has no card. Notifying IccChangedRegistrants");
mIccChangedRegistrants.notifyRegistrants(new AsyncResult(null, index, null));
return;
}
String cardString = null;
boolean isEuicc = mUiccSlots[slotId].isEuicc();
if (isEuicc) {
cardString = ((EuiccCard) card).getEid();
} else {
cardString = card.getIccId();
}
if (cardString != null) {
addCardId(cardString);
}
// If so, just register for EID loaded and skip this stuff
if (isEuicc && mDefaultEuiccCardId != UNSUPPORTED_CARD_ID) {
if (cardString == null) {
((EuiccCard) card).registerForEidReady(this, EVENT_EID_READY, index);
} else {
// APDU
if (mDefaultEuiccCardId == UNINITIALIZED_CARD_ID || mDefaultEuiccCardId == TEMPORARILY_UNSUPPORTED_CARD_ID) {
mDefaultEuiccCardId = convertToPublicCardId(cardString);
logWithLocalLog("IccCardStatus eid=" + cardString + " slot=" + slotId + " mDefaultEuiccCardId=" + mDefaultEuiccCardId);
}
}
}
if (DBG)
log("Notifying IccChangedRegistrants");
mIccChangedRegistrants.notifyRegistrants(new AsyncResult(null, index, null));
}
use of android.os.AsyncResult in project android_frameworks_opt_telephony by LineageOS.
the class IccRecords method registerForImsiReady.
public void registerForImsiReady(Handler h, int what, Object obj) {
if (mDestroyed.get()) {
return;
}
Registrant r = new Registrant(h, what, obj);
mImsiReadyRegistrants.add(r);
if (getIMSI() != null) {
r.notifyRegistrant(new AsyncResult(null, null, null));
}
}
use of android.os.AsyncResult in project android_frameworks_opt_telephony by LineageOS.
the class IccRecords method registerForSpnUpdate.
public void registerForSpnUpdate(Handler h, int what, Object obj) {
if (mDestroyed.get()) {
return;
}
Registrant r = new Registrant(h, what, obj);
mSpnUpdatedRegistrants.add(r);
if (!TextUtils.isEmpty(mSpn)) {
r.notifyRegistrant(new AsyncResult(null, null, null));
}
}
use of android.os.AsyncResult in project android_frameworks_opt_telephony by LineageOS.
the class IccRecords method registerForRecordsOverride.
public void registerForRecordsOverride(Handler h, int what, Object obj) {
if (mDestroyed.get()) {
return;
}
Registrant r = new Registrant(h, what, obj);
mRecordsOverrideRegistrants.add(r);
if (getRecordsLoaded()) {
r.notifyRegistrant(new AsyncResult(null, null, null));
}
}
use of android.os.AsyncResult in project android_frameworks_opt_telephony by LineageOS.
the class AdnRecordCache method clearWaiters.
private void clearWaiters() {
int size = mAdnLikeWaiters.size();
for (int i = 0; i < size; i++) {
ArrayList<Message> waiters = mAdnLikeWaiters.valueAt(i);
AsyncResult ar = new AsyncResult(null, null, new RuntimeException("AdnCache reset"));
notifyWaiters(waiters, ar);
}
mAdnLikeWaiters.clear();
}
Aggregations