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/AmbientBacklightMetadata#constants) \| [Inherited Constants](https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#inhconstants) \| [Fields](https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#lfields) \| [Ctors](https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#pubctors) \| [Methods](https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#inhmethods)

# AmbientBacklightMetadata

*** ** * ** ***


`
public

final

class
AmbientBacklightMetadata
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/android/os/Parcelable


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.media.quality.AmbientBacklightMetadata |

<br />

*** ** * ** ***

Metadata of ambient backlight.

A metadata instance is sent from ambient backlight hardware in a `https://developer.android.com/reference/android/media/quality/AmbientBacklightEvent`
with `https://developer.android.com/reference/android/media/quality/AmbientBacklightEvent#AMBIENT_BACKLIGHT_EVENT_METADATA_AVAILABLE`.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#ALGORITHM_NONE` The compress algorithm is disabled. |
| `int` | `https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#ALGORITHM_RLE` The compress algorithm is run length encoding (RLE). |

| ### Inherited constants |
|---|
| From interface `https://developer.android.com/reference/android/os/Parcelable` |---|---| | `int` | `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. | | `int` | `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` Flag for use with `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 https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata>` | `https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#CREATOR` |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#AmbientBacklightMetadata(java.lang.String,%20int,%20int,%20int,%20int,%20int,%20int[])(https://developer.android.com/reference/java/lang/String packageName, int compressAlgorithm, int source, int colorFormat, int horizontalZonesNumber, int verticalZonesNumber, int[] zonesColors) ` Constructs AmbientBacklightMetadata. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` int` | ` https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#getColorFormat()() ` Gets color format. |
| ` int` | ` https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#getCompressionAlgorithm()() ` Gets compress algorithm. |
| ` int` | ` https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#getHorizontalZonesCount()() ` Gets the number of horizontal color zones. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#getPackageName()() ` Gets package name of the metadata. |
| ` int` | ` https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#getSource()() ` Gets source of ambient backlight detection. |
| ` int` | ` https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#getVerticalZonesCount()() ` Gets the number of vertical color zones. |
| ` int[]` | ` https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#getZoneColors()() ` Gets color data of all available color zones. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` 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 https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` 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` | ` 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` | ` 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 ` https://developer.android.com/reference/android/os/Parcelable ` |---|---| | ` abstract int` | ` 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` | ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### ALGORITHM_NONE

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

```
public static final int ALGORITHM_NONE
```

The compress algorithm is disabled.

<br />

Constant Value:

0
(0x00000000)


### ALGORITHM_RLE

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

```
public static final int ALGORITHM_RLE
```

The compress algorithm is run length encoding (RLE).

<br />

Constant Value:

1
(0x00000001)


## Fields

### CREATOR

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

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

<br />

<br />

## Public constructors

### AmbientBacklightMetadata

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

```
public AmbientBacklightMetadata (String packageName, 
                int compressAlgorithm, 
                int source, 
                int colorFormat, 
                int horizontalZonesNumber, 
                int verticalZonesNumber, 
                int[] zonesColors)
```

Constructs AmbientBacklightMetadata.

<br />

| Parameters ||
|---|---|
| `packageName` | `String` <br /> |
| `compressAlgorithm` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#ALGORITHM_NONE` - `https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#ALGORITHM_RLE` |
| `source` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_NONE` - `https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_AUDIO` - `https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_VIDEO` - `https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_AUDIO_VIDEO` |
| `colorFormat` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_8888` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBX_8888` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_F16` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_1010102` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGB_888` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGB_565` |
| `horizontalZonesNumber` | `int` <br /> |
| `verticalZonesNumber` | `int` <br /> |
| `zonesColors` | `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 `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`,
the return value of this method must include the
`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 - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### 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 one of the following: - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_8888` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBX_8888` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_F16` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGBA_1010102` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGB_888` - `https://developer.android.com/reference/android/graphics/PixelFormat#RGB_565` |

### getCompressionAlgorithm

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

```
public int getCompressionAlgorithm ()
```

Gets compress algorithm.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#ALGORITHM_NONE` - `https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#ALGORITHM_RLE` |

### 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 represented by one single aggregated color. The number should not be
larger than 128.

<br />

| Returns ||
|---|---|
| `int` | Value is between 0 and 128 inclusive <br /> |

### getPackageName

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

```
public String getPackageName ()
```

Gets package name of the metadata.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <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 one of the following: - `https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_NONE` - `https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_AUDIO` - `https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_VIDEO` - `https://developer.android.com/reference/android/media/quality/AmbientBacklightSettings#SOURCE_AUDIO_VIDEO` |

### 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 represented by one single aggregated color. The number should not be
larger than 80.

<br />

| Returns ||
|---|---|
| `int` | Value is between 0 and 80 inclusive <br /> |

### getZoneColors

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

```
public int[] getZoneColors ()
```

Gets color data of all available color zones.

The format of the color data can be found at `https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#getColorFormat()`.

<br />

| Returns ||
|---|---|
| `int[]` | an array of color data, in row by row (left-to-right then top-to-bottom) order of the color zones. <br /> |

**See also:**

- `https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#getHorizontalZonesCount()`
- `https://developer.android.com/reference/android/media/quality/AmbientBacklightMetadata#getVerticalZonesCount()`

### 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 ||
|---|---|
| `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 `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |