package com.google.android.gms.internal.ads;

import android.os.SystemClock;

/* JADX INFO: loaded from: classes2.dex */
public final class lj2 implements ii2 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public boolean f13740a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public long f13741b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public long f13742c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public wd f13743d;

    public final void a() {
        if (this.f13740a) {
            return;
        }
        this.f13742c = SystemClock.elapsedRealtime();
        this.f13740a = true;
    }

    public final void b() {
        if (this.f13740a) {
            d(zzg());
            this.f13740a = false;
        }
    }

    @Override // com.google.android.gms.internal.ads.ii2
    public final void c(wd wdVar) {
        if (this.f13740a) {
            d(zzg());
        }
        this.f13743d = wdVar;
    }

    public final void d(long j10) {
        this.f13741b = j10;
        if (this.f13740a) {
            this.f13742c = SystemClock.elapsedRealtime();
        }
    }

    @Override // com.google.android.gms.internal.ads.ii2
    public final long zzg() {
        long j10 = this.f13741b;
        if (!this.f13740a) {
            return j10;
        }
        long jElapsedRealtime = SystemClock.elapsedRealtime() - this.f13742c;
        wd wdVar = this.f13743d;
        return j10 + (wdVar.f18031a == 1.0f ? bb1.p(jElapsedRealtime) : jElapsedRealtime * ((long) wdVar.f18033c));
    }

    @Override // com.google.android.gms.internal.ads.ii2
    public final wd zzj() {
        return this.f13743d;
    }
}
