package c.l;

import android.os.Handler;
import c.l.j;
import c.l.x;

/* JADX INFO: compiled from: ProcessLifecycleOwner.java */
/* JADX INFO: loaded from: classes.dex */
public class v implements n {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final v f1787b = new v();

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public Handler f1792i;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f1788e = 0;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public int f1789f = 0;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public boolean f1790g = true;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public boolean f1791h = true;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final o f1793j = new o(this);

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public Runnable f1794k = new a();

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public x.a f1795l = new b();

    /* JADX INFO: compiled from: ProcessLifecycleOwner.java */
    public class a implements Runnable {
        public a() {
        }

        @Override // java.lang.Runnable
        public void run() {
            v vVar = v.this;
            if (vVar.f1789f == 0) {
                vVar.f1790g = true;
                vVar.f1793j.f(j.a.ON_PAUSE);
            }
            v vVar2 = v.this;
            if (vVar2.f1788e == 0 && vVar2.f1790g) {
                vVar2.f1793j.f(j.a.ON_STOP);
                vVar2.f1791h = true;
            }
        }
    }

    /* JADX INFO: compiled from: ProcessLifecycleOwner.java */
    public class b implements x.a {
        public b() {
        }
    }

    public void a() {
        int i2 = this.f1789f + 1;
        this.f1789f = i2;
        if (i2 == 1) {
            if (!this.f1790g) {
                this.f1792i.removeCallbacks(this.f1794k);
            } else {
                this.f1793j.f(j.a.ON_RESUME);
                this.f1790g = false;
            }
        }
    }

    public void b() {
        int i2 = this.f1788e + 1;
        this.f1788e = i2;
        if (i2 == 1 && this.f1791h) {
            this.f1793j.f(j.a.ON_START);
            this.f1791h = false;
        }
    }

    @Override // c.l.n
    public j getLifecycle() {
        return this.f1793j;
    }
}
