ClientModeImpl: Change screen state change handling

1. Only handle screen state change events when wifi is on
(ConnectableState). DefaultState is anyway going to be removed in
b/160335531.
2. Unregister the receiver when that ClientModeImpl instance is no
longer being used.
3. Let all the dependent modules get screen state changed events on
it's own. Don't use ClientModeImpl to trampoline these events.
4. Stop using real WifiMetrics instance in WifiScanningServiceTest and
use a mock instead.

Bug: 161173844
Test: atest com.android.server.wifi
Change-Id: I681d7118828556ce063f1f3c94f07a39e8b6364a
10 files changed
tree: f3e6accae6b12ffd4be2f6a1389e58c817d771e8
  1. apex/
  2. service/
  3. metrics_pdd_hook.py
  4. PREUPLOAD.cfg