package androidx.media3.datasource;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import androidx.room.RoomDatabase;
import com.bumptech.glide.load.engine.p;
import com.google.firebase.messaging.a0;
import com.google.firebase.messaging.j;
import java.util.concurrent.Callable;
import sd.l;
import vf.d0;
import vf.i;
import vf.k;
import xyz.stream.api.database.entity.ServerEntity;
import xyz.stream.utils.h;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class c implements Callable {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Object f2828b;

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

    public /* synthetic */ c(Object obj, Object obj2, int i10) {
        this.f2827a = i10;
        this.f2828b = obj;
        this.f2829c = obj2;
    }

    @Override // java.util.concurrent.Callable
    public final Object call() {
        Integer numValueOf;
        int i10 = this.f2827a;
        final int i11 = 1;
        final int i12 = 0;
        Object obj = this.f2829c;
        Object obj2 = this.f2828b;
        switch (i10) {
            case 0:
                return ((DataSourceBitmapLoader) obj2).lambda$decodeBitmap$1((byte[]) obj);
            case 1:
                return ((DataSourceBitmapLoader) obj2).lambda$loadBitmap$2((Uri) obj);
            case 2:
                Object obj3 = j.f24191c;
                return Integer.valueOf(a0.a().d((Context) obj2, (Intent) obj));
            case 3:
                xyz.stream.api.database.f fVar = (xyz.stream.api.database.f) obj2;
                final ServerEntity serverEntity = (ServerEntity) obj;
                xyz.stream.api.database.f fVar2 = xyz.stream.api.database.f.f35806f;
                fVar.getClass();
                try {
                    d0 d0VarServerDao = fVar.f35808a.serverDao();
                    int iIntValue = serverEntity.getId().intValue();
                    i iVar = (i) d0VarServerDao;
                    iVar.getClass();
                    ServerEntity serverEntity2 = (ServerEntity) androidx.room.util.b.b(iVar.f33973a, true, false, new h3.d(iIntValue, 6));
                    if (serverEntity2 != null) {
                        final i iVar2 = (i) fVar.f35808a.serverDao();
                        iVar2.getClass();
                        androidx.room.util.b.b(iVar2.f33973a, false, true, new l() { // from class: vf.e0
                            @Override // sd.l
                            public final Object invoke(Object obj4) {
                                int i13 = i12;
                                ServerEntity serverEntity3 = serverEntity;
                                i iVar3 = iVar2;
                                switch (i13) {
                                    case 0:
                                        iVar3.f33976d.handle((k3.a) obj4, serverEntity3);
                                        return null;
                                    default:
                                        return Long.valueOf(iVar3.f33974b.insertAndReturnId((k3.a) obj4, serverEntity3));
                                }
                            }
                        });
                        numValueOf = serverEntity2.getId();
                    } else {
                        final i iVar3 = (i) fVar.f35808a.serverDao();
                        iVar3.getClass();
                        numValueOf = Integer.valueOf((int) ((Long) androidx.room.util.b.b(iVar3.f33973a, false, true, new l() { // from class: vf.e0
                            @Override // sd.l
                            public final Object invoke(Object obj4) {
                                int i13 = i11;
                                ServerEntity serverEntity3 = serverEntity;
                                i iVar32 = iVar3;
                                switch (i13) {
                                    case 0:
                                        iVar32.f33976d.handle((k3.a) obj4, serverEntity3);
                                        return null;
                                    default:
                                        return Long.valueOf(iVar32.f33974b.insertAndReturnId((k3.a) obj4, serverEntity3));
                                }
                            }
                        })).longValue());
                    }
                    return numValueOf;
                } catch (Exception e10) {
                    h.c("insertOrUpdateServer inner error: " + e10.getMessage());
                    return -1;
                }
            default:
                xyz.stream.api.database.f fVar3 = (xyz.stream.api.database.f) obj2;
                Integer num = (Integer) obj;
                androidx.room.util.b.b((RoomDatabase) ((p) fVar3.f35808a.liveDao()).f5756a, false, true, new k(2, num));
                androidx.room.util.b.b((RoomDatabase) ((p) fVar3.f35808a.liveDao()).f5756a, false, true, new k(1, num));
                i iVar4 = (i) fVar3.f35808a.serverDao();
                iVar4.getClass();
                androidx.room.util.b.b(iVar4.f33973a, false, true, new k(4, num));
                i iVar5 = (i) fVar3.f35808a.iptvDao();
                iVar5.getClass();
                androidx.room.util.b.b(iVar5.f33973a, false, true, new k(0, num));
                return Boolean.TRUE;
        }
    }
}
