Skip to content

Remove getWindowDisplayMetrics from DisplayMetricsHolder#56635

Open
zoontek wants to merge 1 commit intofacebook:mainfrom
zoontek:cleanup-display-metrics-holder
Open

Remove getWindowDisplayMetrics from DisplayMetricsHolder#56635
zoontek wants to merge 1 commit intofacebook: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
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. 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.

1 participant