Skip to content

Commit 8046e29

Browse files
Ramanan RajeswaranAndroid (Google) Code Review
authored andcommitted
Merge "DO NOT MERGE" into ics-scoop
2 parents eb56ad1 + 9d29031 commit 8046e29

File tree

6 files changed

+11
-38
lines changed

6 files changed

+11
-38
lines changed

api/current.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21388,7 +21388,6 @@ package android.util {
2138821388
field public static final int DENSITY_MEDIUM = 160; // 0xa0
2138921389
field public static final int DENSITY_TV = 213; // 0xd5
2139021390
field public static final int DENSITY_XHIGH = 320; // 0x140
21391-
field public static final int DENSITY_XXHIGH = 480; // 0x1e0
2139221391
field public float density;
2139321392
field public int densityDpi;
2139421393
field public int heightPixels;

core/java/android/app/ActivityManager.java

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,10 +1442,9 @@ public ConfigurationInfo getDeviceConfigurationInfo() {
14421442
public int getLauncherLargeIconDensity() {
14431443
final Resources res = mContext.getResources();
14441444
final int density = res.getDisplayMetrics().densityDpi;
1445-
final int sw = res.getConfiguration().smallestScreenWidthDp;
14461445

1447-
if (sw < 600) {
1448-
// Smaller than approx 7" tablets, use the regular icon size.
1446+
if ((res.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
1447+
!= Configuration.SCREENLAYOUT_SIZE_XLARGE) {
14491448
return density;
14501449
}
14511450

@@ -1457,13 +1456,9 @@ public int getLauncherLargeIconDensity() {
14571456
case DisplayMetrics.DENSITY_HIGH:
14581457
return DisplayMetrics.DENSITY_XHIGH;
14591458
case DisplayMetrics.DENSITY_XHIGH:
1460-
return DisplayMetrics.DENSITY_XXHIGH;
1461-
case DisplayMetrics.DENSITY_XXHIGH:
1462-
return DisplayMetrics.DENSITY_XHIGH * 2;
1459+
return DisplayMetrics.DENSITY_MEDIUM * 2;
14631460
default:
1464-
// The density is some abnormal value. Return some other
1465-
// abnormal value that is a reasonable scaling of it.
1466-
return (int)(density*1.5f);
1461+
return density;
14671462
}
14681463
}
14691464

@@ -1476,10 +1471,9 @@ public int getLauncherLargeIconDensity() {
14761471
public int getLauncherLargeIconSize() {
14771472
final Resources res = mContext.getResources();
14781473
final int size = res.getDimensionPixelSize(android.R.dimen.app_icon_size);
1479-
final int sw = res.getConfiguration().smallestScreenWidthDp;
14801474

1481-
if (sw < 600) {
1482-
// Smaller than approx 7" tablets, use the regular icon size.
1475+
if ((res.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
1476+
!= Configuration.SCREENLAYOUT_SIZE_XLARGE) {
14831477
return size;
14841478
}
14851479

@@ -1493,13 +1487,9 @@ public int getLauncherLargeIconSize() {
14931487
case DisplayMetrics.DENSITY_HIGH:
14941488
return (size * DisplayMetrics.DENSITY_XHIGH) / DisplayMetrics.DENSITY_HIGH;
14951489
case DisplayMetrics.DENSITY_XHIGH:
1496-
return (size * DisplayMetrics.DENSITY_XXHIGH) / DisplayMetrics.DENSITY_XHIGH;
1497-
case DisplayMetrics.DENSITY_XXHIGH:
1498-
return (size * DisplayMetrics.DENSITY_XHIGH*2) / DisplayMetrics.DENSITY_XXHIGH;
1490+
return (size * DisplayMetrics.DENSITY_MEDIUM * 2) / DisplayMetrics.DENSITY_XHIGH;
14991491
default:
1500-
// The density is some abnormal value. Return some other
1501-
// abnormal value that is a reasonable scaling of it.
1502-
return (int)(size*1.5f);
1492+
return size;
15031493
}
15041494
}
15051495

core/java/android/util/DisplayMetrics.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@ public class DisplayMetrics {
5656
*/
5757
public static final int DENSITY_XHIGH = 320;
5858

59-
/**
60-
* Standard quantized DPI for extra-extra-high-density screens. Applications
61-
* should not generally worry about this density; relying on XHIGH graphics
62-
* being scaled up to it should be sufficient for almost all cases.
63-
*/
64-
public static final int DENSITY_XXHIGH = 480;
65-
6659
/**
6760
* The reference density used throughout the system.
6861
*/

include/utils/ResourceTypes.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,6 @@ struct ResTable_config
843843
DENSITY_MEDIUM = ACONFIGURATION_DENSITY_MEDIUM,
844844
DENSITY_TV = ACONFIGURATION_DENSITY_TV,
845845
DENSITY_HIGH = ACONFIGURATION_DENSITY_HIGH,
846-
DENSITY_XHIGH = ACONFIGURATION_DENSITY_XHIGH,
847-
DENSITY_XXHIGH = ACONFIGURATION_DENSITY_XXHIGH,
848846
DENSITY_NONE = ACONFIGURATION_DENSITY_NONE
849847
};
850848

native/include/android/configuration.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ enum {
4242
ACONFIGURATION_DENSITY_MEDIUM = 160,
4343
ACONFIGURATION_DENSITY_TV = 213,
4444
ACONFIGURATION_DENSITY_HIGH = 240,
45-
ACONFIGURATION_DENSITY_XHIGH = 320,
46-
ACONFIGURATION_DENSITY_XXHIGH = 480,
4745
ACONFIGURATION_DENSITY_NONE = 0xffff,
4846

4947
ACONFIGURATION_KEYBOARD_ANY = 0x0000,

tools/aapt/AaptAssets.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,17 +1079,12 @@ bool AaptGroupEntry::getDensityName(const char* name,
10791079
if (out) out->density = ResTable_config::DENSITY_HIGH;
10801080
return true;
10811081
}
1082-
1082+
10831083
if (strcmp(name, "xhdpi") == 0) {
1084-
if (out) out->density = ResTable_config::DENSITY_XHIGH;
1084+
if (out) out->density = ResTable_config::DENSITY_MEDIUM*2;
10851085
return true;
10861086
}
1087-
1088-
if (strcmp(name, "xxhdpi") == 0) {
1089-
if (out) out->density = ResTable_config::DENSITY_XXHIGH;
1090-
return true;
1091-
}
1092-
1087+
10931088
char* c = (char*)name;
10941089
while (*c >= '0' && *c <= '9') {
10951090
c++;

0 commit comments

Comments
 (0)