DO NOT MERGE: Restore the logic of verifying the size of DisplayMetrics

The widthPixels and heightPixels of a DisplayMetrics should be reduced
by display cutout and navigation bar insets if it is obtained from an
app which is running on Android 14 or a earlier version or the app
targets SDK level 34 or lower. This CL restores the logic.

Fix: 340970172
Test: atest WindowMetricsActivityTests WindowMetricsWindowContextTests
Change-Id: I1d21c1c53c6378c2516f33471c2f78f3e148297e
1 file changed