Search in sources :

Example 21 with EuiccCard

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);
}
Also used : EuiccCard(com.android.internal.telephony.uicc.euicc.EuiccCard) RemoteException(android.os.RemoteException) AsyncResultCallback(com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback)

Example 22 with EuiccCard

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);
}
Also used : EuiccCard(com.android.internal.telephony.uicc.euicc.EuiccCard) RemoteException(android.os.RemoteException) AsyncResultCallback(com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback)

Example 23 with EuiccCard

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);
}
Also used : EuiccCard(com.android.internal.telephony.uicc.euicc.EuiccCard) RemoteException(android.os.RemoteException) AsyncResultCallback(com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback)

Example 24 with EuiccCard

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;
}
Also used : UiccController(com.android.internal.telephony.uicc.UiccController) EuiccCard(com.android.internal.telephony.uicc.euicc.EuiccCard) UiccSlot(com.android.internal.telephony.uicc.UiccSlot)

Example 25 with EuiccCard

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);
}
Also used : EuiccCard(com.android.internal.telephony.uicc.euicc.EuiccCard) RemoteException(android.os.RemoteException) AsyncResultCallback(com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback)

Aggregations

EuiccCard (com.android.internal.telephony.uicc.euicc.EuiccCard)27 RemoteException (android.os.RemoteException)22 AsyncResultCallback (com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback)22 EuiccProfileInfo (android.service.euicc.EuiccProfileInfo)3 EuiccNotification (android.telephony.euicc.EuiccNotification)3 AsyncResult (android.os.AsyncResult)1 EuiccRulesAuthTable (android.telephony.euicc.EuiccRulesAuthTable)1 VisibleForTesting (com.android.internal.annotations.VisibleForTesting)1 IccCardConstants (com.android.internal.telephony.IccCardConstants)1 CardState (com.android.internal.telephony.uicc.IccCardStatus.CardState)1 PinState (com.android.internal.telephony.uicc.IccCardStatus.PinState)1 UiccController (com.android.internal.telephony.uicc.UiccController)1 UiccSlot (com.android.internal.telephony.uicc.UiccSlot)1