Only reload callback on configuration change.

So it'll get zen changes when the volume dialog is not showing.

Change-Id: I0d4220d0a000d74c6994b07b2d5b8562a6a52585
Fixes: 29355577
This commit is contained in:
Julia Reynolds
2016-06-14 15:24:39 -04:00
parent 987cd20acf
commit 8d0a400119
2 changed files with 3 additions and 9 deletions

View File

@@ -977,6 +977,7 @@ public class VolumeDialog implements TunerService.Tunable {
final int density = newConfig.densityDpi;
if (density != mDensity) {
mDialog.dismiss();
mZenFooter.cleanup();
initDialog();
}
updateWindowWidthH();

View File

@@ -79,18 +79,11 @@ public class ZenFooter extends LinearLayout {
mZen = controller.getZen();
mConfig = controller.getConfig();
mController = controller;
mController.addCallback(mZenCallback);
update();
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
mController.addCallback(mZenCallback);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
public void cleanup() {
mController.removeCallback(mZenCallback);
}