# AmbientBacklightSettings

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#constants)\|[Inherited Constants](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#inhconstants)\|[Fields](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#lfields)\|[Ctors](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#pubctors)\|[Methods](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#inhmethods)  

# AmbientBacklightSettings

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/media/quality/AmbientBacklightSettings "View this page in Kotlin")\|Java

`
public

final

class
AmbientBacklightSettings
`  
`

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.media.quality.AmbientBacklightSettings |

<br />

*** ** * ** ***

Settings to configure ambient backlight hardware.

## Summary

|                                                                                    ### Constants                                                                                     ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [SOURCE_AUDIO](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_AUDIO) The detection is enabled for audio.                       |
| `int` | [SOURCE_AUDIO_VIDEO](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_AUDIO_VIDEO) The detection is enabled for audio and video. |
| `int` | [SOURCE_NONE](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_NONE) The detection is disabled.                                  |
| `int` | [SOURCE_VIDEO](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_VIDEO) The detection is enabled for video.                       |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### 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)`<`[AmbientBacklightSettings](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings)`>` | [CREATOR](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#CREATOR) <br /> |

|                                                                                                                                                                               ### Public constructors                                                                                                                                                                                ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[AmbientBacklightSettings](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#AmbientBacklightSettings(int,%20int,%20int,%20int,%20int,%20boolean,%20int))`(int source, int maxFps, int colorFormat, int horizontalZonesNumber, int verticalZonesNumber, boolean isLetterboxOmitted, int threshold) ` Constructs AmbientBacklightSettings. |

|                                                                                                                                                                   ### Public methods                                                                                                                                                                    ||
|-----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`                                                                | ` `[describeContents](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#describeContents())`() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.                                    |
| ` int`                                                                | ` `[getColorFormat](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#getColorFormat())`() ` Gets color format.                                                                                                                             |
| ` int`                                                                | ` `[getHorizontalZonesCount](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#getHorizontalZonesCount())`() ` Gets the number of horizontal color zones.                                                                                   |
| ` int`                                                                | ` `[getMaxFps](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#getMaxFps())`() ` Gets max frames per second.                                                                                                                              |
| ` int`                                                                | ` `[getSource](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#getSource())`() ` Gets source of ambient backlight detection.                                                                                                              |
| ` int`                                                                | ` `[getThreshold](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#getThreshold())`() ` Gets the detection threshold of the ambient light.                                                                                                 |
| ` int`                                                                | ` `[getVerticalZonesCount](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#getVerticalZonesCount())`() ` Gets the number of vertical color zones.                                                                                         |
| ` boolean`                                                            | ` `[isLetterboxOmitted](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#isLetterboxOmitted())`() ` Returns`true`if the black portion of the screen in letter box mode is omitted;`false`otherwise.                                        |
| ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[toString](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#toString())`() ` Returns a string representation of the object.                                                                                                             |
| ` void`                                                               | ` `[writeToParcel](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#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

### SOURCE_AUDIO

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

```
public static final int SOURCE_AUDIO
```

The detection is enabled for audio.

<br />

Constant Value: 1 (0x00000001)  

### SOURCE_AUDIO_VIDEO

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

```
public static final int SOURCE_AUDIO_VIDEO
```

The detection is enabled for audio and video.

<br />

Constant Value: 3 (0x00000003)  

### SOURCE_NONE

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

```
public static final int SOURCE_NONE
```

The detection is disabled.

<br />

Constant Value: 0 (0x00000000)  

### SOURCE_VIDEO

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

```
public static final int SOURCE_VIDEO
```

The detection is enabled for video.

<br />

Constant Value: 2 (0x00000002)

## Fields

### CREATOR

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

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

<br />

<br />

## Public constructors

### AmbientBacklightSettings

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

```
public AmbientBacklightSettings (int source, 
                int maxFps, 
                int colorFormat, 
                int horizontalZonesNumber, 
                int verticalZonesNumber, 
                boolean isLetterboxOmitted, 
                int threshold)
```

Constructs AmbientBacklightSettings.

<br />

|                                                                                                                                                                                                                                                                                                                                                           Parameters                                                                                                                                                                                                                                                                                                                                                            ||
|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `source`                | `int`: Value is[SOURCE_NONE](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_NONE),[SOURCE_AUDIO](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_AUDIO),[SOURCE_VIDEO](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_VIDEO), or[SOURCE_AUDIO_VIDEO](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_AUDIO_VIDEO) <br />                                                                                                                                                                                     |
| `maxFps`                | `int` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `colorFormat`           | `int`: Value is[PixelFormat.RGBA_8888](https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_8888),[PixelFormat.RGBX_8888](https://developer.android.com/reference/android/graphics/PixelFormat#RGBX_8888),[PixelFormat.RGBA_F16](https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_F16),[PixelFormat.RGBA_1010102](https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_1010102),[PixelFormat.RGB_888](https://developer.android.com/reference/android/graphics/PixelFormat#RGB_888),[PixelFormat.RGB_565](https://developer.android.com/reference/android/graphics/PixelFormat#RGB_565), or android.graphics.PixelFormat.R_8 <br /> |
| `horizontalZonesNumber` | `int` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `verticalZonesNumber`   | `int` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `isLetterboxOmitted`    | `boolean` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `threshold`             | `int` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

## Public methods

### describeContents

Added in[API level 36](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 /> |

### getColorFormat

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

```
public int getColorFormat ()
```

Gets color format.

<br />

|                                                                                                                                                                                                                                                                                                                                                Returns                                                                                                                                                                                                                                                                                                                                                 ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is[PixelFormat.RGBA_8888](https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_8888),[PixelFormat.RGBX_8888](https://developer.android.com/reference/android/graphics/PixelFormat#RGBX_8888),[PixelFormat.RGBA_F16](https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_F16),[PixelFormat.RGBA_1010102](https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_1010102),[PixelFormat.RGB_888](https://developer.android.com/reference/android/graphics/PixelFormat#RGB_888),[PixelFormat.RGB_565](https://developer.android.com/reference/android/graphics/PixelFormat#RGB_565), or android.graphics.PixelFormat.R_8 <br /> |

### getHorizontalZonesCount

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

```
public int getHorizontalZonesCount ()
```

Gets the number of horizontal color zones.

A color zone is a group of lights that always display the same color.

<br />

|               Returns               ||
|-------|------------------------------|
| `int` | Value is 0 or greater <br /> |

### getMaxFps

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

```
public int getMaxFps ()
```

Gets max frames per second.

<br />

|               Returns               ||
|-------|------------------------------|
| `int` | Value is 1 or greater <br /> |

### getSource

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

```
public int getSource ()
```

Gets source of ambient backlight detection.

<br />

|                                                                                                                                                                                                                                                      Returns                                                                                                                                                                                                                                                       ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is[SOURCE_NONE](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_NONE),[SOURCE_AUDIO](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_AUDIO),[SOURCE_VIDEO](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_VIDEO), or[SOURCE_AUDIO_VIDEO](https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_AUDIO_VIDEO) <br /> |

### getThreshold

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

```
public int getThreshold ()
```

Gets the detection threshold of the ambient light.

If the color of a color zone is changed but the difference is smaller than the threshold, the change is ignored.

<br />

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

### getVerticalZonesCount

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

```
public int getVerticalZonesCount ()
```

Gets the number of vertical color zones.

A color zone is a group of lights that always display the same color.

<br />

|               Returns               ||
|-------|------------------------------|
| `int` | Value is 0 or greater <br /> |

### isLetterboxOmitted

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

```
public boolean isLetterboxOmitted ()
```

Returns`true`if the black portion of the screen in letter box mode is omitted;`false`otherwise.

Letter-box is a technique to keep the original aspect ratio when displayed on a screen with different aspect ratio. Black bars are added to the top and bottom.

<br />

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

### toString

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

```
public String toString ()
```

Returns a string representation of the object.

<br />

|                                                      Returns                                                      ||
|--------------------------------------------------------------------|-----------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | a string representation of the object. <br /> |

### writeToParcel

Added in[API level 36](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`: The Parcel in which the object should be written. 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 /> |