package y3;

import android.content.Context;
import android.content.pm.PackageInfo;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.gms.common.api.internal.a0;
import com.google.android.gms.internal.pal.l1;
import com.google.android.gms.internal.pal.v5;
import com.google.android.gms.internal.pal.y3;
import com.google.android.material.datepicker.MaterialCalendar;
import com.google.android.material.navigation.NavigationBarItemView;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

/* JADX INFO: loaded from: classes.dex */
public final class s implements Runnable {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f36799a;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final Object f36801c;

    public /* synthetic */ s(int i10, int i11, Object obj) {
        this.f36799a = i11;
        this.f36801c = obj;
        this.f36800b = i10;
    }

    @Override // java.lang.Runnable
    public final void run() {
        l1 l1VarA;
        switch (this.f36799a) {
            case 0:
                ((RecyclerView) this.f36801c).smoothScrollToPosition(this.f36800b);
                break;
            case 1:
                ((a0) this.f36801c).e(this.f36800b);
                break;
            case 2:
                y3 y3Var = (y3) this.f36801c;
                if (this.f36800b > 0) {
                    try {
                        Thread.sleep(r2 * 1000);
                        break;
                    } catch (InterruptedException unused) {
                    }
                }
                l1 l1Var = null;
                try {
                    PackageInfo packageInfo = y3Var.f21348a.getPackageManager().getPackageInfo(y3Var.f21348a.getPackageName(), 0);
                    Context context = y3Var.f21348a;
                    try {
                        l1VarA = (l1) new v5(context, context.getPackageName(), Integer.toString(packageInfo.versionCode)).f21278d.poll(5000L, TimeUnit.MILLISECONDS);
                    } catch (InterruptedException unused2) {
                        l1VarA = null;
                    }
                    if (l1VarA == null) {
                        l1VarA = v5.a();
                    }
                    l1Var = l1VarA;
                    break;
                } catch (Throwable unused3) {
                }
                ((y3) this.f36801c).f21357j = l1Var;
                if (this.f36800b < 4) {
                    if (l1Var == null || !l1Var.W() || l1Var.g0().equals("0000000000000000000000000000000000000000000000000000000000000000") || !l1Var.X() || !l1Var.f0().q() || l1Var.f0().n() == -2) {
                        y3 y3Var2 = (y3) this.f36801c;
                        int i10 = this.f36800b + 1;
                        if (y3Var2.f21361n) {
                            Future<?> futureSubmit = y3Var2.f21349b.submit(new s(y3Var2, i10));
                            if (i10 == 0) {
                                y3Var2.f21358k = futureSubmit;
                            }
                        }
                        break;
                    }
                }
                break;
            case 3:
                ((MaterialCalendar) this.f36801c).I0.smoothScrollToPosition(this.f36800b);
                break;
            case 4:
                ((NavigationBarItemView) this.f36801c).l(this.f36800b);
                break;
            default:
                ((com.google.android.material.slider.a) this.f36801c).f23230h.u(this.f36800b, 4);
                break;
        }
    }

    public s(y3 y3Var, int i10) {
        this.f36799a = 2;
        this.f36801c = y3Var;
        this.f36800b = i10;
    }

    public s(RecyclerView recyclerView, int i10) {
        this.f36799a = 0;
        this.f36800b = i10;
        this.f36801c = recyclerView;
    }

    public s(com.google.android.material.slider.a aVar) {
        this.f36799a = 5;
        this.f36801c = aVar;
        this.f36800b = -1;
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ s(com.google.android.material.slider.a aVar, int i10) {
        this(aVar);
        this.f36799a = 5;
    }
}
