public abstract class FinancialAidlAPI
FinancialAidlAPI is an abstract class that provides the core implementation for communicating with the Orchestrator service using AIDL. It handles service binding, JSON serialization/deserialization, and provides a clean API for making financial requests.
Subclasses of FinancialAidlAPI need to provide the specific Intent for binding to the service (bindingIntent) and can add any additional helper methods or logic as needed.
The main method financialRequest() is a suspend function that performs the entire flow of sending a request and receiving a response, including error handling and timeout support. The cancelTransaction() method allows for cancelling an ongoing transaction.
The useService() method is a generic helper that manages the service connection lifecycle and allows executing any block of code with the service instance.
| FinancialAidlAPI | public FinancialAidlAPI FinancialAidlAPI(Contextcontext) |
| Name | Summary |
|---|---|
| bindingIntent | private final Intent bindingIntent |
| Name | Summary |
|---|---|
| cancelTransaction | public final Boolean cancelTransaction(StringrequestId) Cancel an ongoing financial transaction. |
| financialRequest | public final TrxRes financialRequest(FinancialReqrequest, Durationtimeout) Process a financial request through the Orchestrator service (suspend version). |
| getBindingIntent | public abstract Intent getBindingIntent() |
| unbind | public final Unit unbind() Unbind from the Orchestrator service and clean up stored connections. Call this method when you're done using the API to free resources. |
| useService | public final T useService<T extends Any>(Durationtimeout,-SuspendFunction1<<Error-class:-unknown-class>,-T>block) Generic method to use the financial service with automatic binding, timeout, and connection reuse. |