MyRecorder v1.01.90.0219版本的 MD5 值为:c361f51174a0bf833abfa72929caf8d3

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


package g2;

import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import java.io.IOException;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
public final class c {
    public static final a f43760m = new a(null);
    public j2.h f43761a;
    public final Handler f43762b;
    public Runnable f43763c;
    public final Object f43764d;
    public long f43765e;
    public final Executor f43766f;
    public int f43767g;
    public long f43768h;
    public j2.g f43769i;
    public boolean f43770j;
    public final Runnable f43771k;
    public final Runnable f43772l;

    public static final class a {
        public a() {
        }

        public a(nk.j jVar) {
            this();
        }
    }

    public c(long j10, TimeUnit timeUnit, Executor executor) {
        nk.s.h(timeUnit, "autoCloseTimeUnit");
        nk.s.h(executor, "autoCloseExecutor");
        this.f43762b = new Handler(Looper.getMainLooper());
        this.f43764d = new Object();
        this.f43765e = timeUnit.toMillis(j10);
        this.f43766f = executor;
        this.f43768h = SystemClock.uptimeMillis();
        this.f43771k = new Runnable() {
            @Override
            public final void run() {
                c.f(c.this);
            }
        };
        this.f43772l = new Runnable() {
            @Override
            public final void run() {
                c.c(c.this);
            }
        };
    }

    public static final void c(c cVar) {
        ak.k0 k0Var;
        nk.s.h(cVar, "this$0");
        synchronized (cVar.f43764d) {
            if (SystemClock.uptimeMillis() - cVar.f43768h < cVar.f43765e) {
                return;
            }
            if (cVar.f43767g != 0) {
                return;
            }
            Runnable runnable = cVar.f43763c;
            if (runnable != null) {
                runnable.run();
                k0Var = ak.k0.f364a;
            } else {
                k0Var = null;
            }
            if (k0Var == 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());
            }
            j2.g gVar = cVar.f43769i;
            if (gVar != null && gVar.isOpen()) {
                gVar.close();
            }
            cVar.f43769i = null;
            ak.k0 k0Var2 = ak.k0.f364a;
        }
    }

    public static final void f(c cVar) {
        nk.s.h(cVar, "this$0");
        cVar.f43766f.execute(cVar.f43772l);
    }

    public final void d() throws IOException {
        synchronized (this.f43764d) {
            this.f43770j = true;
            j2.g gVar = this.f43769i;
            if (gVar != null) {
                gVar.close();
            }
            this.f43769i = null;
            ak.k0 k0Var = ak.k0.f364a;
        }
    }

    public final void e() {
        synchronized (this.f43764d) {
            int i10 = this.f43767g;
            if (!(i10 > 0)) {
                throw new IllegalStateException("ref count is 0 or lower but we're supposed to decrement".toString());
            }
            int i11 = i10 - 1;
            this.f43767g = i11;
            if (i11 == 0) {
                if (this.f43769i == null) {
                    return;
                }
                this.f43762b.postDelayed(this.f43771k, this.f43765e);
            }
            ak.k0 k0Var = ak.k0.f364a;
        }
    }

    public final <V> V g(mk.l<? super j2.g, ? extends V> lVar) {
        nk.s.h(lVar, "block");
        try {
            return lVar.invoke(j());
        } finally {
            e();
        }
    }

    public final j2.g h() {
        return this.f43769i;
    }

    public final j2.h i() {
        j2.h hVar = this.f43761a;
        if (hVar != null) {
            return hVar;
        }
        nk.s.z("delegateOpenHelper");
        return null;
    }

    public final j2.g j() {
        synchronized (this.f43764d) {
            this.f43762b.removeCallbacks(this.f43771k);
            this.f43767g++;
            if (!this.f43770j) {
                j2.g gVar = this.f43769i;
                if (gVar == null || !gVar.isOpen()) {
                    j2.g writableDatabase = i().getWritableDatabase();
                    this.f43769i = writableDatabase;
                    return writableDatabase;
                }
                return gVar;
            }
            throw new IllegalStateException("Attempting to open already closed database.".toString());
        }
    }

    public final void k(j2.h hVar) {
        nk.s.h(hVar, "delegateOpenHelper");
        n(hVar);
    }

    public final boolean l() {
        return !this.f43770j;
    }

    public final void m(Runnable runnable) {
        nk.s.h(runnable, "onAutoClose");
        this.f43763c = runnable;
    }

    public final void n(j2.h hVar) {
        nk.s.h(hVar, "<set-?>");
        this.f43761a = hVar;
    }
}