Only reload callback on configuration change.

am: 8d0a400119

Change-Id: I1f3fbfd28483ab27a426ef005fa78553e5185036
This commit is contained in:
Julia Reynolds
2016-06-14 20:54:27 +00:00
committed by android-build-merger
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);
}