diff options
author | Mitchell Wills <mwills@google.com> | 2015-10-15 16:58:42 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-10-15 16:58:42 +0000 |
commit | 4a7d385069e9e1a490d6d2a8427536e1506a5801 (patch) | |
tree | e35dfd8538d039c8fac42f15cd1a3cb082288452 | |
parent | e2ba917b13c0271e018457917a6388a2f84e20ab (diff) | |
parent | 03dab7e3fbd1ebbd4a3e7637f8feae5806ab149d (diff) | |
download | wifi-4a7d385069e9e1a490d6d2a8427536e1506a5801.tar.gz |
Merge "Prevent corruption of Wifi scan battery stats" into mnc-dr-dev
-rw-r--r-- | service/java/com/android/server/wifi/WifiStateMachine.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 278593144..107fee34a 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -1897,6 +1897,9 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiPno // If workSource is not null, blame is given to it, otherwise blame is given to callingUid. private void noteScanStart(int callingUid, WorkSource workSource) { + if (lastStartScanTimeStamp != 0) { + noteScanEnd(); + } long now = System.currentTimeMillis(); lastStartScanTimeStamp = now; lastScanDuration = 0; @@ -1931,6 +1934,7 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiPno } private void noteScanEnd() { + closeRadioScanStats(); long now = System.currentTimeMillis(); if (lastStartScanTimeStamp != 0) { lastScanDuration = now - lastStartScanTimeStamp; @@ -6021,7 +6025,6 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiPno case WifiMonitor.SCAN_RESULTS_EVENT: case WifiMonitor.SCAN_FAILED_EVENT: maybeRegisterNetworkFactory(); // Make sure our NetworkFactory is registered - closeRadioScanStats(); noteScanEnd(); setScanResults(); if (mIsFullScanOngoing || mSendScanResultsBroadcast) { |