# Subscription

Summary:[Nested Classes](https://developer.android.com/reference/android/car/hardware/property/Subscription#nestedclasses)\|[Methods](https://developer.android.com/reference/android/car/hardware/property/Subscription#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/car/hardware/property/Subscription#inhmethods)  

# Subscription

`
public

final

class
Subscription
`  
`

extends Object


``


`

|---|--------------------------------------------|
| java.lang.Object                              ||
| ↳ | android.car.hardware.property.Subscription |

<br />

*** ** * ** ***

Represents the subscription data to[CarPropertyManager.subscribePropertyEvents](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#subscribePropertyEvents(int,%20android.car.hardware.property.CarPropertyManager.CarPropertyEventCallback)). To create a Subscription use Subscription.Builder.

## Summary

|                                                                  ### Nested classes                                                                   ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [Subscription.Builder](https://developer.android.com/reference/android/car/hardware/property/Subscription.Builder) Builder for Subscription |

|                                                                                                                                                         ### Public methods                                                                                                                                                          ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int[]`   | ` `[getAreaIds](https://developer.android.com/reference/android/car/hardware/property/Subscription#getAreaIds())`() ` Gets all the areaIds added in the Subscription.Builder object.                                                                                                                                    |
| ` int`     | ` `[getPropertyId](https://developer.android.com/reference/android/car/hardware/property/Subscription#getPropertyId())`() ` Gets the propertyId set in the Subscription.Builder object.                                                                                                                                 |
| ` float`   | ` `[getResolution](https://developer.android.com/reference/android/car/hardware/property/Subscription#getResolution())`() ` Gets the resolution set in the Subscription.Builder object.                                                                                                                                 |
| ` float`   | ` `[getUpdateRateFast](https://developer.android.com/reference/android/car/hardware/property/Subscription#getUpdateRateFast())`() ` Gets the[CarPropertyManager.SENSOR_RATE_FAST](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#SENSOR_RATE_FAST)which is 10hz.              |
| ` float`   | ` `[getUpdateRateFastest](https://developer.android.com/reference/android/car/hardware/property/Subscription#getUpdateRateFastest())`() ` Gets the[CarPropertyManager.SENSOR_RATE_FASTEST](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#SENSOR_RATE_FASTEST)which is 100hz. |
| ` float`   | ` `[getUpdateRateHz](https://developer.android.com/reference/android/car/hardware/property/Subscription#getUpdateRateHz())`() ` Gets the updateRateHz set in the Subscription.Builder object.                                                                                                                           |
| ` float`   | ` `[getUpdateRateNormal](https://developer.android.com/reference/android/car/hardware/property/Subscription#getUpdateRateNormal())`() ` Gets the[CarPropertyManager.SENSOR_RATE_NORMAL](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#SENSOR_RATE_NORMAL)which is 1hz.       |
| ` float`   | ` `[getUpdateRateUi](https://developer.android.com/reference/android/car/hardware/property/Subscription#getUpdateRateUi())`() ` Gets the[CarPropertyManager.SENSOR_RATE_UI](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#SENSOR_RATE_UI)which is 5hz.                       |
| ` boolean` | ` `[isVariableUpdateRateEnabled](https://developer.android.com/reference/android/car/hardware/property/Subscription#isVariableUpdateRateEnabled())`() ` Gets the variable update rate enabled boolean set in the Subscription.Builder object.                                                                           |

| ### Inherited methods |
|-----------------------|---|
| From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public methods

### getAreaIds

```
public int[] getAreaIds ()
```

Gets all the areaIds added in the Subscription.Builder object. This will return an empty array if no particular areaIds were added specifically, which means that the client wants to subscribe to all possible area IDs.

<br />

|                                           Returns                                           ||
|---------|------------------------------------------------------------------------------------|
| `int[]` | The areaIds to subscribe to, empty array means subscribing to all area IDs. <br /> |

### getPropertyId

```
public int getPropertyId ()
```

Gets the propertyId set in the Subscription.Builder object.

<br />

|                   Returns                    ||
|-------|---------------------------------------|
| `int` | The propertyId to subscribe to <br /> |

### getResolution

```
public float getResolution ()
```

Gets the resolution set in the Subscription.Builder object.

<br />

|                    Returns                     ||
|---------|---------------------------------------|
| `float` | the resolution to subscribe to <br /> |

### getUpdateRateFast

```
public float getUpdateRateFast ()
```

Gets the[CarPropertyManager.SENSOR_RATE_FAST](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#SENSOR_RATE_FAST)which is 10hz.

<br />

|                                                                             Returns                                                                              ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| `float` | [CarPropertyManager.SENSOR_RATE_FAST](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#SENSOR_RATE_FAST) <br /> |

### getUpdateRateFastest

```
public float getUpdateRateFastest ()
```

Gets the[CarPropertyManager.SENSOR_RATE_FASTEST](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#SENSOR_RATE_FASTEST)which is 100hz.

<br />

|                                                                                Returns                                                                                 ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `float` | [CarPropertyManager.SENSOR_RATE_FASTEST](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#SENSOR_RATE_FASTEST) <br /> |

### getUpdateRateHz

```
public float getUpdateRateHz ()
```

Gets the updateRateHz set in the Subscription.Builder object.

<br />

|                     Returns                     ||
|---------|----------------------------------------|
| `float` | The update rate to subscribe to <br /> |

### getUpdateRateNormal

```
public float getUpdateRateNormal ()
```

Gets the[CarPropertyManager.SENSOR_RATE_NORMAL](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#SENSOR_RATE_NORMAL)which is 1hz.

<br />

|                                                                               Returns                                                                                ||
|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `float` | [CarPropertyManager.SENSOR_RATE_NORMAL](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#SENSOR_RATE_NORMAL) <br /> |

### getUpdateRateUi

```
public float getUpdateRateUi ()
```

Gets the[CarPropertyManager.SENSOR_RATE_UI](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#SENSOR_RATE_UI)which is 5hz.

<br />

|                                                                           Returns                                                                            ||
|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `float` | [CarPropertyManager.SENSOR_RATE_UI](https://developer.android.com/reference/android/car/hardware/property/CarPropertyManager#SENSOR_RATE_UI) <br /> |

### isVariableUpdateRateEnabled

```
public boolean isVariableUpdateRateEnabled ()
```

Gets the variable update rate enabled boolean set in the Subscription.Builder object.

<br />

|                          Returns                           ||
|-----------|-------------------------------------------------|
| `boolean` | whether variable update rate is enabled. <br /> |