Should be getting launcher icon DPI from ActivityManager.
Change-Id: Iec1b375568b421220fdbf08de6e7a697d0488e24
This commit is contained in:
committed by
Ramanan Rajeswaran
parent
3d9adfb03a
commit
af23500cf9
@@ -16,7 +16,9 @@
|
||||
|
||||
package com.android.launcher2;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
@@ -24,7 +26,6 @@ import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.DisplayMetrics;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -53,16 +54,9 @@ public class IconCache {
|
||||
mPackageManager = context.getPackageManager();
|
||||
int density = context.getResources().getDisplayMetrics().densityDpi;
|
||||
if (LauncherApplication.isScreenLarge()) {
|
||||
if (density == DisplayMetrics.DENSITY_LOW) {
|
||||
mIconDpi = DisplayMetrics.DENSITY_MEDIUM;
|
||||
} else if (density == DisplayMetrics.DENSITY_MEDIUM) {
|
||||
mIconDpi = DisplayMetrics.DENSITY_HIGH;
|
||||
} else if (density == DisplayMetrics.DENSITY_HIGH) {
|
||||
mIconDpi = DisplayMetrics.DENSITY_XHIGH;
|
||||
} else if (density == DisplayMetrics.DENSITY_XHIGH) {
|
||||
// We'll need to use a denser icon, or some sort of a mipmap
|
||||
mIconDpi = DisplayMetrics.DENSITY_XHIGH;
|
||||
}
|
||||
ActivityManager activityManager =
|
||||
(ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
mIconDpi = activityManager.getLauncherLargeIconDensity();
|
||||
} else {
|
||||
mIconDpi = context.getResources().getDisplayMetrics().densityDpi;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user