| java.lang.Object | |
| ↳ | com.datalogic.device.account.AccountManager |
AccountManager provides APIs for managing user accounts in the system.
Supports operations for retrieving, removing accounts, and listening to account updates.
Note: The constructor will throw a DeviceException if the AccountManager service
is not available on this device.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| AccountManager.AccountUpdateListener | Listener interface for receiving notifications about account updates in the system. | ||||||||||
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | GOOGLE_ACCOUNT_TYPE | Google account type constant used to identify Google accounts in the system. | |||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new instance of AccountManager.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Registers a listener to receive notifications when accounts are updated in the system.
| |||||||||||
Removes a specific account from the system.
| |||||||||||
Removes all accounts from the system.
| |||||||||||
Removes all accounts of a specified type from the system.
| |||||||||||
Retrieves all accounts in the system regardless of type.
| |||||||||||
Retrieves all accounts that match the specified account type.
| |||||||||||
Unregisters a previously registered listener from account update notifications.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Google account type constant used to identify Google accounts in the system.
Creates a new instance of AccountManager.
This constructor connects to the underlying AccountManager service.
| DeviceException | if the AccountManager service is not available on this device |
|---|
Registers a listener to receive notifications when accounts are updated in the system.
Multiple listeners can be registered. The listener will be added to the internal list, and when the first listener is registered, the connection to the service is established. If registration with the service fails, the error is logged but the listener is still added to the local list.
| listener | The AccountManager.AccountUpdateListener callback to register for account update events.
Must not be null. |
|---|
| IllegalArgumentException | if the listener is null
|
|---|
Removes a specific account from the system.
| account | The Account to remove from the system. Should not be null. |
|---|
| RuntimeException | if the AccountManager service is not available, or if an error occurs during account removal |
|---|
Removes all accounts from the system.
| RuntimeException | if the AccountManager service is not available, or if an error occurs during account removal |
|---|
Removes all accounts of a specified type from the system.
| type | The account type to remove (e.g., GOOGLE_ACCOUNT_TYPE).
Should not be null. |
|---|
| RuntimeException | if the AccountManager service is not available, or if an error occurs during account removal |
|---|
Retrieves all accounts in the system regardless of type.
Account objects in the system.| RuntimeException | if the AccountManager service is not available, or if an error occurs during account retrieval |
|---|
Retrieves all accounts that match the specified account type.
| type | The account type to filter by (e.g., GOOGLE_ACCOUNT_TYPE).
Must not be null. |
|---|
Account objects matching the specified type.| RuntimeException | if the AccountManager service is not available, or if an error occurs during account retrieval |
|---|
Unregisters a previously registered listener from account update notifications.
If the listener was not previously registered, this method logs a warning and returns. When the last listener is unregistered, the connection to the service is removed. If unregistration with the service fails, the error is logged but the listener is still removed from the local list.
| listener | The AccountManager.AccountUpdateListener callback to unregister.
Must not be null. |
|---|
| IllegalArgumentException | if the listener is null
|
|---|