Unit testing for fragments.
Set up a base class for testing fragments that will generate the host
and run the fragment through some lifecycle checks to make sure it
does ok with standard lifecycle.
Fragment tests will also automatically check for any sort of leaks
related to bindings, receivers, or other callbacks in sysui. This
requires changing the statusbar.policy classes with callbacks to
have a common interface.
Lastly also fixes a few lifecycle bugs in QS found from the above
tests.
Bug: 32609190
Test: runtest systemui
Change-Id: I52007c696c2fd41914bba4ba9d8055f2b564a7d8
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java
index 0ff81e5..65432dc 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataSaverTile.java
@@ -44,9 +44,9 @@
@Override
public void setListening(boolean listening) {
if (listening) {
- mDataSaverController.addListener(this);
+ mDataSaverController.addCallback(this);
} else {
- mDataSaverController.remListener(this);
+ mDataSaverController.removeCallback(this);
}
}