Closed
Bug 605024
Opened 14 years ago
Closed 14 years ago
GetDPI on Android should be precise
Categories
(Core Graveyard :: Widget: Android, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: pavlov, Assigned: mbrubeck)
References
Details
Attachments
(1 file)
5.17 KB,
patch
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #602322 +++
nsIWidget::GetDPI should use xdpi to be precise rather than densityDpi
http://developer.android.com/reference/android/util/DisplayMetrics.html#xdpi
Reporter | ||
Updated•14 years ago
|
Summary: Implement GetDPI on Android → GetDPI on Android should be precise
Assignee | ||
Comment 1•14 years ago
|
||
In practice, xdpi is not actually more precide than densityDpi. In the current implementation they are always set to the same value:
http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/util/DisplayMetrics.java&q=DisplayMetrics.java&l=118
Both properties reflect the "ro.sf.lcd_density" property, which is set at build time by the device maker and is not based on querying the actual display hardware:
http://www.google.com/codesearch?q=ro.sf.lcd_density%3D
Assignee | ||
Updated•14 years ago
|
tracking-fennec: 2.0b2+ → ---
Assignee | ||
Comment 2•14 years ago
|
||
(In reply to comment #1)
> In practice, xdpi is not actually more precide than densityDpi. In the current
> implementation they are always set to the same value
On closer look, I think I was wrong about this. The "getMetrics" method in android.view.Display does set xdpi/ydpi to more precise values.
Assignee | ||
Updated•14 years ago
|
tracking-fennec: --- → ?
Assignee | ||
Comment 3•14 years ago
|
||
Assignee | ||
Comment 4•14 years ago
|
||
We've seen reports that xdpi is not implemented correctly on some devices:
http://osdir.com/ml/Android-Developers/2010-01/msg03576.html
http://efreedom.com/Question/1-2656330/Anyone-Used-Xdpi-Ydpi-Gotten-Correct-Results
Need more testing before we land this. We'll try to get data from our QA and internal testers.
Assignee | ||
Updated•14 years ago
|
Attachment #491319 -
Flags: review?(blassey.bugs)
Updated•14 years ago
|
Attachment #491319 -
Flags: review?(blassey.bugs)
Updated•14 years ago
|
Attachment #491319 -
Flags: review?(blassey.bugs)
Comment 5•14 years ago
|
||
Matt, as I suggested on irc, please put together a test app to grab dpi values and ask people to test it on their devices so we can get some useful data here
Assignee | ||
Comment 6•14 years ago
|
||
Here's a test application. If you run this on your Android device and press the "send email" button, it will submit the data to me: http://limpet.net/dpi.apk
Assignee | ||
Comment 7•14 years ago
|
||
Based on this submission, there are still devices in the wild with inaccurate values for xdpi:
density=1.5
densityDpi=240
xdpi=144.0
ydpi=144.0
manufacturer=motorola
brand=verizon
model=DROIDX
device=cdma_shadow
product=shadow_vzw
display=VZW
We could develop a whitelist or blacklist of hardware models. Or we could assume xdpi is broken if it is not "close" to densityDpi...
Updated•14 years ago
|
tracking-fennec: ? → 2.0+
Assignee | ||
Comment 8•14 years ago
|
||
The Samsung Galaxy Tab has the opposite problem from the Droid X. In this case, xdpi is accurate and densityDpi is not:
density=1.5
densityDpi=240
xdpi=168.89351
ydpi=169.33333
manufacturer=samsung
brand=verizon
model=SCH-I800
device=SCH-I800
product=SCH-I800
display=FROYO.DJ11
This means we can't assume densityDpi is more accurate when they differ, as I suggested in comment 7. Also, if we use xdpi on this device then we will be inconsistent with other Android applications (which are scaled based on densityDpi).
Assignee | ||
Comment 9•14 years ago
|
||
Removing blocking on this; we can't make GetDPI precise if devices don't reliably report a precise DPI.
For the primary case where we intend to use GetDPI (bug 590817, to adjust our UI dimensions), using densityDPI is more appropriate anyway, since it allows vendors to make devices designed for different viewing distances.
tracking-fennec: 2.0+ → ---
Assignee | ||
Updated•14 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•