diff options
| author | Scott Mertz <scott@cyngn.com> | 2016-01-11 10:58:40 -0800 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-01-11 11:28:26 -0800 |
| commit | 8b9411e20cbce5f870cb836fb6eda7078e208337 (patch) | |
| tree | 3313dae7e8257958075d9fc579e1714ca8a1eef0 | |
| parent | 566c2f875108771ad66fcd20746a1fe4b3cfa664 (diff) | |
| download | packages_apps_Settings-8b9411e20cbce5f870cb836fb6eda7078e208337.tar.gz packages_apps_Settings-8b9411e20cbce5f870cb836fb6eda7078e208337.tar.bz2 packages_apps_Settings-8b9411e20cbce5f870cb836fb6eda7078e208337.zip | |
Settings: increase default regulatory info drawable dimensions
BitmapDrawable.getIntrinsicWidth/Height returns the bitmap density
scaled to the display density, not the actual bitmap height/width.
The default drawable is 1x1, but on xxhdpi devices, the resolution
is 4x4. This causes the regulatory information text to never be
shown on xxhdpi devices even when the png has not been overlayed.
Increase the dimension limit to a reasonable 32x32 image.
Change-Id: Id6429d46f8612352d7930fdad4a6d125e7939ea2
| -rw-r--r-- | src/com/android/settings/RegulatoryInfoDisplayActivity.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/settings/RegulatoryInfoDisplayActivity.java b/src/com/android/settings/RegulatoryInfoDisplayActivity.java index c674f13f1..39776e095 100644 --- a/src/com/android/settings/RegulatoryInfoDisplayActivity.java +++ b/src/com/android/settings/RegulatoryInfoDisplayActivity.java @@ -64,10 +64,10 @@ public class RegulatoryInfoDisplayActivity extends Activity implements if (resId != 0) { try { Drawable d = getDrawable(resId); - // set to false if the width or height is <= 2 - // (missing PNG can return an empty 2x2 pixel Drawable) - regulatoryInfoDrawableExists = (d.getIntrinsicWidth() > 2 - && d.getIntrinsicHeight() > 2); + // set to false if the width or height is <= 32 + // (default PNG is a 1x1 pixel image scaled to the display density) + regulatoryInfoDrawableExists = (d.getIntrinsicWidth() > 32 + && d.getIntrinsicHeight() > 32); } catch (Resources.NotFoundException ignored) { regulatoryInfoDrawableExists = false; } |
