Adaptive Connectivity Toggle ContentObserver - move to separate class

If multiple instances of ClientModeImpl are active concurrently, there will
be multiple WifiScoreReport instances all listening to the adaptive connectivity
toggle. Each listener will report its own toggle metrics, causing double
counting.

Instead, move the adaptive connectivity ContentObserver into a separate class.
Since there is only a single listener, metrics will only be updated once per
user toggle.

Also, if the Adaptive Connectivity toggle were to remain in WifiScoreReport, the
ContentObserver should be unregistered when the owner ClientModeImpl is stopped.
Now that the ContentObserver is global, it will never be stopped, so it's no
longer necessary to unregister it.

Bug: 166309727
Bug: 165879977
Test: atest FrameworksWifiTests
Test: verified toggle events are received using adb logcat
Change-Id: Ifa634665378c2cbe78a556e1ced964e8ed3ddfd2
7 files changed
tree: 031c55927761d61521199d2405881ab4ba9f93a4
  1. apex/
  2. service/
  3. metrics_pdd_hook.py
  4. PREUPLOAD.cfg