From 8b9411e20cbce5f870cb836fb6eda7078e208337 Mon Sep 17 00:00:00 2001 From: Scott Mertz Date: Mon, 11 Jan 2016 10:58:40 -0800 Subject: 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 --- src/com/android/settings/RegulatoryInfoDisplayActivity.java | 8 ++++---- 1 file 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; } -- cgit v1.2.3