# Control

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/service/controls/Control#nestedclasses)\|[Constants](https://developer.android.com/reference/android/service/controls/Control#constants)\|[Inherited Constants](https://developer.android.com/reference/android/service/controls/Control#inhconstants)\|[Fields](https://developer.android.com/reference/android/service/controls/Control#lfields)\|[Methods](https://developer.android.com/reference/android/service/controls/Control#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/service/controls/Control#inhmethods)  

# Control

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/service/controls/Control "View this page in Kotlin")\|Java

`
public

final

class
Control
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[Parcelable](https://developer.android.com/reference/android/os/Parcelable)`


`

|---|----------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.service.controls.Control |

<br />

*** ** * ** ***

Represents a physical object that can be represented by a[ControlTemplate](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate)and whose properties may be modified through a[ControlAction](https://developer.android.com/reference/android/service/controls/actions/ControlAction). The information is provided by a[ControlsProviderService](https://developer.android.com/reference/android/service/controls/ControlsProviderService)and represents static information (not current status) about the device.

Each control needs a unique (per provider) identifier that is persistent across reboots of the system.

Each[Control](https://developer.android.com/reference/android/service/controls/Control)will have a name, a subtitle and will optionally belong to a structure and zone. Some of these values are defined by the user and/or the[ControlsProviderService](https://developer.android.com/reference/android/service/controls/ControlsProviderService)and will be used to display the control as well as group them for management.

Each object will have an associated[DeviceTypes](https://developer.android.com/reference/android/service/controls/DeviceTypes). This will determine the icons and colors used to display it.

An[Intent](https://developer.android.com/reference/android/content/Intent)linking to the provider Activity that expands on this[Control](https://developer.android.com/reference/android/service/controls/Control)and allows for further actions should be provided.

## Summary

|                                                                                                                         ### Nested classes                                                                                                                         ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [Control.StatefulBuilder](https://developer.android.com/reference/android/service/controls/Control.StatefulBuilder) Builder class for[Control](https://developer.android.com/reference/android/service/controls/Control)that contains state information. |
| ` class` | [Control.StatelessBuilder](https://developer.android.com/reference/android/service/controls/Control.StatelessBuilder) Builder class for[Control](https://developer.android.com/reference/android/service/controls/Control).                              |

|                                                                                                                                ### Constants                                                                                                                                ||
|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [STATUS_DISABLED](https://developer.android.com/reference/android/service/controls/Control#STATUS_DISABLED) The[Control](https://developer.android.com/reference/android/service/controls/Control)is currently disabled.                                             |
| `int` | [STATUS_ERROR](https://developer.android.com/reference/android/service/controls/Control#STATUS_ERROR) Used to indicate that there was a temporary error while loading the device state.                                                                              |
| `int` | [STATUS_NOT_FOUND](https://developer.android.com/reference/android/service/controls/Control#STATUS_NOT_FOUND) The device corresponding to the[Control](https://developer.android.com/reference/android/service/controls/Control)cannot be found or was removed.      |
| `int` | [STATUS_OK](https://developer.android.com/reference/android/service/controls/Control#STATUS_OK) Used to indicate that the state of the device was successfully retrieved.                                                                                            |
| `int` | [STATUS_UNKNOWN](https://developer.android.com/reference/android/service/controls/Control#STATUS_UNKNOWN) Reserved for use with the[StatelessBuilder](https://developer.android.com/reference/android/service/controls/Control.StatelessBuilder), and while loading. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable) |-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR) Descriptor bit used with[describeContents()](https://developer.android.com/reference/android/os/Parcelable#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor.                                                                                                                                            | | `int` | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE) Flag for use with[writeToParcel(Parcel, int)](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". | |

|                                                                                                                                              ### Fields                                                                                                                                              ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| ` public static final `[Creator](https://developer.android.com/reference/android/os/Parcelable.Creator)`<`[Control](https://developer.android.com/reference/android/service/controls/Control)`>` | [CREATOR](https://developer.android.com/reference/android/service/controls/Control#CREATOR) <br /> |

|                                                                                                                                                                                          ### Public methods                                                                                                                                                                                           ||
|------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`                                                                                                           | ` `[describeContents](https://developer.android.com/reference/android/service/controls/Control#describeContents())`() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.                                                     |
| ` `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent)                            | ` `[getAppIntent](https://developer.android.com/reference/android/service/controls/Control#getAppIntent())`() `                                                                                                                                                                     |
| ` `[String](https://developer.android.com/reference/java/lang/String)                                            | ` `[getControlId](https://developer.android.com/reference/android/service/controls/Control#getControlId())`() `                                                                                                                                                                     |
| ` `[ControlTemplate](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate) | ` `[getControlTemplate](https://developer.android.com/reference/android/service/controls/Control#getControlTemplate())`() `                                                                                                                                                         |
| ` `[ColorStateList](https://developer.android.com/reference/android/content/res/ColorStateList)                  | ` `[getCustomColor](https://developer.android.com/reference/android/service/controls/Control#getCustomColor())`() ` Optional color to be shown with the[Control](https://developer.android.com/reference/android/service/controls/Control).                                         |
| ` `[Icon](https://developer.android.com/reference/android/graphics/drawable/Icon)                                | ` `[getCustomIcon](https://developer.android.com/reference/android/service/controls/Control#getCustomIcon())`() ` Optional icon to be shown with the[Control](https://developer.android.com/reference/android/service/controls/Control).                                            |
| ` int`                                                                                                           | ` `[getDeviceType](https://developer.android.com/reference/android/service/controls/Control#getDeviceType())`() `                                                                                                                                                                   |
| ` int`                                                                                                           | ` `[getStatus](https://developer.android.com/reference/android/service/controls/Control#getStatus())`() `                                                                                                                                                                           |
| ` `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)                                | ` `[getStatusText](https://developer.android.com/reference/android/service/controls/Control#getStatusText())`() `                                                                                                                                                                   |
| ` `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)                                | ` `[getStructure](https://developer.android.com/reference/android/service/controls/Control#getStructure())`() ` Optional top-level group to help define the[Control](https://developer.android.com/reference/android/service/controls/Control)'s location, visible to the user.     |
| ` `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)                                | ` `[getSubtitle](https://developer.android.com/reference/android/service/controls/Control#getSubtitle())`() `                                                                                                                                                                       |
| ` `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)                                | ` `[getTitle](https://developer.android.com/reference/android/service/controls/Control#getTitle())`() `                                                                                                                                                                             |
| ` `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)                                | ` `[getZone](https://developer.android.com/reference/android/service/controls/Control#getZone())`() ` Optional group name to help define the[Control](https://developer.android.com/reference/android/service/controls/Control)'s location within a structure, visible to the user. |
| ` boolean`                                                                                                       | ` `[isAuthRequired](https://developer.android.com/reference/android/service/controls/Control#isAuthRequired())`() `                                                                                                                                                                 |
| ` void`                                                                                                          | ` `[writeToParcel](https://developer.android.com/reference/android/service/controls/Control#writeToParcel(android.os.Parcel,%20int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel)` dest, int flags) ` Flatten this object in to a Parcel.                  |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||
| From interface` `[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable)` ` |------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract int`  | ` `[describeContents](https://developer.android.com/reference/android/os/Parcelable#describeContents())`() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.                                    | | ` abstract void` | ` `[writeToParcel](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel)` dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### STATUS_DISABLED

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int STATUS_DISABLED
```

The[Control](https://developer.android.com/reference/android/service/controls/Control)is currently disabled. A default error message will be displayed in place of any custom text that was set through[StatefulBuilder.setStatusText](https://developer.android.com/reference/android/service/controls/Control.StatefulBuilder#setStatusText(java.lang.CharSequence)).

<br />

Constant Value: 4 (0x00000004)  

### STATUS_ERROR

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int STATUS_ERROR
```

Used to indicate that there was a temporary error while loading the device state. A default error message will be displayed in place of any custom text that was set through[StatefulBuilder.setStatusText](https://developer.android.com/reference/android/service/controls/Control.StatefulBuilder#setStatusText(java.lang.CharSequence)).

<br />

Constant Value: 3 (0x00000003)  

### STATUS_NOT_FOUND

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int STATUS_NOT_FOUND
```

The device corresponding to the[Control](https://developer.android.com/reference/android/service/controls/Control)cannot be found or was removed. The user will be alerted and directed to the application to resolve.

<br />

Constant Value: 2 (0x00000002)  

### STATUS_OK

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int STATUS_OK
```

Used to indicate that the state of the device was successfully retrieved. This includes all scenarios where the device may have a warning for the user, such as "Lock jammed", or "Vacuum stuck". Any information for the user should be set through[StatefulBuilder.setStatusText](https://developer.android.com/reference/android/service/controls/Control.StatefulBuilder#setStatusText(java.lang.CharSequence)).

<br />

Constant Value: 1 (0x00000001)  

### STATUS_UNKNOWN

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int STATUS_UNKNOWN
```

Reserved for use with the[StatelessBuilder](https://developer.android.com/reference/android/service/controls/Control.StatelessBuilder), and while loading. When state is requested via[ControlsProviderService.createPublisherFor](https://developer.android.com/reference/android/service/controls/ControlsProviderService#createPublisherFor(java.util.List<java.lang.String>)), use other status codes to indicate the proper device state.

<br />

Constant Value: 0 (0x00000000)

## Fields

### CREATOR

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final Creator<Control> CREATOR
```

<br />

<br />

## Public methods

### describeContents

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of[writeToParcel(android.os.Parcel, int)](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)), the return value of this method must include the[CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR)bit.

<br />

|                                                                                                                         Returns                                                                                                                         ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either`0`or[CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR) <br /> |

### getAppIntent

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public PendingIntent getAppIntent ()
```

<br />

<br />

|                                                                                                                                                          Returns                                                                                                                                                           ||
|------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PendingIntent](https://developer.android.com/reference/android/app/PendingIntent) | a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent)linking to an Activity for the[Control](https://developer.android.com/reference/android/service/controls/Control)This value cannot be`null`. <br /> |

### getControlId

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public String getControlId ()
```

<br />

<br />

|                                                                                                     Returns                                                                                                     ||
|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the identifier for the[Control](https://developer.android.com/reference/android/service/controls/Control)This value cannot be`null`. <br /> |

### getControlTemplate

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public ControlTemplate getControlTemplate ()
```

<br />

<br />

|                                                                                                                                                                                                                    Returns                                                                                                                                                                                                                     ||
|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ControlTemplate](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate) | instance of[ControlTemplate](https://developer.android.com/reference/android/service/controls/templates/ControlTemplate), that defines how the[Control](https://developer.android.com/reference/android/service/controls/Control)will behave and what interactions are available to the user This value cannot be`null`. <br /> |

### getCustomColor

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public ColorStateList getCustomColor ()
```

Optional color to be shown with the[Control](https://developer.android.com/reference/android/service/controls/Control). It is highly recommended to let the system default the color unless the default is not suitable for the application.

<br />

|                                                                        Returns                                                                        ||
|----------------------------------------------------------------------------------------------|---------------------------------------------------------|
| [ColorStateList](https://developer.android.com/reference/android/content/res/ColorStateList) | background color to use This value may be`null`. <br /> |

### getCustomIcon

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Icon getCustomIcon ()
```

Optional icon to be shown with the[Control](https://developer.android.com/reference/android/service/controls/Control). It is highly recommended to let the system default the icon unless the default icon is not suitable.

<br />

|                                                           Returns                                                            ||
|--------------------------------------------------------------------------------|----------------------------------------------|
| [Icon](https://developer.android.com/reference/android/graphics/drawable/Icon) | icon to show This value may be`null`. <br /> |

### getDeviceType

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getDeviceType ()
```

<br />

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Returns                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | type of device represented by this[Control](https://developer.android.com/reference/android/service/controls/Control), used to determine the default icon and color Value is[DeviceTypes.TYPE_GENERIC_ON_OFF](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_GENERIC_ON_OFF),[DeviceTypes.TYPE_GENERIC_START_STOP](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_GENERIC_START_STOP),[DeviceTypes.TYPE_GENERIC_OPEN_CLOSE](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_GENERIC_OPEN_CLOSE),[DeviceTypes.TYPE_GENERIC_LOCK_UNLOCK](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_GENERIC_LOCK_UNLOCK),[DeviceTypes.TYPE_GENERIC_ARM_DISARM](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_GENERIC_ARM_DISARM),[DeviceTypes.TYPE_GENERIC_TEMP_SETTING](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_GENERIC_TEMP_SETTING),[DeviceTypes.TYPE_GENERIC_VIEWSTREAM](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_GENERIC_VIEWSTREAM),[DeviceTypes.TYPE_UNKNOWN](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_UNKNOWN),[DeviceTypes.TYPE_AC_HEATER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_AC_HEATER),[DeviceTypes.TYPE_AC_UNIT](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_AC_UNIT),[DeviceTypes.TYPE_AIR_FRESHENER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_AIR_FRESHENER),[DeviceTypes.TYPE_AIR_PURIFIER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_AIR_PURIFIER),[DeviceTypes.TYPE_COFFEE_MAKER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_COFFEE_MAKER),[DeviceTypes.TYPE_DEHUMIDIFIER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_DEHUMIDIFIER),[DeviceTypes.TYPE_DISPLAY](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_DISPLAY),[DeviceTypes.TYPE_FAN](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_FAN),[DeviceTypes.TYPE_HOOD](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_HOOD),[DeviceTypes.TYPE_HUMIDIFIER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_HUMIDIFIER),[DeviceTypes.TYPE_KETTLE](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_KETTLE),[DeviceTypes.TYPE_LIGHT](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_LIGHT),[DeviceTypes.TYPE_MICROWAVE](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_MICROWAVE),[DeviceTypes.TYPE_OUTLET](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_OUTLET),[DeviceTypes.TYPE_RADIATOR](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_RADIATOR),[DeviceTypes.TYPE_REMOTE_CONTROL](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_REMOTE_CONTROL),[DeviceTypes.TYPE_SET_TOP](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_SET_TOP),[DeviceTypes.TYPE_STANDMIXER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_STANDMIXER),[DeviceTypes.TYPE_STYLER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_STYLER),[DeviceTypes.TYPE_SWITCH](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_SWITCH),[DeviceTypes.TYPE_TV](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_TV),[DeviceTypes.TYPE_WATER_HEATER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_WATER_HEATER),[DeviceTypes.TYPE_DISHWASHER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_DISHWASHER),[DeviceTypes.TYPE_DRYER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_DRYER),[DeviceTypes.TYPE_MOP](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_MOP),[DeviceTypes.TYPE_MOWER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_MOWER),[DeviceTypes.TYPE_MULTICOOKER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_MULTICOOKER),[DeviceTypes.TYPE_SHOWER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_SHOWER),[DeviceTypes.TYPE_SPRINKLER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_SPRINKLER),[DeviceTypes.TYPE_WASHER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_WASHER),[DeviceTypes.TYPE_VACUUM](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_VACUUM),[DeviceTypes.TYPE_AWNING](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_AWNING),[DeviceTypes.TYPE_BLINDS](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_BLINDS),[DeviceTypes.TYPE_CLOSET](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_CLOSET),[DeviceTypes.TYPE_CURTAIN](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_CURTAIN),[DeviceTypes.TYPE_DOOR](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_DOOR),[DeviceTypes.TYPE_DRAWER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_DRAWER),[DeviceTypes.TYPE_GARAGE](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_GARAGE),[DeviceTypes.TYPE_GATE](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_GATE),[DeviceTypes.TYPE_PERGOLA](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_PERGOLA),[DeviceTypes.TYPE_SHUTTER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_SHUTTER),[DeviceTypes.TYPE_WINDOW](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_WINDOW),[DeviceTypes.TYPE_VALVE](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_VALVE),[DeviceTypes.TYPE_LOCK](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_LOCK),[DeviceTypes.TYPE_SECURITY_SYSTEM](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_SECURITY_SYSTEM),[DeviceTypes.TYPE_HEATER](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_HEATER),[DeviceTypes.TYPE_REFRIGERATOR](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_REFRIGERATOR),[DeviceTypes.TYPE_THERMOSTAT](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_THERMOSTAT),[DeviceTypes.TYPE_CAMERA](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_CAMERA),[DeviceTypes.TYPE_DOORBELL](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_DOORBELL), or[DeviceTypes.TYPE_ROUTINE](https://developer.android.com/reference/android/service/controls/DeviceTypes#TYPE_ROUTINE) <br /> |

### getStatus

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getStatus ()
```

<br />

<br />

|                                                                                                                                                                                                                                                                                                                                                                   Returns                                                                                                                                                                                                                                                                                                                                                                    ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | status of the[Control](https://developer.android.com/reference/android/service/controls/Control), used to convey information about the attempt to fetch the current state Value is[STATUS_UNKNOWN](https://developer.android.com/reference/android/service/controls/Control#STATUS_UNKNOWN),[STATUS_OK](https://developer.android.com/reference/android/service/controls/Control#STATUS_OK),[STATUS_NOT_FOUND](https://developer.android.com/reference/android/service/controls/Control#STATUS_NOT_FOUND),[STATUS_ERROR](https://developer.android.com/reference/android/service/controls/Control#STATUS_ERROR), or[STATUS_DISABLED](https://developer.android.com/reference/android/service/controls/Control#STATUS_DISABLED) <br /> |

### getStatusText

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public CharSequence getStatusText ()
```

<br />

<br />

|                                                                                                                                     Returns                                                                                                                                      ||
|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CharSequence](https://developer.android.com/reference/java/lang/CharSequence) | user-facing text description of the[Control](https://developer.android.com/reference/android/service/controls/Control)'s status, describing its current state This value cannot be`null`. <br /> |

### getStructure

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public CharSequence getStructure ()
```

Optional top-level group to help define the[Control](https://developer.android.com/reference/android/service/controls/Control)'s location, visible to the user. If not present, the application name will be used as the top-level group. A structure contains zones which contains controls.

<br />

|                                                                           Returns                                                                            ||
|--------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| [CharSequence](https://developer.android.com/reference/java/lang/CharSequence) | name of the structure containing the control This value may be`null`. <br /> |

### getSubtitle

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public CharSequence getSubtitle ()
```

<br />

<br />

|                                                                                                                                Returns                                                                                                                                 ||
|--------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CharSequence](https://developer.android.com/reference/java/lang/CharSequence) | additional information about the[Control](https://developer.android.com/reference/android/service/controls/Control), to appear underneath the title This value cannot be`null`. <br /> |

### getTitle

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public CharSequence getTitle ()
```

<br />

<br />

|                                                                                                             Returns                                                                                                              ||
|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| [CharSequence](https://developer.android.com/reference/java/lang/CharSequence) | the user facing name of the[Control](https://developer.android.com/reference/android/service/controls/Control)This value cannot be`null`. <br /> |

### getZone

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public CharSequence getZone ()
```

Optional group name to help define the[Control](https://developer.android.com/reference/android/service/controls/Control)'s location within a structure, visible to the user. A structure contains zones which contains controls.

<br />

|                                                                         Returns                                                                         ||
|--------------------------------------------------------------------------------|-------------------------------------------------------------------------|
| [CharSequence](https://developer.android.com/reference/java/lang/CharSequence) | name of the zone containing the control This value may be`null`. <br /> |

### isAuthRequired

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isAuthRequired ()
```

<br />

<br />

|                                            Returns                                            ||
|-----------|------------------------------------------------------------------------------------|
| `boolean` | true if the control can not be interacted with until the device is unlocked <br /> |

### writeToParcel

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

|                                                                                                                                                                                                                               Parameters                                                                                                                                                                                                                                ||
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | `Parcel`: This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or[Parcelable.PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE). Value is either`0`or a combination of[Parcelable.PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES <br /> |