Currency Plus v2.10.8版本的 MD5 值为:8586f74edd9ace5aa261a19c9da51484

以下内容为反编译后的 b.java 源代码,内容仅作参考


package v5;

import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import fi.a0;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
public final class b {
    public b6.d f32687a;
    public final Handler f32688b;
    public Runnable f32689c;
    public final Object f32690d;
    public final long f32691e;
    public final Executor f32692f;
    public int f32693g;
    public final long f32694h;
    public b6.c f32695i;
    public boolean f32696j;
    public final v5.a f32697k;
    public final v5.a f32698l;

    public static final class a {
        public a(ti.g gVar) {
        }
    }

    static {
        new a(null);
    }

    public b(long j10, TimeUnit timeUnit, Executor executor) {
        ti.l.f(timeUnit, "autoCloseTimeUnit");
        ti.l.f(executor, "autoCloseExecutor");
        this.f32688b = new Handler(Looper.getMainLooper());
        this.f32690d = new Object();
        this.f32691e = timeUnit.toMillis(j10);
        this.f32692f = executor;
        this.f32694h = SystemClock.uptimeMillis();
        this.f32697k = new Runnable(this) {
            public final b f32686b;

            {
                this.f32686b = this;
            }

            @Override
            public final void run() {
                a0 a0Var;
                switch (r2) {
                    case 0:
                        b bVar = this.f32686b;
                        ti.l.f(bVar, "this$0");
                        bVar.f32692f.execute(bVar.f32698l);
                        return;
                    default:
                        b bVar2 = this.f32686b;
                        ti.l.f(bVar2, "this$0");
                        synchronized (bVar2.f32690d) {
                            try {
                                if (SystemClock.uptimeMillis() - bVar2.f32694h < bVar2.f32691e) {
                                    return;
                                }
                                if (bVar2.f32693g != 0) {
                                    return;
                                }
                                Runnable runnable = bVar2.f32689c;
                                if (runnable != null) {
                                    runnable.run();
                                    a0Var = a0.f17744a;
                                } else {
                                    a0Var = null;
                                }
                                if (a0Var == null) {
                                    throw new IllegalStateException("onAutoCloseCallback is null but it should have been set before use. Please file a bug against Room at: https://issuetracker.google.com/issues/new?component=413107&template=1096568".toString());
                                }
                                b6.c cVar = bVar2.f32695i;
                                if (cVar != null && cVar.isOpen()) {
                                    cVar.close();
                                }
                                bVar2.f32695i = null;
                                a0 a0Var2 = a0.f17744a;
                                return;
                            } catch (Throwable th2) {
                                throw th2;
                            }
                        }
                }
            }
        };
        this.f32698l = new Runnable(this) {
            public final b f32686b;

            {
                this.f32686b = this;
            }

            @Override
            public final void run() {
                a0 a0Var;
                switch (r2) {
                    case 0:
                        b bVar = this.f32686b;
                        ti.l.f(bVar, "this$0");
                        bVar.f32692f.execute(bVar.f32698l);
                        return;
                    default:
                        b bVar2 = this.f32686b;
                        ti.l.f(bVar2, "this$0");
                        synchronized (bVar2.f32690d) {
                            try {
                                if (SystemClock.uptimeMillis() - bVar2.f32694h < bVar2.f32691e) {
                                    return;
                                }
                                if (bVar2.f32693g != 0) {
                                    return;
                                }
                                Runnable runnable = bVar2.f32689c;
                                if (runnable != null) {
                                    runnable.run();
                                    a0Var = a0.f17744a;
                                } else {
                                    a0Var = null;
                                }
                                if (a0Var == null) {
                                    throw new IllegalStateException("onAutoCloseCallback is null but it should have been set before use. Please file a bug against Room at: https://issuetracker.google.com/issues/new?component=413107&template=1096568".toString());
                                }
                                b6.c cVar = bVar2.f32695i;
                                if (cVar != null && cVar.isOpen()) {
                                    cVar.close();
                                }
                                bVar2.f32695i = null;
                                a0 a0Var2 = a0.f17744a;
                                return;
                            } catch (Throwable th2) {
                                throw th2;
                            }
                        }
                }
            }
        };
    }

    public final void a() {
        synchronized (this.f32690d) {
            try {
                int i10 = this.f32693g;
                if (i10 <= 0) {
                    throw new IllegalStateException("ref count is 0 or lower but we're supposed to decrement".toString());
                }
                int i11 = i10 - 1;
                this.f32693g = i11;
                if (i11 == 0) {
                    if (this.f32695i == null) {
                        return;
                    }
                    this.f32688b.postDelayed(this.f32697k, this.f32691e);
                }
                a0 a0Var = a0.f17744a;
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }

    public final <V> V b(si.l<? super b6.c, ? extends V> lVar) {
        ti.l.f(lVar, "block");
        try {
            return lVar.invoke(c());
        } finally {
            a();
        }
    }

    public final b6.c c() {
        synchronized (this.f32690d) {
            this.f32688b.removeCallbacks(this.f32697k);
            this.f32693g++;
            if (!this.f32696j) {
                b6.c cVar = this.f32695i;
                if (cVar == null || !cVar.isOpen()) {
                    b6.d dVar = this.f32687a;
                    if (dVar == null) {
                        ti.l.l("delegateOpenHelper");
                        throw null;
                    }
                    b6.c t02 = dVar.t0();
                    this.f32695i = t02;
                    return t02;
                }
                return cVar;
            }
            throw new IllegalStateException("Attempting to open already closed database.".toString());
        }
    }
}