Skip to content

Remove getWindowDisplayMetrics from DisplayMetricsHolder#56635

Closed
zoontek wants to merge 1 commit into
facebook:mainfrom
zoontek:cleanup-display-metrics-holder
Closed

Remove getWindowDisplayMetrics from DisplayMetricsHolder#56635
zoontek wants to merge 1 commit into
facebook:mainfrom
zoontek:cleanup-display-metrics-holder

Conversation

@zoontek
Copy link
Copy Markdown
Contributor

@zoontek zoontek commented Apr 28, 2026

Summary:

Following #53254

Removes the deprecated getWindowDisplayMetrics / setWindowDisplayMetrics / getDisplayMetricsWritableMap APIs from DisplayMetricsHolder. These were marked TODO(0.87) for removal once the non-breaking window closed.

Changelog:

[ANDROID] [REMOVED] - Remove DisplayMetricsHolder.getWindowDisplayMetrics, setWindowDisplayMetrics, and getDisplayMetricsWritableMap

Test Plan:

  • ./gradlew :packages:react-native:ReactAndroid:test passes (removed DisplayMetricsHolderTest window-metrics cases and the PixelUtilTest references)

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 28, 2026
@Before
fun setUp() {
context = RuntimeEnvironment.getApplication()
DisplayMetricsHolder.setWindowDisplayMetrics(null)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PixelUtil.kt is not using window display metrics since this commit. Those can be safely removed.

layout.text,
layout,
DisplayMetricsHolder.getWindowDisplayMetrics(),
DisplayMetricsHolder.getScreenDisplayMetrics(),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is OK, as it's only used for screen density

@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Apr 28, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 4, 2026

@alanleedev has imported this pull request. If you are a Meta employee, you can view this in D103695359.

@meta-codesync meta-codesync Bot closed this in 82536f2 May 16, 2026
@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @zoontek in 82536f2

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label May 16, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 16, 2026

@alanleedev merged this pull request in 82536f2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants