WifiScanningService: Handle emergency scan requests when disabled

Whenever an emergency scan is received,
i) Inform WifiManager about the start of emergency scan processing.
ii) If the scan request is received when scanner is disabled (indicates
wifi chip is also off), put the scan request to the pending list and
wait for the wifi stack to bring up the wifi chip and enable scanning.
If the scan request is not for emergency purposes, reject the scan
request as before when scanner is disabled.
iii) Start a timer for informing WifiManager about the end of emergency
scan processsing. If further emergency scans are processed in this
duration, the timer gets reset again. This ensures that the end
indication only goes out X (15) seconds after the last emergency scan
gets processed (if there is a burst of scans in that interval).

Bug: 148390035
Test: atest com.android.server.wifi.scanner
Change-Id: I970ed0098d58135588d23afb025bd142db89d3ac
2 files changed