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:
@@ -977,6 +977,7 @@ public class VolumeDialog implements TunerService.Tunable {
|
|||||||
final int density = newConfig.densityDpi;
|
final int density = newConfig.densityDpi;
|
||||||
if (density != mDensity) {
|
if (density != mDensity) {
|
||||||
mDialog.dismiss();
|
mDialog.dismiss();
|
||||||
|
mZenFooter.cleanup();
|
||||||
initDialog();
|
initDialog();
|
||||||
}
|
}
|
||||||
updateWindowWidthH();
|
updateWindowWidthH();
|
||||||
|
|||||||
@@ -79,18 +79,11 @@ public class ZenFooter extends LinearLayout {
|
|||||||
mZen = controller.getZen();
|
mZen = controller.getZen();
|
||||||
mConfig = controller.getConfig();
|
mConfig = controller.getConfig();
|
||||||
mController = controller;
|
mController = controller;
|
||||||
|
mController.addCallback(mZenCallback);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void cleanup() {
|
||||||
protected void onAttachedToWindow() {
|
|
||||||
super.onAttachedToWindow();
|
|
||||||
mController.addCallback(mZenCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDetachedFromWindow() {
|
|
||||||
super.onDetachedFromWindow();
|
|
||||||
mController.removeCallback(mZenCallback);
|
mController.removeCallback(mZenCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user