summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ramanan Rajeswaran <ramanan@google.com> 2012-02-13 13:53:39 -0800
committer Android Git Automerger <android-git-automerger@android.com> 2012-03-05 14:51:35 -0800
commit5e7bb1e675df2cc1edd9808afcaaeed07830bd9f (patch)
treeef274bee6ea7f09c1233220f2c650e0c17fe1ed8
parente6a0ec60607783b426b92f638055c79178fdd892 (diff)
DO NOT MERGE
Revert "Add xxhdpi; fix ActivityManager.getLauncherLargeIconSize() etc." This reverts commit c1496d2d9a496e4aba817a58ecb9e07fe55cdba5. Change-Id: If60df742b19c925cc99b20d01108b84415b124ad
-rw-r--r--api/current.txt1
-rw-r--r--core/java/android/app/ActivityManager.java26
-rw-r--r--core/java/android/util/DisplayMetrics.java7
-rw-r--r--include/utils/ResourceTypes.h2
-rw-r--r--native/include/android/configuration.h2
-rw-r--r--tools/aapt/AaptAssets.cpp11
6 files changed, 11 insertions, 38 deletions
diff --git a/api/current.txt b/api/current.txt
index 4173b3429b1f..2914942687a4 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -21389,7 +21389,6 @@ package android.util {
field public static final int DENSITY_MEDIUM = 160; // 0xa0
field public static final int DENSITY_TV = 213; // 0xd5
field public static final int DENSITY_XHIGH = 320; // 0x140
- field public static final int DENSITY_XXHIGH = 480; // 0x1e0
field public float density;
field public int densityDpi;
field public int heightPixels;
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 9661b9e0d32b..4fe9cef2b7c2 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -1442,10 +1442,9 @@ public class ActivityManager {
public int getLauncherLargeIconDensity() {
final Resources res = mContext.getResources();
final int density = res.getDisplayMetrics().densityDpi;
- final int sw = res.getConfiguration().smallestScreenWidthDp;
- if (sw < 600) {
- // Smaller than approx 7" tablets, use the regular icon size.
+ if ((res.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
+ != Configuration.SCREENLAYOUT_SIZE_XLARGE) {
return density;
}
@@ -1457,13 +1456,9 @@ public class ActivityManager {
case DisplayMetrics.DENSITY_HIGH:
return DisplayMetrics.DENSITY_XHIGH;
case DisplayMetrics.DENSITY_XHIGH:
- return DisplayMetrics.DENSITY_XXHIGH;
- case DisplayMetrics.DENSITY_XXHIGH:
- return DisplayMetrics.DENSITY_XHIGH * 2;
+ return DisplayMetrics.DENSITY_MEDIUM * 2;
default:
- // The density is some abnormal value. Return some other
- // abnormal value that is a reasonable scaling of it.
- return (int)(density*1.5f);
+ return density;
}
}
@@ -1476,10 +1471,9 @@ public class ActivityManager {
public int getLauncherLargeIconSize() {
final Resources res = mContext.getResources();
final int size = res.getDimensionPixelSize(android.R.dimen.app_icon_size);
- final int sw = res.getConfiguration().smallestScreenWidthDp;
- if (sw < 600) {
- // Smaller than approx 7" tablets, use the regular icon size.
+ if ((res.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
+ != Configuration.SCREENLAYOUT_SIZE_XLARGE) {
return size;
}
@@ -1493,13 +1487,9 @@ public class ActivityManager {
case DisplayMetrics.DENSITY_HIGH:
return (size * DisplayMetrics.DENSITY_XHIGH) / DisplayMetrics.DENSITY_HIGH;
case DisplayMetrics.DENSITY_XHIGH:
- return (size * DisplayMetrics.DENSITY_XXHIGH) / DisplayMetrics.DENSITY_XHIGH;
- case DisplayMetrics.DENSITY_XXHIGH:
- return (size * DisplayMetrics.DENSITY_XHIGH*2) / DisplayMetrics.DENSITY_XXHIGH;
+ return (size * DisplayMetrics.DENSITY_MEDIUM * 2) / DisplayMetrics.DENSITY_XHIGH;
default:
- // The density is some abnormal value. Return some other
- // abnormal value that is a reasonable scaling of it.
- return (int)(size*1.5f);
+ return size;
}
}
diff --git a/core/java/android/util/DisplayMetrics.java b/core/java/android/util/DisplayMetrics.java
index a43d36c14660..519b98056b9f 100644
--- a/core/java/android/util/DisplayMetrics.java
+++ b/core/java/android/util/DisplayMetrics.java
@@ -57,13 +57,6 @@ public class DisplayMetrics {
public static final int DENSITY_XHIGH = 320;
/**
- * Standard quantized DPI for extra-extra-high-density screens. Applications
- * should not generally worry about this density; relying on XHIGH graphics
- * being scaled up to it should be sufficient for almost all cases.
- */
- public static final int DENSITY_XXHIGH = 480;
-
- /**
* The reference density used throughout the system.
*/
public static final int DENSITY_DEFAULT = DENSITY_MEDIUM;
diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h
index bd8288c1f592..71e53246844f 100644
--- a/include/utils/ResourceTypes.h
+++ b/include/utils/ResourceTypes.h
@@ -843,8 +843,6 @@ struct ResTable_config
DENSITY_MEDIUM = ACONFIGURATION_DENSITY_MEDIUM,
DENSITY_TV = ACONFIGURATION_DENSITY_TV,
DENSITY_HIGH = ACONFIGURATION_DENSITY_HIGH,
- DENSITY_XHIGH = ACONFIGURATION_DENSITY_XHIGH,
- DENSITY_XXHIGH = ACONFIGURATION_DENSITY_XXHIGH,
DENSITY_NONE = ACONFIGURATION_DENSITY_NONE
};
diff --git a/native/include/android/configuration.h b/native/include/android/configuration.h
index ddd4d359bdc9..2444c4bbda6d 100644
--- a/native/include/android/configuration.h
+++ b/native/include/android/configuration.h
@@ -42,8 +42,6 @@ enum {
ACONFIGURATION_DENSITY_MEDIUM = 160,
ACONFIGURATION_DENSITY_TV = 213,
ACONFIGURATION_DENSITY_HIGH = 240,
- ACONFIGURATION_DENSITY_XHIGH = 320,
- ACONFIGURATION_DENSITY_XXHIGH = 480,
ACONFIGURATION_DENSITY_NONE = 0xffff,
ACONFIGURATION_KEYBOARD_ANY = 0x0000,
diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp
index 7900ab7aea6d..3d6537a9013e 100644
--- a/tools/aapt/AaptAssets.cpp
+++ b/tools/aapt/AaptAssets.cpp
@@ -1079,17 +1079,12 @@ bool AaptGroupEntry::getDensityName(const char* name,
if (out) out->density = ResTable_config::DENSITY_HIGH;
return true;
}
-
+
if (strcmp(name, "xhdpi") == 0) {
- if (out) out->density = ResTable_config::DENSITY_XHIGH;
+ if (out) out->density = ResTable_config::DENSITY_MEDIUM*2;
return true;
}
-
- if (strcmp(name, "xxhdpi") == 0) {
- if (out) out->density = ResTable_config::DENSITY_XXHIGH;
- return true;
- }
-
+
char* c = (char*)name;
while (*c >= '0' && *c <= '9') {
c++;