package com.google.firebase.perf.metrics; import android.util.SparseIntArray; /* loaded from: classes3.dex */ public abstract class FrameMetricsCalculator { public static class PerfFrameMetrics { public int frozenFrames; public int slowFrames; public int totalFrames; public int getFrozenFrames() { return this.frozenFrames; } public int getSlowFrames() { return this.slowFrames; } public int getTotalFrames() { return this.totalFrames; } public PerfFrameMetrics(int i, int i2, int i3) { this.totalFrames = i; this.slowFrames = i2; this.frozenFrames = i3; } public PerfFrameMetrics deltaFrameMetricsFromSnapshot(PerfFrameMetrics perfFrameMetrics) { return new PerfFrameMetrics(this.totalFrames - perfFrameMetrics.getTotalFrames(), this.slowFrames - perfFrameMetrics.getSlowFrames(), this.frozenFrames - perfFrameMetrics.getFrozenFrames()); } } public static PerfFrameMetrics calculateFrameMetrics(SparseIntArray[] sparseIntArrayArr) { int i; int i2; SparseIntArray sparseIntArray; int i3 = 0; if (sparseIntArrayArr == null || (sparseIntArray = sparseIntArrayArr[0]) == null) { i = 0; i2 = 0; } else { int i4 = 0; i = 0; i2 = 0; while (i3 < sparseIntArray.size()) { int keyAt = sparseIntArray.keyAt(i3); int valueAt = sparseIntArray.valueAt(i3); i4 += valueAt; if (keyAt > 700) { i2 += valueAt; } if (keyAt > 16) { i += valueAt; } i3++; } i3 = i4; } return new PerfFrameMetrics(i3, i, i2); } }