Some Android Emulator "devices" report incorrect Window.VisualDiagnosticsOverlay.Density
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 290
Description
### Description
Selecting elements (or "hit testing" them to be more exact) in XAML Live Preview is off on Pixel 3a XL, but okay on Pixel 5A.
### Steps to Reproduce
1. Open attached project.
2. Build.
3. Deploy on Android Emulator > Pixel 3a XL API 30.
**Actual**: reported density is 2.5
**Expected**: reported density close to 1.9
**Note 1**: selecting elements in XAML Live Preview (XLP) is clearly off; changing density under debugger from 2.5 to 1.9 makes XLP happy
**Note 2**: other "devices" (like Pixel 5 API 30) report correct density
[MauiApp19.zip](https://github.com/dotnet/maui/files/9114447/MauiApp19.zip)

### Version with bug
6.0.400
### Last version that worked well
Unknown/Other
### Affected platforms
Android
### Affected platform versions
not sure
### Did you find any workaround?
_No response_
### Relevant log output
_No response_
Contributor guide
Research direction
Start by opening the attached MauiApp19.zip project, deploying it to the Pixel 3a XL API 30 emulator, and observing Window.VisualDiagnosticsOverlay.Density during XAML Live Preview hit testing. Compare the reported density with the Pixel 5A or Pixel 5 API 30, and verify that element selection aligns after the incorrect-density case is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100