Fix QS panel after density changes

Fixes: 27744717
Change-Id: Ic3724b39e027379bb81e94e7059e67d2bbe30e88
This commit is contained in:
Jason Monk
2016-03-30 13:48:56 -04:00
parent 4ea6657d58
commit f160edcab9

View File

@@ -119,12 +119,18 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {
protected void onAttachedToWindow() {
super.onAttachedToWindow();
TunerService.get(mContext).addTunable(this, QS_SHOW_BRIGHTNESS);
if (mHost != null) {
setTiles(mHost.getTiles());
}
}
@Override
protected void onDetachedFromWindow() {
TunerService.get(mContext).removeTunable(this);
mHost.removeCallback(this);
for (TileRecord record : mRecords) {
record.tile.removeCallbacks();
}
super.onDetachedFromWindow();
}