Skip to content
Snippets Groups Projects
Commit bec242ac authored by lijilou's avatar lijilou
Browse files

BatteryStatsImpl:fix ArithmeticException due to list size is zero.

Test: OEM monkey test
Bug: 341658103
Change-Id: Idfc3db1c0ea3be536cad82bf98fab6d668d26a36
parent 2417c31f
No related branches found
No related tags found
No related merge requests found
......@@ -3377,7 +3377,7 @@ public class BatteryStatsImpl extends BatteryStats {
}
return mTotalTimeUs + (mNesting > 0
? (curBatteryRealtimeUs - mUpdateTimeUs)
/ (mTimerPool != null ? mTimerPool.size() : 1)
/ (mTimerPool != null && mTimerPool.size() > 0 ? mTimerPool.size() : 1)
: 0);
}
 
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment