SharedDeviceData

class SharedDeviceData : Parcelable


Class which provides a type-safe interpretation of the Intent that will be delivered when an application is selected from the share-sheet shown via shareDevice.

The android.app.Activity component which is registered for the action:

android:name="com.google.android.gms.home.matter.ACTION_COMMISSION_DEVICE"

will receive an Intent which can be parsed via fromIntent. If the Intent is missing information (which should not be the case for Intents received from the CommissioningClient APIs), then an InvalidSharedDeviceDataException will be thrown.

Summary

Nested types

A builder for SharedDeviceData instances.

Exception thrown when parsing an Intent to retrieved a SharedDeviceData, if the given Intent is missing required data or is malformed.

Constants

const String!
EXTRA_COMMISSIONING_WINDOW_EXPIRATION = "com.google.android.gms.home.matter.EXTRA_COMMISSIONING_WINDOW_EXPIRATION"

Intent extra key for the result of shareDevice to retrieve the getCommissioningWindowExpirationMillis value.

const String!
EXTRA_DEVICE_NAME = "com.google.android.gms.home.matter.EXTRA_DEVICE_NAME"

Intent extra key for the result of shareDevice to retrieve the getDeviceName value.

const String!
EXTRA_DEVICE_TYPE = "com.google.android.gms.home.matter.EXTRA_DEVICE_TYPE"

This property is deprecated.

this field is not expected to be populated; the vendor ID and product ID can be used to map to a device type

const String!
EXTRA_MANUAL_PAIRING_CODE = "com.google.android.gms.home.matter.EXTRA_MANUAL_PAIRING_CODE"

Intent extra key for the result of shareDevice to retrieve the getManualPairingCode value.

const String!
EXTRA_PRODUCT_ID = "com.google.android.gms.home.matter.EXTRA_PRODUCT_ID"

Intent extra key for the result of shareDevice to retrieve the getProductId value.

const String!
EXTRA_ROOM_NAME = "com.google.android.gms.home.matter.EXTRA_ROOM_NAME"

Intent extra key for the result of shareDevice to retrieve the getRoomName value.

const String!
EXTRA_VENDOR_ID = "com.google.android.gms.home.matter.EXTRA_VENDOR_ID"

Intent extra key for the result of shareDevice to retrieve the getVendorId value.

Public functions

java-static SharedDeviceData.Builder!
builder(manualPairingCode: String!)

Returns a new SharedDeviceData.Builder with the given manualPairingCode set.

Boolean
equals(other: Any?)
java-static SharedDeviceData!
fromIntent(intent: Intent!)

Returns a SharedDeviceData parsed from the given intent.

Int
Intent!

Converts this SharedDeviceData instance into an Intent that can be parsed into an equivalent instance as fromIntent.

String!
Unit
writeToParcel(dest: Parcel!, flags: Int)

Inherited functions

From android.os.Parcelable

Constants

EXTRA_COMMISSIONING_WINDOW_EXPIRATION

const val EXTRA_COMMISSIONING_WINDOW_EXPIRATION = "com.google.android.gms.home.matter.EXTRA_COMMISSIONING_WINDOW_EXPIRATION": String!

Intent extra key for the result of shareDevice to retrieve the getCommissioningWindowExpirationMillis value.

Intent extra type: Long

EXTRA_DEVICE_NAME

const val EXTRA_DEVICE_NAME = "com.google.android.gms.home.matter.EXTRA_DEVICE_NAME": String!

Intent extra key for the result of shareDevice to retrieve the getDeviceName value.

Intent extra type: String

EXTRA_DEVICE_TYPE

const val EXTRA_DEVICE_TYPE = "com.google.android.gms.home.matter.EXTRA_DEVICE_TYPE": String!

Intent extra key for the result of shareDevice to retrieve the getDeviceType value.

Intent extra type: Integer

EXTRA_MANUAL_PAIRING_CODE

const val EXTRA_MANUAL_PAIRING_CODE = "com.google.android.gms.home.matter.EXTRA_MANUAL_PAIRING_CODE": String!

Intent extra key for the result of shareDevice to retrieve the getManualPairingCode value.

Intent extra type: String.

EXTRA_PRODUCT_ID

const val EXTRA_PRODUCT_ID = "com.google.android.gms.home.matter.EXTRA_PRODUCT_ID": String!

Intent extra key for the result of shareDevice to retrieve the getProductId value.

Intent extra type: Integer

EXTRA_ROOM_NAME

const val EXTRA_ROOM_NAME = "com.google.android.gms.home.matter.EXTRA_ROOM_NAME": String!

Intent extra key for the result of shareDevice to retrieve the getRoomName value.

Intent extra type: String

EXTRA_VENDOR_ID

const val EXTRA_VENDOR_ID = "com.google.android.gms.home.matter.EXTRA_VENDOR_ID": String!

Intent extra key for the result of shareDevice to retrieve the getVendorId value.

Intent extra type: Integer

Public functions

builder

java-static fun builder(manualPairingCode: String!): SharedDeviceData.Builder!

Returns a new SharedDeviceData.Builder with the given manualPairingCode set.

equals

fun equals(other: Any?): Boolean

fromIntent

java-static fun fromIntent(intent: Intent!): SharedDeviceData!

Returns a SharedDeviceData parsed from the given intent.

Parameters
intent: Intent!

the intent data returned as a result from an android.content.IntentSender started for result from the shareDevice API

hashCode

fun hashCode(): Int

toIntent

fun toIntent(): Intent!

Converts this SharedDeviceData instance into an Intent that can be parsed into an equivalent instance as fromIntent.

toString

fun toString(): String!

writeToParcel

fun writeToParcel(dest: Parcel!, flags: Int): Unit

Public properties

commissioningWindowExpirationMillis

val commissioningWindowExpirationMillisLong

deviceName

val deviceNameString!

deviceType

val deviceTypeInt

manualPairingCode

val manualPairingCodeString!

productId

val productIdInt

roomName

val roomNameString?

vendorId

val vendorIdInt