Added in API level 33

AssociationInfo


class AssociationInfo : Parcelable
kotlin.Any
   ↳ android.companion.AssociationInfo

Details for a specific "association" that has been established between an app and companion device.

An association gives an app the ability to interact with a companion device without needing to acquire broader runtime permissions. An association only exists after the user has confirmed that an app should have access to a companion device.

Summary

Inherited constants
Public methods
Int

Boolean
equals(other: Any?)

AssociatedDevice?

Companion device that was associated.

MacAddress?

String?

CharSequence?

Int

Int

Int

Boolean

String

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<AssociationInfo!>

Public methods

describeContents

Added in API level 33
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 33
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getAssociatedDevice

Added in API level 34
fun getAssociatedDevice(): AssociatedDevice?

Companion device that was associated. Note that this field is not persisted across sessions. Device can be one of the following types:

Return
AssociatedDevice? the companion device that was associated, or null if the device is self-managed or this association info was retrieved from persistent storage.

getDeviceMacAddress

Added in API level 33
fun getDeviceMacAddress(): MacAddress?
Return
MacAddress? the MAC address of the device. This value may be null.

getDeviceProfile

Added in API level 33
fun getDeviceProfile(): String?
Return
String? the companion device profile used when establishing this association, or null if no specific profile was used.

getDisplayName

Added in API level 33
fun getDisplayName(): CharSequence?
Return
CharSequence? the display name of the companion device (optionally) provided by the companion application. This value may be null.

getId

Added in API level 33
fun getId(): Int
Return
Int the unique ID of this association record.

getSystemDataSyncFlags

Added in API level 34
fun getSystemDataSyncFlags(): Int
Return
Int Enabled system data sync flags set via CompanionDeviceManager#enableSystemDataSyncForTypes(int, int) (int, int)} and CompanionDeviceManager#disableSystemDataSyncForTypes(int, int) (int, int)}. Or by default all flags are 1 (enabled).

hashCode

Added in API level 33
fun hashCode(): Int
Return
Int a hash code value for this object.

isSelfManaged

Added in API level 35
fun isSelfManaged(): Boolean
Return
Boolean whether the association is managed by the companion application it belongs to.

toString

Added in API level 33
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 33
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 33
static val CREATOR: Parcelable.Creator<AssociationInfo!>