Improve BLE scan attribution to facilitate debugging power issues
Following changes are made to improve BLE scan dumpsys:
1. All stats in AppScanStats assumed one scan per application.
This is not true for many applications. Fix scanning stats
to support multiple scans per application:
a. Fix number of scans started/stopped counters.
b. Fix scan min/max/avg/total time.
c. Fix scan start/stop indication to batterystats.
2. Show ongoing scans as a separate list of scans.
Example:
<app-name> (Registered)
LE scans (started/stopped) : 13 / 11
Scan time in ms (min/max/avg/total): 1098 / 227509 / 19805 / 257469
Total number of results : 2623
Last 5 scans :
2017/06/26 14:55:02 - 6659ms 59 results (7)
2017/06/26 14:55:13 - 1113ms 6 results (8)
2017/06/26 14:55:14 - 10012ms Filter 0 results (8)
2017/06/26 14:55:24 - 1106ms 7 results (8)
2017/06/26 14:57:56 - 10007ms 100 results (9)
Ongoing scans:
2017/06/26 14:55:09 - 227509ms 2232 results (7)
2017/06/26 14:58:06 - 50463ms Filter 0 results (9)
Application ID : 5
UUID : xxxx
BUG: 62389939
Test: Tested a few BLE scanning applications which included misbehaving
applications.
Change-Id: Iaade4ce4bf06533415b49bc3635866b1bf0db937
3 files changed