Android: Respect display cutout setting on API 35+ - #19361
Open
Starlightbotanist wants to merge 2 commits into
Open
Android: Respect display cutout setting on API 35+#19361Starlightbotanist wants to merge 2 commits into
Starlightbotanist wants to merge 2 commits into
Conversation
Android 15 treats all display cutout modes as always when an application targets API 35 or later, causing the Fullscreen Over Notch setting to be ignored. When notch drawing is disabled, resize and position the NativeActivity window using the display cutout safe insets. Restore match-parent dimensions when notch drawing is enabled so the window continues to adapt correctly across orientation changes. Retain the existing layoutInDisplayCutoutMode behavior on earlier Android versions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Starting with Android 15, applications targeting API 35 or later are laid out into the display cutout area regardless of the requested cutout mode. This causes the Fullscreen Over Notch setting to be ignored.
When notch drawing is disabled, resize and position the NativeActivity window using the display cutout safe insets. Restore match-parent dimensions when notch drawing is enabled so the window continues to adapt correctly across orientation changes.
Retain the existing layoutInDisplayCutoutMode behavior on earlier Android versions.
Related Issues
Fixes #19281
Caused by these changes 53021d4
Reviewers
Merge with caution, I only have a single device with a notch to test on. Pixel 6 with android 17.