Merge "QS: Fix default icon handling for services" into nyc-dev
This commit is contained in:
@@ -155,7 +155,7 @@ public class TileQueryHelper {
|
||||
addTile(spec, appLabel, state, false);
|
||||
continue;
|
||||
}
|
||||
if (info.serviceInfo.icon == 0) {
|
||||
if (info.serviceInfo.icon == 0 && info.serviceInfo.applicationInfo.icon == 0) {
|
||||
continue;
|
||||
}
|
||||
Drawable icon = info.serviceInfo.loadIcon(pm);
|
||||
|
||||
@@ -84,11 +84,13 @@ public class CustomTile extends QSTile<QSTile.State> implements TileChangeListen
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
ServiceInfo info = pm.getServiceInfo(mComponent,
|
||||
PackageManager.MATCH_ENCRYPTION_AWARE_AND_UNAWARE);
|
||||
int icon = info.icon != 0 ? info.icon
|
||||
: info.applicationInfo.icon;
|
||||
// Update the icon if its not set or is the default icon.
|
||||
boolean updateIcon = mTile.getIcon() == null
|
||||
|| iconEquals(mTile.getIcon(), mDefaultIcon);
|
||||
mDefaultIcon = info.icon != 0 ? android.graphics.drawable.Icon
|
||||
.createWithResource(mComponent.getPackageName(), info.icon) : null;
|
||||
mDefaultIcon = icon != 0 ? android.graphics.drawable.Icon
|
||||
.createWithResource(mComponent.getPackageName(), icon) : null;
|
||||
if (updateIcon) {
|
||||
mTile.setIcon(mDefaultIcon);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user