Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 726aee88 authored by Jason Monk's avatar Jason Monk Committed by android-build-merger
Browse files

Merge \"QS: Fix default icon handling for services\" into nyc-dev

am: 94a20367

Change-Id: I626992cdd9c5ff507b001dae2816df09872872ca
parents 542762f9 94a20367
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,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);
+4 −2
Original line number Diff line number Diff line
@@ -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);
            }