Add empty check for path in UsageGraph
If path is empty, skip method since there is nothing to draw. Bug: 132728523 Test: RunSettingsRoboTests Change-Id: I6fdb7c2f69d3d658c47b58c7304cfeb7d4010a46
This commit is contained in:
@@ -288,7 +288,11 @@ public class UsageGraph extends View {
|
||||
canvas.drawPath(mPath, paint);
|
||||
}
|
||||
|
||||
private void drawFilledPath(Canvas canvas, SparseIntArray localPaths, Paint paint) {
|
||||
@VisibleForTesting
|
||||
void drawFilledPath(Canvas canvas, SparseIntArray localPaths, Paint paint) {
|
||||
if (localPaths.size() == 0) {
|
||||
return;
|
||||
}
|
||||
mPath.reset();
|
||||
float lastStartX = localPaths.keyAt(0);
|
||||
mPath.moveTo(localPaths.keyAt(0), localPaths.valueAt(0));
|
||||
|
Reference in New Issue
Block a user