Display Cutout Manager in Android: What It Is
In this article
DisplayCutoutManager is an internal Android framework component that coordinates how the system and apps treat the screen area occupied by a device’s cutout (commonly called a notch). It is not part of the public SDK; instead, developers work with the public DisplayCutout class and the layoutInDisplayCutoutMode flag to achieve the same result.
Background – why Android needs a cutout manager
When smartphones began to use front‑facing cameras and sensors that required space at the top of the panel, manufacturers introduced a “cutout” – a small rectangular or teardrop‑shaped hole in the display. The operating system had to decide whether app content could appear behind that hole, be pushed down, or be split around it. Early Android releases simply hid the cutout area, but starting with Android 9 (API 28) Google added a formal cutout model.
The cutout model consists of three pieces:
- DisplayCutout – a public data object that describes the size and position of the cutout.
- WindowInsets – a container that delivers the
DisplayCutoutto each window. - LayoutInDisplayCutoutMode – a flag that tells the system whether the window wants to use the cutout area.
Behind these public pieces, Android runs a hidden service called DisplayCutoutManager. Its job is to collect cutout information from the hardware compositor, apply policy (for example, respecting user‑selected “hide cutout” settings), and broadcast the result to the rest of the framework.
How the manager works internally
The manager lives in the system server process. When the display hardware reports a new cutout shape – for instance, after a rotation or when a foldable device changes its hinge angle – the compositor sends the geometry to the manager via a Binder call. The manager then:
- Validates the shape against the device’s configuration.
- Applies any global policy (such as “always keep cutout hidden” set in Settings).
- Updates the
DisplayInfoobject that the WindowManager uses. - Triggers a
WindowInsetsupdate so every active window receives the newDisplayCutoutdata.
Because it runs at the system level, the manager can enforce consistency across all apps, ensuring that a cutout is never unintentionally exposed in a way that would obscure the camera or sensor.
How developers interact with cutouts – the public API
Even though DisplayCutoutManager is hidden, the public API gives developers full control over how their UI behaves around a cutout.
- Query the cutout:
WindowInsets insets = view.getRootWindowInsets(); DisplayCutout cutout = insets.getDisplayCutout(); - Decide whether to draw behind it. The most common approach is to set the window flag in the activity’s
onCreatemethod:
This tells the system that the app is allowed to use the short edges of the cutout (the top on portrait phones).getWindow().setAttributes(new WindowManager.LayoutParams().apply { layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES }); - Adjust layout margins based on
cutout.getSafeInsetTop()(and left/right/bottom) so that important UI elements stay out of the hole.
All of these calls are safe on every Android version because the framework falls back to a zero‑inset DisplayCutout on devices without a notch.
Common problems and how to solve them
Developers often encounter three typical issues when dealing with cutouts.
- Content disappearing behind the cutout. If the activity does not set
layoutInDisplayCutoutMode, the system may letterbox the UI, causing the top portion to be hidden. Fix: add the flag as shown above. - Incorrect safe‑inset values. Some OEMs report cutout geometry incorrectly on certain firmware versions. A quick workaround is to check
cutout.getBoundingRects()and, if empty, assume a zero inset. - Rotation glitches. When the device rotates, the cutout shape can change (e.g., from a top notch to a side cutout on a foldable). Ensure your layout recalculates margins in
onConfigurationChangedor by listening toWindowInsetsAnimation.Callback.
Best practices – keeping UI robust across devices
Because cutout implementations vary wildly, follow these guidelines:
- Never hard‑code pixel values for the top margin; always use the safe‑inset values from
DisplayCutout. - Test on at least three form factors: a device with no cutout, a device with a centered notch, and a device with a side‑cutout (common on some Chinese flagship phones).
- Prefer
LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGESoverLAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYSunless your design truly requires full‑screen content behind the camera. - Respect the user’s system setting “Hide cutout area” (found in Settings → Display). The system will automatically enforce this via the hidden manager, but you should not override it with a custom flag.
- Use
WindowInsetsControllerto animate inset changes smoothly, giving the user a polished transition when the cutout appears or disappears.
Alternatives and related APIs
If you need more granular control than the simple flag provides, consider these options:
- WindowInsetsAnimation – lets you animate layout changes as the cutout geometry updates.
- View.setOnApplyWindowInsetsListener – a callback that runs every time the system delivers new inset data, ideal for dynamic UI adjustments.
- Device-specific SDKs – some manufacturers expose proprietary APIs for custom cutout shapes (e.g., Samsung’s “Edge Panel” APIs). Use them only when you target that brand specifically.
There is no direct replacement for the hidden DisplayCutoutManager because its responsibilities are baked into the system server. All public interactions funnel through the classes mentioned above.
Frequently Asked Questions
Is DisplayCutoutManager part of the Android SDK?
No. It is an internal system service that lives in the Android framework. Developers interact with cutouts through the public DisplayCutout class and the layoutInDisplayCutoutMode flag.
Can I disable the cutout completely for my app?
Yes. Set layoutInDisplayCutoutMode to LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER. The system will then treat the cutout area as an unsafe region and keep your content away from it.
Do all Android devices have a cutout?
No. Many devices have a full‑screen panel with no notch. In those cases DisplayCutout.getSafeInsetTop() and the other inset methods return 0, and the system behaves as if there is no cutout.
What happens if I ignore the cutout and draw UI behind it?
The content may be obscured by the camera or sensor, leading to a poor user experience. On some devices the system may also automatically add a black bar to protect the hardware, which can look like a bug.
Is there a way to detect the user’s “Hide cutout” setting?
The setting is enforced by the hidden manager. Your app does not need to check it; if the user has asked Android to hide the cutout, the system will report zero insets regardless of the flag you set.
Do foldable phones use the same cutout handling?
Foldables can present cutouts on the hinge side or on the inner display. The same API works; you just need to listen for inset changes when the hinge angle changes.