Merge "Cleanup KeyguardIndicationController on tearDown" into tm-dev

This commit is contained in:
Beverly Tai
2022-03-15 13:05:21 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 0 deletions

View File

@@ -293,6 +293,14 @@ public class KeyguardIndicationController {
}
}
/**
* Cleanup
*/
public void destroy() {
mHandler.removeCallbacksAndMessages(null);
mBroadcastDispatcher.unregisterReceiver(mBroadcastReceiver);
}
private void handleAlignStateChanged(int alignState) {
String alignmentIndication = "";
if (alignState == DockManager.ALIGN_STATE_POOR) {

View File

@@ -226,6 +226,10 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
@After
public void tearDown() throws Exception {
mTextView.setAnimationsEnabled(true);
if (mController != null) {
mController.destroy();
mController = null;
}
}
private void createController() {