Merge "Fix Hotspot tile is shown on Guest user"
This commit is contained in:
@@ -335,16 +335,24 @@ public class QSTileHost implements QSTile.Host, Tunable {
|
|||||||
QSTile<?> tile = mTiles.get(tileSpec);
|
QSTile<?> tile = mTiles.get(tileSpec);
|
||||||
if (tile != null && (!(tile instanceof CustomTile)
|
if (tile != null && (!(tile instanceof CustomTile)
|
||||||
|| ((CustomTile) tile).getUser() == currentUser)) {
|
|| ((CustomTile) tile).getUser() == currentUser)) {
|
||||||
if (DEBUG) Log.d(TAG, "Adding " + tile);
|
if (tile.isAvailable()) {
|
||||||
tile.removeCallbacks();
|
if (DEBUG) Log.d(TAG, "Adding " + tile);
|
||||||
newTiles.put(tileSpec, tile);
|
tile.removeCallbacks();
|
||||||
|
newTiles.put(tileSpec, tile);
|
||||||
|
} else {
|
||||||
|
tile.destroy();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (DEBUG) Log.d(TAG, "Creating tile: " + tileSpec);
|
if (DEBUG) Log.d(TAG, "Creating tile: " + tileSpec);
|
||||||
try {
|
try {
|
||||||
tile = createTile(tileSpec);
|
tile = createTile(tileSpec);
|
||||||
if (tile != null && tile.isAvailable()) {
|
if (tile != null) {
|
||||||
tile.setTileSpec(tileSpec);
|
if (tile.isAvailable()) {
|
||||||
newTiles.put(tileSpec, tile);
|
tile.setTileSpec(tileSpec);
|
||||||
|
newTiles.put(tileSpec, tile);
|
||||||
|
} else {
|
||||||
|
tile.destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
Log.w(TAG, "Error creating tile for spec: " + tileSpec, t);
|
Log.w(TAG, "Error creating tile for spec: " + tileSpec, t);
|
||||||
|
|||||||
Reference in New Issue
Block a user