- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
46 lines
1.1 KiB
Java
46 lines
1.1 KiB
Java
package com.helpshift.poller;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public class ExponentialBackoff {
|
|
public int baseInterval;
|
|
public int currentInterval;
|
|
public int maxInterval;
|
|
|
|
public int nextInterval(int i) {
|
|
if (i == 0) {
|
|
return this.currentInterval;
|
|
}
|
|
if ((i < 200 || i >= 400) && i < 500) {
|
|
this.currentInterval = -1;
|
|
} else {
|
|
int i2 = this.currentInterval;
|
|
int i3 = i2 * 2;
|
|
int i4 = this.maxInterval;
|
|
if (i3 <= i4) {
|
|
i4 = i2 * 2;
|
|
}
|
|
this.currentInterval = i4;
|
|
}
|
|
return this.currentInterval;
|
|
}
|
|
|
|
public void reconcileIntervals(int i, int i2) {
|
|
if (this.baseInterval == i && this.maxInterval == i2) {
|
|
return;
|
|
}
|
|
this.baseInterval = i;
|
|
this.maxInterval = i2;
|
|
this.currentInterval = i;
|
|
}
|
|
|
|
public void reset() {
|
|
this.currentInterval = this.baseInterval;
|
|
}
|
|
|
|
public ExponentialBackoff(int i, int i2) {
|
|
this.baseInterval = i;
|
|
this.maxInterval = i2;
|
|
this.currentInterval = i;
|
|
}
|
|
}
|