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

Commit 6b5b45bf authored by Roman Birg's avatar Roman Birg
Browse files

SystemUI: don't crash with bad tiles



If a tile doesn't provide resources, don't crash.

Change-Id: I4ad7ea731d970cf62d47d0696a6c7ee078acf108
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent d75b707d
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -2008,7 +2008,11 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
        private String getQSTileLabel(String spec) {
            if (QSUtils.isStaticQsTile(spec)) {
                int resource = QSTileHost.getLabelResource(spec);
                if (resource != 0) {
                    return mContext.getText(resource).toString();
                } else {
                    return spec;
                }
            } else if (QSUtils.isDynamicQsTile(spec)) {
                return QSUtils.getDynamicQSTileLabel(mContext,
                        UserHandle.myUserId(), spec);
@@ -2023,8 +2027,12 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
                        QSUtils.getDynamicQSTileResIconId(mContext, UserHandle.myUserId(), spec))
                        .getDrawable(mContext);
            } else if (QSUtils.isStaticQsTile(spec)) {
                return QSTile.ResourceIcon.get(QSTileHost.getIconResource(spec))
                        .getDrawable(mContext);
                final int res = QSTileHost.getIconResource(spec);
                if (res != 0) {
                    return QSTile.ResourceIcon.get(res).getDrawable(mContext);
                } else {
                    return mContext.getPackageManager().getDefaultActivityIcon();
                }
            } else {
                QSTile<?> tile = mHost.getTile(spec);
                if (tile != null) {