# SharedDeviceData

public final class **SharedDeviceData** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
implements [Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) Class which provides a type-safe interpretation of the `https://developer.android.com/reference/android/content/Intent.html` that will
be delivered when an application is selected from the share-sheet shown via `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)`.

The `https://developer.android.com/reference/android/app/Activity.html` component
which is registered for the action:

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

will receive an `https://developer.android.com/reference/android/content/Intent.html` which can
be parsed via `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#fromIntent(android.content.Intent)`. If the `https://developer.android.com/reference/android/content/Intent.html` is missing
information (which should not be the case for `https://developer.android.com/reference/android/content/Intent.html`s received
from the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient` APIs), then an `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData.InvalidSharedDeviceDataException` will be thrown.

### Nested Class Summary

|---|---|---|---|
| class | [SharedDeviceData.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData.Builder) || A builder for `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData` instances. |
| class | [SharedDeviceData.InvalidSharedDeviceDataException](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData.InvalidSharedDeviceDataException) || Exception thrown when parsing an `https://developer.android.com/reference/android/content/Intent.html` to retrieved a `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData`, if the given `https://developer.android.com/reference/android/content/Intent.html` is missing required data or is malformed. |

### Constant Summary

|---|---|---|
| [String](https://developer.android.com/reference/java/lang/String.html) | [EXTRA_COMMISSIONING_WINDOW_EXPIRATION](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#EXTRA_COMMISSIONING_WINDOW_EXPIRATION) | Intent extra key for the result of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` to retrieve the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getCommissioningWindowExpirationMillis()` value. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [EXTRA_DEVICE_NAME](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#EXTRA_DEVICE_NAME) | Intent extra key for the result of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` to retrieve the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getDeviceName()` value. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [EXTRA_DEVICE_TYPE](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#EXTRA_DEVICE_TYPE) | *This constant 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* |
| [String](https://developer.android.com/reference/java/lang/String.html) | [EXTRA_MANUAL_PAIRING_CODE](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#EXTRA_MANUAL_PAIRING_CODE) | Intent extra key for the result of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` to retrieve the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getManualPairingCode()` value. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [EXTRA_PRODUCT_ID](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#EXTRA_PRODUCT_ID) | Intent extra key for the result of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` to retrieve the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getProductId()` value. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [EXTRA_ROOM_NAME](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#EXTRA_ROOM_NAME) | Intent extra key for the result of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` to retrieve the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getRoomName()` value. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [EXTRA_VENDOR_ID](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#EXTRA_VENDOR_ID) | Intent extra key for the result of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` to retrieve the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getVendorId()` value. |

### Inherited Constant Summary

From interface android.os.Parcelable

|---|---|---|
| int | CONTENTS_FILE_DESCRIPTOR |   |
| int | PARCELABLE_STABILITY_LOCAL |   |
| int | PARCELABLE_STABILITY_VINTF |   |
| int | PARCELABLE_WRITE_RETURN_VALUE |   |

### Public Method Summary

|---|---|
| static [SharedDeviceData.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData.Builder) | [builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#builder(java.lang.String))([String](https://developer.android.com/reference/java/lang/String.html) manualPairingCode) Returns a new `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData.Builder` with the given `manualPairingCode` set. |
| boolean | [equals](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#equals(java.lang.Object))([Object](https://developer.android.com/reference/java/lang/Object.html) other) |
| static [SharedDeviceData](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData) | [fromIntent](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#fromIntent(android.content.Intent))([Intent](https://developer.android.com/reference/android/content/Intent.html) intent) Returns a `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData` parsed from the given `intent`. |
| long | [getCommissioningWindowExpirationMillis](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getCommissioningWindowExpirationMillis())() The expiration time, in milliseconds, of the opened commissioning window. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getDeviceName](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getDeviceName())() Returns the user-specified name of the device being shared, as specified by the app which initiated sharing. |
| int | [getDeviceType](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getDeviceType())() *This method 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* |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getManualPairingCode](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getManualPairingCode())() A manual pairing code encoding the passcode and other information for the shared device. |
| int | [getProductId](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getProductId())() Returns the product ID of the device being shared, as specified by the app which initiated sharing. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getRoomName](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getRoomName())() Returns the user-facing name of the room in which the device is located, if specified by the app which initiated sharing. |
| int | [getVendorId](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getVendorId())() Returns the vendor ID of the device being shared, as specified by the app which initiated sharing. |
| int | [hashCode](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#hashCode())() |
| [Intent](https://developer.android.com/reference/android/content/Intent.html) | [toIntent](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#toIntent())() Converts this `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData` instance into an `https://developer.android.com/reference/android/content/Intent.html` that can be parsed into an equivalent instance as `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#fromIntent(android.content.Intent)`. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [toString](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#toString())() |
| void | [writeToParcel](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#writeToParcel(android.os.Parcel,%20int))([Parcel](https://developer.android.com/reference/android/os/Parcel.html) dest, int flags) |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

From interface android.os.Parcelable

|---|---|
| abstract int | describeContents() |
| abstract void | writeToParcel([Parcel](https://developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |

## Constants

#### public static final [String](https://developer.android.com/reference/java/lang/String.html)
**EXTRA_COMMISSIONING_WINDOW_EXPIRATION**

Intent extra key for the result of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` to retrieve the
`https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getCommissioningWindowExpirationMillis()` value.

Intent extra type: Long
Constant Value: "com.google.android.gms.home.matter.EXTRA_COMMISSIONING_WINDOW_EXPIRATION"

#### public static final [String](https://developer.android.com/reference/java/lang/String.html)
**EXTRA_DEVICE_NAME**

Intent extra key for the result of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` to retrieve the
`https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getDeviceName()` value.

Intent extra type: String
Constant Value: "com.google.android.gms.home.matter.EXTRA_DEVICE_NAME"

#### public static final [String](https://developer.android.com/reference/java/lang/String.html)
**EXTRA_DEVICE_TYPE**

**This constant 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
Intent extra key for the result of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` to retrieve the
`https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getDeviceType()` value.

Intent extra type: Integer
Constant Value: "com.google.android.gms.home.matter.EXTRA_DEVICE_TYPE"

#### public static final [String](https://developer.android.com/reference/java/lang/String.html)
**EXTRA_MANUAL_PAIRING_CODE**

Intent extra key for the result of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` to retrieve the
`https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getManualPairingCode()` value.

Intent extra type: String.
Constant Value: "com.google.android.gms.home.matter.EXTRA_MANUAL_PAIRING_CODE"

#### public static final [String](https://developer.android.com/reference/java/lang/String.html)
**EXTRA_PRODUCT_ID**

Intent extra key for the result of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` to retrieve the
`https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getProductId()` value.

Intent extra type: Integer
Constant Value: "com.google.android.gms.home.matter.EXTRA_PRODUCT_ID"

#### public static final [String](https://developer.android.com/reference/java/lang/String.html)
**EXTRA_ROOM_NAME**

Intent extra key for the result of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` to retrieve the
`https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getRoomName()` value.

Intent extra type: String
Constant Value: "com.google.android.gms.home.matter.EXTRA_ROOM_NAME"

#### public static final [String](https://developer.android.com/reference/java/lang/String.html)
**EXTRA_VENDOR_ID**

Intent extra key for the result of `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` to retrieve the
`https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#getVendorId()` value.

Intent extra type: Integer
Constant Value: "com.google.android.gms.home.matter.EXTRA_VENDOR_ID"

## Public Methods

#### public static [SharedDeviceData.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData.Builder) **builder**
([String](https://developer.android.com/reference/java/lang/String.html) manualPairingCode)

Returns a new `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData.Builder` with the given `manualPairingCode`
set.

#### public boolean **equals** ([Object](https://developer.android.com/reference/java/lang/Object.html) other)

#### public static [SharedDeviceData](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData) **fromIntent**
([Intent](https://developer.android.com/reference/android/content/Intent.html) intent)

Returns a `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData` parsed from the given `intent`.

##### Parameters

| intent | the intent data returned as a result from an `https://developer.android.com/reference/android/content/IntentSender.html` started for result from the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/CommissioningClient#shareDevice(com.google.android.gms.home.matter.commissioning.ShareDeviceRequest)` API |
|---|---|

##### Throws

| [SharedDeviceData.InvalidSharedDeviceDataException](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData.InvalidSharedDeviceDataException) | if `intent` was malformed or missing required data |
|---|---|

#### public long **getCommissioningWindowExpirationMillis** ()

The expiration time, in milliseconds, of the opened commissioning window. The time
basis is `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()`,
and not `https://developer.android.com/reference/java/lang/System.html#currentTimeMillis()`.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getDeviceName** ()

Returns the user-specified name of the device being shared, as specified by the app
which initiated sharing.

#### public int **getDeviceType** ()

**This method 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
Returns the primary device type of the device being shared, as specified by the app
which initiated sharing. If not specified, this returns zero.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getManualPairingCode** ()

A manual pairing code encoding the passcode and other information for the shared
device.

#### public int **getProductId** ()

Returns the product ID of the device being shared, as specified by the app which
initiated sharing.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getRoomName** ()

Returns the user-facing name of the room in which the device is located, if
specified by the app which initiated sharing.

#### public int **getVendorId** ()

Returns the vendor ID of the device being shared, as specified by the app which
initiated sharing.

#### public int **hashCode** ()

#### public [Intent](https://developer.android.com/reference/android/content/Intent.html)
**toIntent** ()

Converts this `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData` instance into an `https://developer.android.com/reference/android/content/Intent.html` that
can be parsed into an equivalent instance as `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/commissioning/SharedDeviceData#fromIntent(android.content.Intent)`.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **toString** ()

#### public void **writeToParcel** ([Parcel](https://developer.android.com/reference/android/os/Parcel.html) dest, int flags)