fix ArrayIndexOutOfBoundsException while starting WifiScannerScan

bug: 21663831
Change-Id: I9aea30907aae00c98d8fb1dc1fff3f4935108fa4
This commit is contained in:
Navtej Singh Mann
2015-06-11 16:53:11 -07:00
parent d7118bcc31
commit 3c0ce5ca14

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++;
}