android-components / mozilla.components.service.fxa / DeviceConfig


data class DeviceConfig (source)

Configuration for the current device.


Name Summary
<init> DeviceConfig(name: String, type: DeviceType, capabilities: Set<DeviceCapability>, secureStateAtRest: Boolean = false)
Configuration for the current device.


Name Summary
capabilities val capabilities: Set<DeviceCapability>
A set of device capabilities, such as SEND_TAB. This set can be expanded by re-initializing FxaAccountManager with a new set (e.g. on app restart). Shrinking a set of capabilities is currently not supported.
name val name: String
An initial name to use for the device record which will be created during authentication. This can be changed later via FxaDeviceConstellation.
secureStateAtRest val secureStateAtRest: Boolean
A flag indicating whether or not to use encrypted storage for the persisted account state. If set to true, SecureAbove22AccountStorage will be used as a storage layer. As the name suggests, account state will only by encrypted on Android API 23+. Otherwise, even if this flag is set to true, account state will be stored in plaintext.
type val type: DeviceType
Type of a device - mobile, desktop - used for displaying identifying icons on other devices. This cannot be changed once device record is created.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.