Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/view/DisplayCutout#nestedclasses) \| [Ctors](https://developer.android.com/reference/android/view/DisplayCutout#pubctors) \| [Methods](https://developer.android.com/reference/android/view/DisplayCutout#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/view/DisplayCutout#inhmethods)

# DisplayCutout

*** ** * ** ***

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

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.DisplayCutout |

<br />

*** ** * ** ***

Represents the area of the display that is not functional for displaying content.

`DisplayCutout` is immutable.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/view/DisplayCutout.Builder` A Builder class to construct a DisplayCutout instance. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/view/DisplayCutout#DisplayCutout(android.graphics.Insets,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Insets safeInsets, https://developer.android.com/reference/android/graphics/Rect boundLeft, https://developer.android.com/reference/android/graphics/Rect boundTop, https://developer.android.com/reference/android/graphics/Rect boundRight, https://developer.android.com/reference/android/graphics/Rect boundBottom) ` Creates a DisplayCutout instance. |
| ` https://developer.android.com/reference/android/view/DisplayCutout#DisplayCutout(android.graphics.Insets,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Insets)(https://developer.android.com/reference/android/graphics/Insets safeInsets, https://developer.android.com/reference/android/graphics/Rect boundLeft, https://developer.android.com/reference/android/graphics/Rect boundTop, https://developer.android.com/reference/android/graphics/Rect boundRight, https://developer.android.com/reference/android/graphics/Rect boundBottom, https://developer.android.com/reference/android/graphics/Insets waterfallInsets) ` Creates a DisplayCutout instance. |
| ` https://developer.android.com/reference/android/view/DisplayCutout#DisplayCutout(android.graphics.Rect,%20java.util.List<android.graphics.Rect>)(https://developer.android.com/reference/android/graphics/Rect safeInsets, https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/Rect> boundingRects) ` *This constructor is deprecated. Use `https://developer.android.com/reference/android/view/DisplayCutout#DisplayCutout(android.graphics.Insets,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Rect)` instead.* |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/view/DisplayCutout#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object o) ` Indicates whether some other object is "equal to" this one. |
| ` https://developer.android.com/reference/android/graphics/Rect` | ` https://developer.android.com/reference/android/view/DisplayCutout#getBoundingRectBottom()() ` Returns a bounding rectangle for a non-functional area on the display which is located on the bottom of the screen. |
| ` https://developer.android.com/reference/android/graphics/Rect` | ` https://developer.android.com/reference/android/view/DisplayCutout#getBoundingRectLeft()() ` Returns a bounding rectangle for a non-functional area on the display which is located on the left of the screen. |
| ` https://developer.android.com/reference/android/graphics/Rect` | ` https://developer.android.com/reference/android/view/DisplayCutout#getBoundingRectRight()() ` Returns a bounding rectangle for a non-functional area on the display which is located on the right of the screen. |
| ` https://developer.android.com/reference/android/graphics/Rect` | ` https://developer.android.com/reference/android/view/DisplayCutout#getBoundingRectTop()() ` Returns a bounding rectangle for a non-functional area on the display which is located on the top of the screen. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/Rect>` | ` https://developer.android.com/reference/android/view/DisplayCutout#getBoundingRects()() ` Returns a list of `Rect`s, each of which is the bounding rectangle for a non-functional area on the display. |
| ` https://developer.android.com/reference/android/graphics/Path` | ` https://developer.android.com/reference/android/view/DisplayCutout#getCutoutPath()() ` Returns a `https://developer.android.com/reference/android/graphics/Path` that contains the cutout paths of all sides on the display. |
| ` int` | ` https://developer.android.com/reference/android/view/DisplayCutout#getSafeInsetBottom()() ` Returns the inset from the bottom which avoids the display cutout in pixels. |
| ` int` | ` https://developer.android.com/reference/android/view/DisplayCutout#getSafeInsetLeft()() ` Returns the inset from the left which avoids the display cutout in pixels. |
| ` int` | ` https://developer.android.com/reference/android/view/DisplayCutout#getSafeInsetRight()() ` Returns the inset from the right which avoids the display cutout in pixels. |
| ` int` | ` https://developer.android.com/reference/android/view/DisplayCutout#getSafeInsetTop()() ` Returns the inset from the top which avoids the display cutout in pixels. |
| ` https://developer.android.com/reference/android/graphics/Insets` | ` https://developer.android.com/reference/android/view/DisplayCutout#getWaterfallInsets()() ` Returns the insets representing the curved areas of a waterfall display. |
| ` int` | ` https://developer.android.com/reference/android/view/DisplayCutout#hashCode()() ` Returns a hash code value for the object. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/view/DisplayCutout#toString()() ` Returns a string representation of the object. |

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

### DisplayCutout

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

```
public DisplayCutout (Insets safeInsets, 
                Rect boundLeft, 
                Rect boundTop, 
                Rect boundRight, 
                Rect boundBottom)
```

Creates a DisplayCutout instance.

Note that this is only useful for tests. For production code, developers should always use a `https://developer.android.com/reference/android/view/DisplayCutout` obtained from the system.

<br />

<br />

| Parameters ||
|---|---|
| `safeInsets` | `Insets`: the insets from each edge which avoid the display cutout as returned by `https://developer.android.com/reference/android/view/DisplayCutout#getSafeInsetTop()` etc. This value cannot be `null`. <br /> |
| `boundLeft` | `Rect`: the left bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0). <br /> |
| `boundTop` | `Rect`: the top bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0). <br /> |
| `boundRight` | `Rect`: the right bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0). <br /> |
| `boundBottom` | `Rect`: the bottom bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0). <br /> |

### DisplayCutout

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

```
public DisplayCutout (Insets safeInsets, 
                Rect boundLeft, 
                Rect boundTop, 
                Rect boundRight, 
                Rect boundBottom, 
                Insets waterfallInsets)
```

Creates a DisplayCutout instance.

Note that this is only useful for tests. For production code, developers should always use a `https://developer.android.com/reference/android/view/DisplayCutout` obtained from the system.

<br />

<br />

| Parameters ||
|---|---|
| `safeInsets` | `Insets`: the insets from each edge which avoid the display cutout as returned by `https://developer.android.com/reference/android/view/DisplayCutout#getSafeInsetTop()` etc. This value cannot be `null`. <br /> |
| `boundLeft` | `Rect`: the left bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0). <br /> |
| `boundTop` | `Rect`: the top bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0). <br /> |
| `boundRight` | `Rect`: the right bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0). <br /> |
| `boundBottom` | `Rect`: the bottom bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0). <br /> |
| `waterfallInsets` | `Insets`: the insets for the curved areas in waterfall display. This value cannot be `null`. <br /> |

### DisplayCutout

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

```
public DisplayCutout (Rect safeInsets, 
                List<Rect> boundingRects)
```

<br />

**This constructor is deprecated.**   

Use `https://developer.android.com/reference/android/view/DisplayCutout#DisplayCutout(android.graphics.Insets,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Rect)` instead.

Creates a DisplayCutout instance.

Note that this is only useful for tests. For production code, developers should always use a `https://developer.android.com/reference/android/view/DisplayCutout` obtained from the system.

<br />

<br />

| Parameters ||
|---|---|
| `safeInsets` | `Rect`: the insets from each edge which avoid the display cutout as returned by `https://developer.android.com/reference/android/view/DisplayCutout#getSafeInsetTop()` etc. This value may be `null`. <br /> |
| `boundingRects` | `List`: the bounding rects of the display cutouts as returned by `https://developer.android.com/reference/android/view/DisplayCutout#getBoundingRects()` ()}. This value may be `null`. <br /> |

## Public methods

### equals

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

```
public boolean equals (Object o)
```

Indicates whether some other object is "equal to" this one.

The `equals` method implements an equivalence relation on non-null object references:

- It is *reflexive*: for any non-null reference value `x`, `x.equals(x)` should return `true`.
- It is *symmetric*: for any non-null reference values `x` and `y`, `x.equals(y)` should return `true` if and only if `y.equals(x)` returns `true`.
- It is *transitive*: for any non-null reference values `x`, `y`, and `z`, if `x.equals(y)` returns `true` and `y.equals(z)` returns `true`, then `x.equals(z)` should return `true`.
- It is *consistent*: for any non-null reference values `x` and `y`, multiple invocations of `x.equals(y)` consistently return `true` or consistently return `false`, provided no information used in `equals` comparisons on the objects is modified.
- For any non-null reference value `x`, `x.equals(null)` should return `false`.

An equivalence relation partitions the elements it operates on into *equivalence classes*; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

<br />

| Parameters ||
|---|---|
| `o` | `Object`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this object is the same as the obj argument; `false` otherwise. <br /> |

### getBoundingRectBottom

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

```
public Rect getBoundingRectBottom ()
```

Returns a bounding rectangle for a non-functional area on the display which is located on the bottom of the screen.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Rect` | bounding rectangle in pixels. In case of no bounding rectangle, an empty rectangle is returned. This value cannot be `null`. <br /> |

### getBoundingRectLeft

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

```
public Rect getBoundingRectLeft ()
```

Returns a bounding rectangle for a non-functional area on the display which is located on the left of the screen.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Rect` | bounding rectangle in pixels. In case of no bounding rectangle, an empty rectangle is returned. This value cannot be `null`. <br /> |

### getBoundingRectRight

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

```
public Rect getBoundingRectRight ()
```

Returns a bounding rectangle for a non-functional area on the display which is located on the right of the screen.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Rect` | bounding rectangle in pixels. In case of no bounding rectangle, an empty rectangle is returned. This value cannot be `null`. <br /> |

### getBoundingRectTop

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

```
public Rect getBoundingRectTop ()
```

Returns a bounding rectangle for a non-functional area on the display which is located on the top of the screen.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Rect` | bounding rectangle in pixels. In case of no bounding rectangle, an empty rectangle is returned. This value cannot be `null`. <br /> |

### getBoundingRects

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

```
public List<Rect> getBoundingRects ()
```

Returns a list of `Rect`s, each of which is the bounding rectangle for a non-functional area on the display. There will be at most one non-functional area per edge of the device.

Note that there is no bounding rectangle for waterfall cutout since it just represents the curved areas of the display but not the non-functional areas.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/Rect>` | a list of bounding `Rect`s, one for each display cutout area. No empty Rect is returned. This value cannot be `null`. <br /> |

### getCutoutPath

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

```
public Path getCutoutPath ()
```

Returns a `https://developer.android.com/reference/android/graphics/Path` that contains the cutout paths of all sides on the display. To get a cutout path for one specific side, apps can intersect the `https://developer.android.com/reference/android/graphics/Path` with the `https://developer.android.com/reference/android/graphics/Rect` obtained from `https://developer.android.com/reference/android/view/DisplayCutout#getBoundingRectLeft()`, `https://developer.android.com/reference/android/view/DisplayCutout#getBoundingRectTop()`, `https://developer.android.com/reference/android/view/DisplayCutout#getBoundingRectRight()` or `https://developer.android.com/reference/android/view/DisplayCutout#getBoundingRectBottom()`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Path` | a `https://developer.android.com/reference/android/graphics/Path` contains all the cutout paths based on display coordinate. Returns null if there is no cutout on the display. <br /> |

### getSafeInsetBottom

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

```
public int getSafeInsetBottom ()
```

Returns the inset from the bottom which avoids the display cutout in pixels.

<br />

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

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets.Type#displayCutout()`

### getSafeInsetLeft

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

```
public int getSafeInsetLeft ()
```

Returns the inset from the left which avoids the display cutout in pixels.

<br />

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

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets.Type#displayCutout()`

### getSafeInsetRight

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

```
public int getSafeInsetRight ()
```

Returns the inset from the right which avoids the display cutout in pixels.

<br />

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

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets.Type#displayCutout()`

### getSafeInsetTop

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

```
public int getSafeInsetTop ()
```

Returns the inset from the top which avoids the display cutout in pixels.

<br />

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

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets.Type#displayCutout()`

### getWaterfallInsets

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

```
public Insets getWaterfallInsets ()
```

Returns the insets representing the curved areas of a waterfall display. A waterfall display has curved areas along the edges of the screen. Apps should be careful when showing UI and handling touch input in those insets because the curve may impair legibility and can frequently lead to unintended touch inputs.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Insets` | the insets for the curved areas of a waterfall display in pixels or `Insets.NONE` if there are no curved areas or they don't overlap with the window. This value cannot be `null`. <br /> |

### hashCode

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

```
public int hashCode ()
```

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by `https://developer.android.com/reference/java/util/HashMap`.

The general contract of `hashCode` is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the `hashCode` method must consistently return the same integer, provided no information used in `equals` comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
- It is *not* required that if two objects are unequal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### toString

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