# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Nested Classes | Constants | Inherited Constants | Fields | Methods | Inherited Methods

# Control

`public final class Control`
`extends Object` `implements Parcelable`

java.lang.Object
↳ | android.service.controls.Control

Represents a physical object that can be represented by a `ControlTemplate` and whose properties may be modified through a `ControlAction`. The information is provided by a `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` 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` and will be used to display the control as well as group them for management.

Each object will have an associated `DeviceTypes.DeviceType`. This will determine the icons and colors used to display it.

An `Intent` linking to the provider Activity that expands on this `Control` and allows for further actions should be provided.

## Summary

### Nested classes
`class` | `Control.StatefulBuilder` Builder class for `Control` that contains state information.
`class` | `Control.StatelessBuilder` Builder class for `Control`.

### Constants
`int` | `STATUS_DISABLED` The `Control` is currently disabled.
`int` | `STATUS_ERROR` Used to indicate that there was a temporary error while loading the device state.
`int` | `STATUS_NOT_FOUND` The device corresponding to the `Control` cannot be found or was removed.
`int` | `STATUS_OK` Used to indicate that the state of the device was successfully retrieved.
`int` | `STATUS_UNKNOWN` Reserved for use with the `StatelessBuilder`, and while loading.

### Inherited constants
From interface `android.os.Parcelable`
`int` | `CONTENTS_FILE_DESCRIPTOR` Descriptor bit used with `describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` | `PARCELABLE_WRITE_RETURN_VALUE` Flag for use with `writeToParcel(Parcel, int)`: 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<Control>` | `CREATOR`

### Public methods
`int` | `describeContents()` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
`PendingIntent` | `getAppIntent()`
`String` | `getControlId()`
`ControlTemplate` | `getControlTemplate()`
`ColorStateList` | `getCustomColor()` Optional color to be shown with the `Control`.
`Icon` | `getCustomIcon()` Optional icon to be shown with the `Control`.
`int` | `getDeviceType()`
`int` | `getStatus()`
`CharSequence` | `getStatusText()`
`CharSequence` | `getStructure()` Optional top-level group to help define the `Control`'s location, visible to the user.
`CharSequence` | `getSubtitle()`
`CharSequence` | `getTitle()`
`CharSequence` | `getZone()` Optional group name to help define the `Control`'s location within a structure, visible to the user.
`void` | `writeToParcel(Parcel dest, int flags)` Flatten this object in to a Parcel.

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

## Constants

### STATUS_DISABLED

    public static final int STATUS_DISABLED

The `Control` is currently disabled. A default error message will be displayed in place of any custom text that was set through `StatefulBuilder#setStatusText`.

Constant Value: 4 (0x00000004)

### STATUS_ERROR

    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`.

Constant Value: 3 (0x00000003)

### STATUS_NOT_FOUND

    public static final int STATUS_NOT_FOUND

The device corresponding to the `Control` cannot be found or was removed. The user will be alerted and directed to the application to resolve.

Constant Value: 2 (0x00000002)

### STATUS_OK

    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`.

Constant Value: 1 (0x00000001)

### STATUS_UNKNOWN

    public static final int STATUS_UNKNOWN

Reserved for use with the `StatelessBuilder`, and while loading. When state is requested via `ControlsProviderService#createPublisherFor`, use other status codes to indicate the proper device state.

Constant Value: 0 (0x00000000)

## Fields

### CREATOR

    public static final Creator<Control> CREATOR

## Public methods

### describeContents

    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)`, the return value of this method must include the `CONTENTS_FILE_DESCRIPTOR` bit.

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`

### getAppIntent

    public PendingIntent getAppIntent ()

Returns
`PendingIntent` | a `PendingIntent` linking to an Activity for the `Control` This value cannot be `null`.

### getControlId

    public String getControlId ()

Returns
`String` | the identifier for the `Control` This value cannot be `null`.

### getControlTemplate

    public ControlTemplate getControlTemplate ()

Returns
`ControlTemplate` | instance of `ControlTemplate`, that defines how the `Control` will behave and what interactions are available to the user This value cannot be `null`.

### getCustomColor

    public ColorStateList getCustomColor ()

Optional color to be shown with the `Control`. It is highly recommended to let the system default the color unless the default is not suitable for the application.

Returns
`ColorStateList` | background color to use This value may be `null`.

### getCustomIcon

    public Icon getCustomIcon ()

Optional icon to be shown with the `Control`. It is highly recommended to let the system default the icon unless the default icon is not suitable.

Returns
`Icon` | icon to show This value may be `null`.

### getDeviceType

    public int getDeviceType ()

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

### getStatus

    public int getStatus ()

Returns
`int` | status of the `Control`, used to convey information about the attempt to fetch the current state Value is `STATUS_UNKNOWN`, `STATUS_OK`, `STATUS_NOT_FOUND`, `STATUS_ERROR`, or `STATUS_DISABLED`

### getStatusText

    public CharSequence getStatusText ()

Returns
`CharSequence` | user-facing text description of the `Control`'s status, describing its current state This value cannot be `null`.

### getStructure

    public CharSequence getStructure ()

Optional top-level group to help define the `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.

Returns
`CharSequence` | name of the structure containing the control This value may be `null`.

### getSubtitle

    public CharSequence getSubtitle ()

Returns
`CharSequence` | additional information about the `Control`, to appear underneath the title This value cannot be `null`.

### getTitle

    public CharSequence getTitle ()

Returns
`CharSequence` | the user facing name of the `Control` This value cannot be `null`.

### getZone

    public CharSequence getZone ()

Optional group name to help define the `Control`'s location within a structure, visible to the user. A structure contains zones which contains controls.

Returns
`CharSequence` | name of the zone containing the control This value may be `null`.

### writeToParcel

    public void writeToParcel (Parcel dest,
                    int flags)

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.PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of `Parcelable.PARCELABLE_WRITE_RETURN_VALUE`, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*