Search in sources :

Example 6 with AsyncResultCallback

use of com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback in project android_frameworks_opt_telephony by LineageOS.

the class EuiccCardController method getProfile.

@Override
public void getProfile(String callingPackage, String cardId, String iccid, IGetProfileCallback 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("getProfile callback failure.", exception);
        }
        return;
    }
    AsyncResultCallback<EuiccProfileInfo> cardCb = new AsyncResultCallback<EuiccProfileInfo>() {

        @Override
        public void onResult(EuiccProfileInfo result) {
            try {
                callback.onComplete(EuiccCardManager.RESULT_OK, result);
            } catch (RemoteException exception) {
                loge("getProfile callback failure.", exception);
            }
        }

        @Override
        public void onException(Throwable e) {
            try {
                loge("getProfile callback onException: ", e);
                callback.onComplete(getResultCode(e), null);
            } catch (RemoteException exception) {
                loge("getProfile callback failure.", exception);
            }
        }
    };
    card.getProfile(iccid, cardCb, mEuiccMainThreadHandler);
}
Also used : EuiccProfileInfo(android.service.euicc.EuiccProfileInfo) EuiccCard(com.android.internal.telephony.uicc.euicc.EuiccCard) RemoteException(android.os.RemoteException) AsyncResultCallback(com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback)

Example 7 with AsyncResultCallback

use of com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback in project android_frameworks_opt_telephony by LineageOS.

the class EuiccCardController method authenticateServer.

@Override
public void authenticateServer(String callingPackage, String cardId, String matchingId, byte[] serverSigned1, byte[] serverSignature1, byte[] euiccCiPkIdToBeUsed, byte[] serverCertificate, IAuthenticateServerCallback 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("authenticateServer 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("authenticateServer callback failure.", exception);
            }
        }

        @Override
        public void onException(Throwable e) {
            try {
                loge("authenticateServer callback onException: ", e);
                callback.onComplete(getResultCode(e), null);
            } catch (RemoteException exception) {
                loge("authenticateServer callback failure.", exception);
            }
        }
    };
    card.authenticateServer(matchingId, serverSigned1, serverSignature1, euiccCiPkIdToBeUsed, serverCertificate, 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 8 with AsyncResultCallback

use of com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback in project android_frameworks_opt_telephony by LineageOS.

the class EuiccCardController method prepareDownload.

@Override
public void prepareDownload(String callingPackage, String cardId, @Nullable byte[] hashCc, byte[] smdpSigned2, byte[] smdpSignature2, byte[] smdpCertificate, IPrepareDownloadCallback 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("prepareDownload 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("prepareDownload callback failure.", exception);
            }
        }

        @Override
        public void onException(Throwable e) {
            try {
                loge("prepareDownload callback onException: ", e);
                callback.onComplete(getResultCode(e), null);
            } catch (RemoteException exception) {
                loge("prepareDownload callback failure.", exception);
            }
        }
    };
    card.prepareDownload(hashCc, smdpSigned2, smdpSignature2, smdpCertificate, 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 9 with AsyncResultCallback

use of com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback in project android_frameworks_opt_telephony by LineageOS.

the class EuiccCardController method loadBoundProfilePackage.

@Override
public void loadBoundProfilePackage(String callingPackage, String cardId, byte[] boundProfilePackage, ILoadBoundProfilePackageCallback 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("loadBoundProfilePackage callback failure.", exception);
        }
        return;
    }
    AsyncResultCallback<byte[]> cardCb = new AsyncResultCallback<byte[]>() {

        @Override
        public void onResult(byte[] result) {
            Log.i(TAG, "Request subscription info list refresh after install.");
            SubscriptionController.getInstance().requestEmbeddedSubscriptionInfoListRefresh(mUiccController.convertToPublicCardId(cardId));
            try {
                callback.onComplete(EuiccCardManager.RESULT_OK, result);
            } catch (RemoteException exception) {
                loge("loadBoundProfilePackage callback failure.", exception);
            }
        }

        @Override
        public void onException(Throwable e) {
            try {
                loge("loadBoundProfilePackage callback onException: ", e);
                callback.onComplete(getResultCode(e), null);
            } catch (RemoteException exception) {
                loge("loadBoundProfilePackage callback failure.", exception);
            }
        }
    };
    card.loadBoundProfilePackage(boundProfilePackage, 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 10 with AsyncResultCallback

use of com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback in project android_frameworks_opt_telephony by LineageOS.

the class EuiccCardController method deleteProfile.

@Override
public void deleteProfile(String callingPackage, String cardId, String iccid, IDeleteProfileCallback 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("deleteProfile 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 delete.");
            SubscriptionController.getInstance().requestEmbeddedSubscriptionInfoListRefresh(mUiccController.convertToPublicCardId(cardId));
            try {
                callback.onComplete(EuiccCardManager.RESULT_OK);
            } catch (RemoteException exception) {
                loge("deleteProfile callback failure.", exception);
            }
        }

        @Override
        public void onException(Throwable e) {
            try {
                loge("deleteProfile callback onException: ", e);
                callback.onComplete(getResultCode(e));
            } catch (RemoteException exception) {
                loge("deleteProfile callback failure.", exception);
            }
        }
    };
    card.deleteProfile(iccid, 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

AsyncResultCallback (com.android.internal.telephony.uicc.euicc.async.AsyncResultCallback)23 RemoteException (android.os.RemoteException)22 EuiccCard (com.android.internal.telephony.uicc.euicc.EuiccCard)22 EuiccProfileInfo (android.service.euicc.EuiccProfileInfo)3 EuiccNotification (android.telephony.euicc.EuiccNotification)3 AsyncResult (android.os.AsyncResult)1 Handler (android.os.Handler)1 EuiccRulesAuthTable (android.telephony.euicc.EuiccRulesAuthTable)1 VisibleForTesting (com.android.internal.annotations.VisibleForTesting)1