private Drawable getActivityIconWithCache(ComponentName componentname) { String s = componentname.flattenToShortString(); if (mOutsideDrawablesCache.containsKey(s)) { componentname = (android.graphics.drawable.Drawable.ConstantState)mOutsideDrawablesCache.get(s); if (componentname == null) { return null; } else { return componentname.newDrawable(mProviderContext.getResources()); } } Drawable drawable = getActivityIcon(componentname); if (drawable == null) { componentname = null; } else { componentname = drawable.getConstantState(); } mOutsideDrawablesCache.put(s, componentname); return drawable; }