am 3c0ce5ca: fix ArrayIndexOutOfBoundsException while starting WifiScannerScan

* commit '3c0ce5ca14ba13f432f4309c001abcb1d7cfc159':
  fix ArrayIndexOutOfBoundsException while starting WifiScannerScan
This commit is contained in:
Navtej Singh Mann
2015-06-12 00:18:43 +00:00
committed by Android Git Automerger

View File

@@ -4634,7 +4634,7 @@ public final class BatteryStatsImpl extends BatteryStats {
@Override
public void noteWifiBatchedScanStartedLocked(int csph, long elapsedRealtimeMs) {
int bin = 0;
while (csph > 8 && bin < NUM_WIFI_BATCHED_SCAN_BINS) {
while (csph > 8 && bin < NUM_WIFI_BATCHED_SCAN_BINS-1) {
csph = csph >> 3;
bin++;
}