android-components / mozilla.components.service.fxa

Package mozilla.components.service.fxa

Types

Name Summary
AccountStorage interface AccountStorage
DeviceConfig data class DeviceConfig
Configuration for the current device.
FirefoxAccount class FirefoxAccount : OAuthAccount
FirefoxAccount represents the authentication state of a client.
FxaDeviceConstellation class FxaDeviceConstellation : DeviceConstellation, Observable<DeviceEventsObserver>
Provides an implementation of DeviceConstellation backed by a FirefoxAccount.
SharedPrefAccountStorage class SharedPrefAccountStorage : AccountStorage
SyncAuthInfoCache class SyncAuthInfoCache
A thin wrapper around SharedPreferences which knows how to serialize/deserialize SyncAuthInfo.
SyncConfig data class SyncConfig
Configuration for sync.

Type Aliases

Name Summary
FxaException typealias FxaException = FxaException
High-level exception class for the exceptions thrown in the Rust library.
FxaNetworkException typealias FxaNetworkException = Network
Thrown on a network error.
FxaPanicException typealias FxaPanicException = Panic
Thrown when the Rust library hits an assertion or panic (this is always a bug).
FxaUnauthorizedException typealias FxaUnauthorizedException = Unauthorized
Thrown when the operation requires additional authorization.
FxaUnspecifiedException typealias FxaUnspecifiedException = Unspecified
Thrown when the Rust library hits an unexpected error that isn’t a panic. This may indicate library misuse, network errors, etc.
PersistCallback typealias PersistCallback = PersistCallback
ServerConfig typealias ServerConfig = Config

Extensions for External Classes

Name Summary
mozilla.appservices.fxaclient.AccessTokenInfo  
mozilla.appservices.fxaclient.AccountEvent.TabReceived  
mozilla.appservices.fxaclient.Device  
mozilla.appservices.fxaclient.Device.Capability  
mozilla.appservices.fxaclient.Device.PushSubscription  
mozilla.appservices.fxaclient.Device.Type  
mozilla.appservices.fxaclient.Profile  
mozilla.appservices.fxaclient.ScopedKey  
mozilla.appservices.fxaclient.TabHistoryEntry  

Properties

Name Summary
FXA_STATE_KEY const val FXA_STATE_KEY: String
FXA_STATE_PREFS_KEY const val FXA_STATE_PREFS_KEY: String

Functions

Name Summary
asSyncAuthInfo fun AccessTokenInfo.asSyncAuthInfo(tokenServerUrl: String): SyncAuthInfo
Converts a generic AccessTokenInfo into a Firefox Sync-friendly SyncAuthInfo instance which may be used for data synchronization.
handleFxaExceptions fun <T> handleFxaExceptions(logger: Logger, operation: String, block: () -> T, postHandleAuthErrorBlock: (FxaUnauthorizedException) -> T, handleErrorBlock: (FxaException) -> T): T
Runs a provided lambda, and if that throws non-panic, non-auth FxA exception, runs handleErrorBlock. If that lambda throws an FxA auth exception, notifies authErrorRegistry, and runs postHandleAuthErrorBlock.fun <T> handleFxaExceptions(logger: Logger, operation: String, default: (FxaException) -> T, block: () -> T): T
Helper method that handles FxaException and allows specifying a lazy default value via default block for use in case of errors. Execution is wrapped in log statements.fun handleFxaExceptions(logger: Logger, operation: String, block: () -> Unit): Boolean
Helper method that handles FxaException and returns a Boolean success flag as a result.
into fun DeviceType.into(): Type
fun DeviceCapability.into(): Capability
fun DevicePushSubscription.into(): PushSubscription
fun Device.into(): Device
fun TabData.into(): TabHistoryEntry
fun TabReceived.into(): TabReceived