Merge "Do not use cached tile specs value in QSTileHost.addTile()" into nyc-dev
am: 390a0ca025
* commit '390a0ca025ce9b0849150a0c87641c33b292cc35':
Do not use cached tile specs value in QSTileHost.addTile()
Change-Id: I0363a9c64960b82b3b74a79de3e4998d0a03b550
This commit is contained in:
@@ -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<String> tileSpecs = loadTileSpecs(mContext, setting);
|
||||
if (tileSpecs.contains(spec)) {
|
||||
return;
|
||||
}
|
||||
ArrayList<String> 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) {
|
||||
|
||||
Reference in New Issue
Block a user