Search in sources :

Example 1 with AsyncResultCallback

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

the class EuiccCardController method retrieveNotification.

@Override
public void retrieveNotification(String callingPackage, String cardId, int seqNumber, IRetrieveNotificationCallback 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("retrieveNotification callback failure.", exception);
        }
        return;
    }
    AsyncResultCallback<EuiccNotification> cardCb = new AsyncResultCallback<EuiccNotification>() {

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

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

Example 2 with AsyncResultCallback

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

the class EuiccCardController method getEuiccInfo1.

@Override
public void getEuiccInfo1(String callingPackage, String cardId, IGetEuiccInfo1Callback 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("getEuiccInfo1 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("getEuiccInfo1 callback failure.", exception);
            }
        }

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

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

the class EuiccCardController method disableProfile.

@Override
public void disableProfile(String callingPackage, String cardId, String iccid, boolean refresh, IDisableProfileCallback 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("disableProfile 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("disableProfile callback failure.", exception);
            }
        }

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

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

the class EuiccCardController method getSmdsAddress.

@Override
public void getSmdsAddress(String callingPackage, String cardId, IGetSmdsAddressCallback 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("getSmdsAddress 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("getSmdsAddress callback failure.", exception);
            }
        }

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

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

the class EuiccCardController method removeNotificationFromList.

@Override
public void removeNotificationFromList(String callingPackage, String cardId, int seqNumber, IRemoveNotificationFromListCallback 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("removeNotificationFromList 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("removeNotificationFromList callback failure.", exception);
            }
        }

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