# CarPowerPolicy

Summary:[Inherited Constants](https://developer.android.com/reference/android/car/hardware/power/CarPowerPolicy#inhconstants)\|[Fields](https://developer.android.com/reference/android/car/hardware/power/CarPowerPolicy#lfields)\|[Methods](https://developer.android.com/reference/android/car/hardware/power/CarPowerPolicy#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/car/hardware/power/CarPowerPolicy#inhmethods)  

# CarPowerPolicy

`
public

final

class
CarPowerPolicy
`  
`

extends Object


``


implements

Parcelable


`

|---|-------------------------------------------|
| java.lang.Object                             ||
| ↳ | android.car.hardware.power.CarPowerPolicy |

<br />

*** ** * ** ***

Car power policy definition.

## Summary

|                                                                                                                                                                 ### Inherited constants                                                                                                                                                                 |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface`android.os.Parcelable` |-------|----------------------------------------| | `int` | `CONTENTS_FILE_DESCRIPTOR` <br />      | | `int` | `PARCELABLE_ELIDE_DUPLICATES` <br />   | | `int` | `PARCELABLE_STABILITY_LOCAL` <br />    | | `int` | `PARCELABLE_STABILITY_VINTF` <br />    | | `int` | `PARCELABLE_WRITE_RETURN_VALUE` <br /> | |

|                                                                                                                     ### Fields                                                                                                                     ||
|---------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| ` public static final Creator<`[CarPowerPolicy](https://developer.android.com/reference/android/car/hardware/power/CarPowerPolicy)`>` | [CREATOR](https://developer.android.com/reference/android/car/hardware/power/CarPowerPolicy#CREATOR) <br /> |

|                                                                                                          ### Public methods                                                                                                          ||
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`     | ` `[describeContents](https://developer.android.com/reference/android/car/hardware/power/CarPowerPolicy#describeContents())`() `                                                                                         |
| ` int[]`   | ` `[getDisabledComponents](https://developer.android.com/reference/android/car/hardware/power/CarPowerPolicy#getDisabledComponents())`() ` List of disabled componentst.                                                 |
| ` int[]`   | ` `[getEnabledComponents](https://developer.android.com/reference/android/car/hardware/power/CarPowerPolicy#getEnabledComponents())`() ` List of enabled componentst.                                                    |
| ` String`  | ` `[getPolicyId](https://developer.android.com/reference/android/car/hardware/power/CarPowerPolicy#getPolicyId())`() ` ID of power policy.                                                                               |
| ` boolean` | ` `[isComponentEnabled](https://developer.android.com/reference/android/car/hardware/power/CarPowerPolicy#isComponentEnabled(int))`(int component) ` Returns`true`if the given component is enabled in the power policy. |
| ` String`  | ` `[toString](https://developer.android.com/reference/android/car/hardware/power/CarPowerPolicy#toString())`() `                                                                                                         |
| ` void`    | ` `[writeToParcel](https://developer.android.com/reference/android/car/hardware/power/CarPowerPolicy#writeToParcel(android.os.Parcel,%20int))`(Parcel dest, int flags) `                                                 |

| ### 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() `                    | ||
| From interface` android.os.Parcelable ` |------------------|------------------------------------------| | ` abstract int`  | ` describeContents() `                   | | ` default int`   | ` getStability() `                       | | ` abstract void` | ` writeToParcel(Parcel arg0, int arg1) ` | ||

## Fields

### CREATOR

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

<br />

<br />

## Public methods

### describeContents

```
public int describeContents ()
```

<br />

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### getDisabledComponents

```
public int[] getDisabledComponents ()
```

List of disabled componentst. Components are one of`android.frameworks.automotive.powerpolicy.PowerComponent`.

<br />

|     Returns     ||
|---------|--------|
| `int[]` | <br /> |

### getEnabledComponents

```
public int[] getEnabledComponents ()
```

List of enabled componentst. Components are one of`android.frameworks.automotive.powerpolicy.PowerComponent`.

<br />

|     Returns     ||
|---------|--------|
| `int[]` | <br /> |

### getPolicyId

```
public String getPolicyId ()
```

ID of power policy.

<br />

|     Returns      ||
|----------|--------|
| `String` | <br /> |

### isComponentEnabled

```
public boolean isComponentEnabled (int component)
```

Returns`true`if the given component is enabled in the power policy. Otherwise,`false`.

<br />

|        Parameters         ||
|-------------|--------------|
| `component` | `int` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### toString

```
public String toString ()
```

<br />

<br />

|     Returns      ||
|----------|--------|
| `String` | <br /> |

### writeToParcel

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

<br />

<br />

|        Parameters        ||
|---------|-----------------|
| `dest`  | `Parcel` <br /> |
| `flags` | `int` <br />    |