Skip to content

Commit 2ca25cd

Browse files
Winson ChungAndroid (Google) Code Review
authored andcommitted
Merge "Call ActivityManager to get the proper icon dpi."
2 parents fa1a916 + 43e34f6 commit 2ca25cd

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,13 @@ public RecentTasksLoader(Context context) {
6868

6969
// get the icon size we want -- on tablets, we use bigger icons
7070
boolean isTablet = res.getBoolean(R.bool.config_recents_interface_for_tablets);
71-
int density = res.getDisplayMetrics().densityDpi;
7271
if (isTablet) {
73-
if (density == DisplayMetrics.DENSITY_LOW) {
74-
mIconDpi = DisplayMetrics.DENSITY_MEDIUM;
75-
} else if (density == DisplayMetrics.DENSITY_MEDIUM) {
76-
mIconDpi = DisplayMetrics.DENSITY_HIGH;
77-
} else if (density == DisplayMetrics.DENSITY_HIGH) {
78-
mIconDpi = DisplayMetrics.DENSITY_XHIGH;
79-
} else if (density == DisplayMetrics.DENSITY_XHIGH) {
80-
// We'll need to use a denser icon, or some sort of a mipmap
81-
mIconDpi = DisplayMetrics.DENSITY_XHIGH;
82-
}
72+
ActivityManager activityManager =
73+
(ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
74+
mIconDpi = activityManager.getLauncherLargeIconDensity();
8375
} else {
8476
mIconDpi = res.getDisplayMetrics().densityDpi;
8577
}
86-
mIconDpi = isTablet ? DisplayMetrics.DENSITY_HIGH : res.getDisplayMetrics().densityDpi;
8778

8879
// Render the default thumbnail background
8980
int width = (int) res.getDimensionPixelSize(com.android.internal.R.dimen.thumbnail_width);

0 commit comments

Comments
 (0)