Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder#inhmethods)

# ZenDeviceEffects.Builder

*** ** * ** ***

` public static final class ZenDeviceEffects.Builder `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.service.notification.ZenDeviceEffects.Builder |

<br />

*** ** * ** ***

Builder class for `https://developer.android.com/reference/android/service/notification/ZenDeviceEffects` objects.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder#Builder()() ` Instantiates a new `https://developer.android.com/reference/android/service/notification/ZenPolicy.Builder` with all effects set to default (disabled). |
| ` https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder#Builder(android.service.notification.ZenDeviceEffects)(https://developer.android.com/reference/android/service/notification/ZenDeviceEffects zenDeviceEffects) ` Instantiates a new `https://developer.android.com/reference/android/service/notification/ZenPolicy.Builder` with all effects set to their corresponding values in the supplied `https://developer.android.com/reference/android/service/notification/ZenDeviceEffects`. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/service/notification/ZenDeviceEffects` | ` https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder#build()() ` Builds a `https://developer.android.com/reference/android/service/notification/ZenDeviceEffects` object based on the builder's state. |
| ` https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder` | ` https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder#setShouldDimWallpaper(boolean)(boolean dimWallpaper) ` Sets whether the wallpaper should be dimmed while the rule is active. |
| ` https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder` | ` https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder#setShouldDisplayGrayscale(boolean)(boolean grayscale) ` Sets whether the level of color saturation of the display should be set to minimum, effectively switching it to grayscale, while the rule is active. |
| ` https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder` | ` https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder#setShouldSuppressAmbientDisplay(boolean)(boolean suppressAmbientDisplay) ` Sets whether the ambient (always-on) display feature should be disabled while the rule is active. |
| ` https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder` | ` https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder#setShouldUseNightMode(boolean)(boolean nightMode) ` Sets whether night mode (aka dark theme) should be applied while the rule is active. |

### 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*.

## Public constructors

### Builder

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

```
public Builder ()
```

Instantiates a new `https://developer.android.com/reference/android/service/notification/ZenPolicy.Builder` with all effects set to default (disabled).

<br />

### Builder

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

```
public Builder (ZenDeviceEffects zenDeviceEffects)
```

Instantiates a new `https://developer.android.com/reference/android/service/notification/ZenPolicy.Builder` with all effects set to their corresponding values in the supplied `https://developer.android.com/reference/android/service/notification/ZenDeviceEffects`.

<br />

| Parameters ||
|---|---|
| `zenDeviceEffects` | `ZenDeviceEffects`: This value cannot be `null`. <br /> |

## Public methods

### build

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

```
public ZenDeviceEffects build ()
```

Builds a `https://developer.android.com/reference/android/service/notification/ZenDeviceEffects` object based on the builder's state.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/service/notification/ZenDeviceEffects` | This value cannot be `null`. <br /> |

### setShouldDimWallpaper

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

```
public ZenDeviceEffects.Builder setShouldDimWallpaper (boolean dimWallpaper)
```

Sets whether the wallpaper should be dimmed while the rule is active.

<br />

| Parameters ||
|---|---|
| `dimWallpaper` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder` | This value cannot be `null`. <br /> |

### setShouldDisplayGrayscale

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

```
public ZenDeviceEffects.Builder setShouldDisplayGrayscale (boolean grayscale)
```

Sets whether the level of color saturation of the display should be set to minimum, effectively switching it to grayscale, while the rule is active.

<br />

| Parameters ||
|---|---|
| `grayscale` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder` | This value cannot be `null`. <br /> |

### setShouldSuppressAmbientDisplay

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

```
public ZenDeviceEffects.Builder setShouldSuppressAmbientDisplay (boolean suppressAmbientDisplay)
```

Sets whether the ambient (always-on) display feature should be disabled while the rule is active. This will have no effect if the device doesn't support always-on display or if it's not generally enabled.

<br />

| Parameters ||
|---|---|
| `suppressAmbientDisplay` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder` | This value cannot be `null`. <br /> |

### setShouldUseNightMode

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

```
public ZenDeviceEffects.Builder setShouldUseNightMode (boolean nightMode)
```

Sets whether night mode (aka dark theme) should be applied while the rule is active.

<br />

| Parameters ||
|---|---|
| `nightMode` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/service/notification/ZenDeviceEffects.Builder` | This value cannot be `null`. <br /> |