From cdf98e1964489916c68e240bd92c2e0bedab3c2d Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Thu, 2 Jun 2016 16:04:56 -0400 Subject: [PATCH] Don't leak guts. Change-Id: I7a9080ce4d360ed67b884eb9cbd8597496388389 Fixes: 29064258 --- .../systemui/statusbar/NotificationGuts.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGuts.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGuts.java index b523a112c209b..5bbca1552a149 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGuts.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGuts.java @@ -93,7 +93,6 @@ public class NotificationGuts extends LinearLayout implements TunerService.Tunab public NotificationGuts(Context context, AttributeSet attrs) { super(context, attrs); setWillNotDraw(false); - TunerService.get(mContext).addTunable(this, SHOW_SLIDER); mHandler = new Handler(); mFalsingCheck = new Runnable() { @Override @@ -110,6 +109,18 @@ public class NotificationGuts extends LinearLayout implements TunerService.Tunab ta.recycle(); } + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + TunerService.get(mContext).addTunable(this, SHOW_SLIDER); + } + + @Override + protected void onDetachedFromWindow() { + TunerService.get(mContext).removeTunable(this); + super.onDetachedFromWindow(); + } + public void resetFalsingCheck() { mHandler.removeCallbacks(mFalsingCheck); if (mNeedsFalsingProtection && mExposed) {