diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java index 29b4db1743750..68e5d0b5bdd38 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java @@ -369,13 +369,15 @@ public class QSTileHost implements QSTile.Host, Tunable { } public void addTile(String spec) { - if (mTileSpecs.contains(spec)) { + final String setting = Settings.Secure.getStringForUser(mContext.getContentResolver(), + TILES_SETTING, ActivityManager.getCurrentUser()); + final List tileSpecs = loadTileSpecs(mContext, setting); + if (tileSpecs.contains(spec)) { return; } - ArrayList specs = new ArrayList<>(mTileSpecs); - specs.add(spec); + tileSpecs.add(spec); Settings.Secure.putStringForUser(mContext.getContentResolver(), TILES_SETTING, - TextUtils.join(",", specs), ActivityManager.getCurrentUser()); + TextUtils.join(",", tileSpecs), ActivityManager.getCurrentUser()); } public void addTile(ComponentName tile) {