Remove refs to QSFragment

Make sure that the tiles are not connected to QSFragment when the
QSPanel is detached.

Test: build, destroy fragment a couple times
Fixes: 157069009
Change-Id: I8298a6a0ebf8e3764038857b633f70816fe0b2db
This commit is contained in:
Fabian Kozynski
2020-05-20 15:32:27 -04:00
parent f7b6901230
commit fb8a11eef5
2 changed files with 5 additions and 0 deletions

View File

@@ -157,6 +157,7 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
if (mListening) {
setListening(false);
}
mQSCustomizer.setQs(null);
}
@Override

View File

@@ -361,9 +361,13 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne
if (mHost != null) {
mHost.removeCallback(this);
}
if (mTileLayout != null) {
mTileLayout.setListening(false);
}
for (TileRecord record : mRecords) {
record.tile.removeCallbacks();
}
mRecords.clear();
if (mBrightnessMirrorController != null) {
mBrightnessMirrorController.removeCallback(this);
}