use of com.android.internal.telephony.uicc.UiccSlot in project android_frameworks_opt_telephony by LineageOS.
the class GsmCdmaPhone method enableUiccApplications.
// Enable or disable uicc applications.
@Override
public void enableUiccApplications(boolean enable, Message onCompleteMessage) {
// First check if card is present. Otherwise mUiccApplicationsDisabled doesn't make
// any sense.
UiccSlot slot = mUiccController.getUiccSlotForPhone(mPhoneId);
if (slot == null || slot.getCardState() != IccCardStatus.CardState.CARDSTATE_PRESENT) {
if (onCompleteMessage != null) {
AsyncResult.forMessage(onCompleteMessage, null, new IllegalStateException("No SIM card is present"));
onCompleteMessage.sendToTarget();
}
return;
}
mCi.enableUiccApplications(enable, onCompleteMessage);
}
use of com.android.internal.telephony.uicc.UiccSlot in project android_frameworks_opt_telephony by LineageOS.
the class GsmCdmaPhone method reapplyUiccAppsEnablementIfNeeded.
private void reapplyUiccAppsEnablementIfNeeded(int retries) {
UiccSlot slot = mUiccController.getUiccSlotForPhone(mPhoneId);
// If no card is present or we don't have mUiccApplicationsEnabled yet, do nothing.
if (slot == null || slot.getCardState() != IccCardStatus.CardState.CARDSTATE_PRESENT || mUiccApplicationsEnabled == null) {
return;
}
String iccId = slot.getIccId();
if (iccId == null)
return;
SubscriptionInfo info = SubscriptionController.getInstance().getSubInfoForIccId(IccUtils.stripTrailingFs(iccId));
// If info is null, it could be a new subscription. By default we enable it.
boolean expectedValue = info == null ? true : info.areUiccApplicationsEnabled();
// configured state.
if (expectedValue != mUiccApplicationsEnabled) {
mCi.enableUiccApplications(expectedValue, Message.obtain(this, EVENT_REAPPLY_UICC_APPS_ENABLEMENT_DONE, new Pair<Boolean, Integer>(expectedValue, retries)));
}
}
use of com.android.internal.telephony.uicc.UiccSlot in project android_frameworks_opt_telephony by LineageOS.
the class SubscriptionInfoUpdater method areUiccAppsDisabledOnCard.
private boolean areUiccAppsDisabledOnCard(int phoneId) {
// When uicc apps are disabled(supported in IRadio 1.5), we will still get IccId from
// cardStatus (since IRadio 1.2). Amd upon cardStatus change we'll receive another
// handleSimNotReady so this will be evaluated again.
UiccSlot slot = UiccController.getInstance().getUiccSlotForPhone(phoneId);
if (slot == null || slot.getIccId() == null)
return false;
SubscriptionInfo info = SubscriptionController.getInstance().getSubInfoForIccId(IccUtils.stripTrailingFs(slot.getIccId()));
return info != null && !info.areUiccApplicationsEnabled();
}
use of com.android.internal.telephony.uicc.UiccSlot in project android_frameworks_opt_telephony by LineageOS.
the class SubscriptionInfoUpdater method handleSimNotReady.
protected void handleSimNotReady(int phoneId) {
logd("handleSimNotReady: phoneId: " + phoneId);
boolean isFinalState = false;
IccCard iccCard = PhoneFactory.getPhone(phoneId).getIccCard();
boolean uiccAppsDisabled = areUiccAppsDisabledOnCard(phoneId);
if (iccCard.isEmptyProfile() || uiccAppsDisabled) {
if (uiccAppsDisabled) {
UiccSlot slot = UiccController.getInstance().getUiccSlotForPhone(phoneId);
sInactiveIccIds[phoneId] = IccUtils.stripTrailingFs(slot.getIccId());
}
isFinalState = true;
// ICC_NOT_READY is a terminal state for
// 1) It's an empty profile as there's no uicc applications. Or
// 2) Its uicc applications are set to be disabled.
// At this phase, the subscription list is accessible. Treating NOT_READY
// as equivalent to ABSENT, once the rest of the system can handle it.
sIccId[phoneId] = ICCID_STRING_FOR_NO_SIM;
updateSubscriptionInfoByIccId(phoneId, false);
}
broadcastSimStateChanged(phoneId, IccCardConstants.INTENT_VALUE_ICC_NOT_READY, null);
broadcastSimCardStateChanged(phoneId, TelephonyManager.SIM_STATE_PRESENT);
broadcastSimApplicationStateChanged(phoneId, TelephonyManager.SIM_STATE_NOT_READY);
if (isFinalState) {
updateCarrierServices(phoneId, IccCardConstants.INTENT_VALUE_ICC_NOT_READY);
}
}
use of com.android.internal.telephony.uicc.UiccSlot in project android_frameworks_opt_telephony by LineageOS.
the class VoiceCallSessionStats method isEsim.
private boolean isEsim() {
int slotId = getSimSlotId();
UiccSlot slot = mUiccController.getUiccSlot(slotId);
if (slot != null) {
return slot.isEuicc();
} else {
// should not happen, but assume we are not using eSIM
loge("isEsim: slot %d is null", slotId);
return false;
}
}
Aggregations