use of com.android.internal.telephony.uicc.euicc.apdu.RequestBuilder in project android_frameworks_opt_telephony by LineageOS.
the class EuiccCard method listNotifications.
/**
* Lists all notifications of the given {@code notificationEvents}.
*
* @param events Bits of the event types ({@link EuiccNotification.Event}) to list.
* @param callback The callback to get the result.
* @param handler The handler to run the callback.
* @since 2.0.0 [GSMA SGP.22]
*/
public void listNotifications(@EuiccNotification.Event int events, AsyncResultCallback<EuiccNotification[]> callback, Handler handler) {
sendApdu(newRequestProvider((RequestBuilder requestBuilder) -> requestBuilder.addStoreData(Asn1Node.newBuilder(Tags.TAG_LIST_NOTIFICATION).addChildAsBits(Tags.TAG_CTX_1, events).build().toHex())), response -> {
Asn1Node root = parseResponseAndCheckSimpleError(response, EuiccCardErrorException.OPERATION_LIST_NOTIFICATIONS);
List<Asn1Node> nodes = root.getChild(Tags.TAG_CTX_COMP_0).getChildren();
EuiccNotification[] notifications = new EuiccNotification[nodes.size()];
for (int i = 0; i < notifications.length; ++i) {
notifications[i] = createNotification(nodes.get(i));
}
return notifications;
}, callback, handler);
}
Aggregations