package androidx.media3.common.util;

import android.content.Intent;
import android.content.IntentSender;
import androidx.media3.common.util.ListenerSet;
import androidx.media3.exoplayer.drm.DrmSessionEventListener;
import d.C1831j;
import g.C2051e;
import g.InterfaceC2048b;
import h.C2067a;
import java.io.Serializable;
import java.util.concurrent.CopyOnWriteArraySet;
import kotlin.jvm.internal.o;
import l2.C2449a;
import l2.d;

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

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

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

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

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

    public /* synthetic */ b(DrmSessionEventListener.EventDispatcher eventDispatcher, DrmSessionEventListener drmSessionEventListener, int i6) {
        this.f12270a = 1;
        this.f12272c = eventDispatcher;
        this.f12273d = drmSessionEventListener;
        this.f12271b = i6;
    }

    @Override // java.lang.Runnable
    public final void run() {
        switch (this.f12270a) {
            case 0:
                ListenerSet.lambda$queueEvent$0((CopyOnWriteArraySet) this.f12272c, this.f12271b, (ListenerSet.Event) this.f12273d);
                break;
            case 1:
                ((DrmSessionEventListener.EventDispatcher) this.f12272c).lambda$drmSessionAcquired$0((DrmSessionEventListener) this.f12273d, this.f12271b);
                break;
            case 2:
                Serializable serializable = ((C2067a) this.f12273d).f16611a;
                C1831j c1831j = (C1831j) this.f12272c;
                String str = (String) c1831j.f16446a.get(Integer.valueOf(this.f12271b));
                if (str != null) {
                    C2051e c2051e = (C2051e) c1831j.f16450e.get(str);
                    if ((c2051e != null ? c2051e.f16437a : null) != null) {
                        InterfaceC2048b interfaceC2048b = c2051e.f16437a;
                        o.f(interfaceC2048b, "null cannot be cast to non-null type androidx.activity.result.ActivityResultCallback<O of androidx.activity.result.ActivityResultRegistry.dispatchResult>");
                        if (c1831j.f16449d.remove(str)) {
                            interfaceC2048b.onActivityResult(serializable);
                        }
                    } else {
                        c1831j.f16452g.remove(str);
                        c1831j.f16451f.put(str, serializable);
                    }
                    break;
                }
                break;
            case 3:
                ((C1831j) this.f12272c).a(this.f12271b, 0, new Intent().setAction("androidx.activity.result.contract.action.INTENT_SENDER_REQUEST").putExtra("androidx.activity.result.contract.extra.SEND_INTENT_EXCEPTION", (IntentSender.SendIntentException) this.f12273d));
                break;
            default:
                ((d) ((C2449a) this.f12272c).f20251c).a(this.f12271b, (Serializable) this.f12273d);
                break;
        }
    }

    public /* synthetic */ b(Object obj, int i6, Object obj2, int i7) {
        this.f12270a = i7;
        this.f12272c = obj;
        this.f12271b = i6;
        this.f12273d = obj2;
    }
}
