@@ -129,6 +129,9 @@ private interface UnlockWidgetCommonMethods {
129129
130130 // Get the target position for the given resource. Returns -1 if not found.
131131 public int getTargetPosition (int resourceId );
132+
133+ // Clean up when this widget is going away
134+ public void cleanUp ();
132135 }
133136
134137 class SlidingTabMethods implements SlidingTab .OnTriggerListener , UnlockWidgetCommonMethods {
@@ -197,6 +200,10 @@ public void setEnabled(int resourceId, boolean enabled) {
197200 public int getTargetPosition (int resourceId ) {
198201 return -1 ; // Not supported
199202 }
203+
204+ public void cleanUp () {
205+ mSlidingTab .setOnTriggerListener (null );
206+ }
200207 }
201208
202209 class WaveViewMethods implements WaveView .OnTriggerListener , UnlockWidgetCommonMethods {
@@ -240,6 +247,9 @@ public void setEnabled(int resourceId, boolean enabled) {
240247 public int getTargetPosition (int resourceId ) {
241248 return -1 ; // Not supported
242249 }
250+ public void cleanUp () {
251+ mWaveView .setOnTriggerListener (null );
252+ }
243253 }
244254
245255 private Intent getAssistIntent () {
@@ -374,6 +384,10 @@ public void setEnabled(int resourceId, boolean enabled) {
374384 public int getTargetPosition (int resourceId ) {
375385 return mMultiWaveView .getTargetPosition (resourceId );
376386 }
387+
388+ public void cleanUp () {
389+ mMultiWaveView .setOnTriggerListener (null );
390+ }
377391 }
378392
379393 private void requestUnlockScreen () {
@@ -592,6 +606,7 @@ public void onResume() {
592606 public void cleanUp () {
593607 mUpdateMonitor .removeCallback (mInfoCallback ); // this must be first
594608 mUpdateMonitor .removeCallback (mSimStateCallback );
609+ mUnlockWidgetMethods .cleanUp ();
595610 mLockPatternUtils = null ;
596611 mUpdateMonitor = null ;
597612 mCallback = null ;
0 commit comments