package defpackage;

import android.media.NotProvisionedException;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.SystemClock;
import android.util.Pair;
import androidx.media3.exoplayer.drm.DrmSession$DrmSessionException;
import androidx.media3.exoplayer.drm.KeysExpiredException;
import j$.util.DesugarCollections;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

/* renamed from: ˎʛːʾ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C1669 implements InterfaceC1660 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final boolean f6637;

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public int f6638;

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final UUID f6639;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final HashMap f6640;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final boolean f6641;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final ᵪᵨ f6642;

    /* renamed from: ˑᵱ, reason: contains not printable characters */
    public DrmSession$DrmSessionException f6643;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final C1899 f6644;

    /* renamed from: ᵞʡ, reason: contains not printable characters */
    public HandlerC3557 f6645;

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public int f6646;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public byte[] f6647;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public C5353 f6648;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final List f6649;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public byte[] f6650;

    /* renamed from: ᵨᵳʝ, reason: contains not printable characters */
    public C4641 f6651;

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public final HandlerC3737 f6652;

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final Looper f6653;

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public final Object f6654;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final InterfaceC3599 f6655;

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final C1545 f6656;

    /* renamed from: ᵸʓᵠ, reason: contains not printable characters */
    public HandlerThread f6657;

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final InterfaceC3227 f6658;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final C3244 f6659;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final C3718 f6660;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public ˑᵽʾʦ f6661;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public C0895 f6662;

    public C1669(UUID uuid, InterfaceC3599 interfaceC3599, ᵪᵨ r3, C3718 c3718, List list, boolean z, boolean z2, byte[] bArr, HashMap map, InterfaceC3227 interfaceC3227, Looper looper, C1899 c1899, C1545 c1545) {
        this.f6639 = uuid;
        this.f6642 = r3;
        this.f6660 = c3718;
        this.f6655 = interfaceC3599;
        this.f6637 = z;
        this.f6641 = z2;
        if (bArr != null) {
            this.f6647 = bArr;
            this.f6649 = null;
        } else {
            list.getClass();
            this.f6649 = DesugarCollections.unmodifiableList(list);
        }
        this.f6640 = map;
        this.f6658 = interfaceC3227;
        this.f6659 = new C3244();
        this.f6644 = c1899;
        this.f6656 = c1545;
        this.f6638 = 2;
        this.f6653 = looper;
        this.f6652 = new HandlerC3737(this, looper, 2);
        this.f6654 = new Object();
    }

    @Override // defpackage.InterfaceC1660
    /* renamed from: ˇʼʤˎ */
    public final int mo4739() {
        m4792();
        return this.f6638;
    }

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public final void m4792() {
        Thread threadCurrentThread = Thread.currentThread();
        Looper looper = this.f6653;
        if (threadCurrentThread != looper.getThread()) {
            ᵳʿˉ.ˁˑᵰ("DefaultDrmSession accessed on the wrong thread.\nCurrent thread: " + Thread.currentThread().getName() + "\nExpected thread: " + looper.getThread().getName(), new IllegalStateException());
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x001d  */
    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void m4793(int r6, java.lang.Throwable r7) {
        /*
            r5 = this;
            androidx.media3.exoplayer.drm.DrmSession$DrmSessionException r0 = new androidx.media3.exoplayer.drm.DrmSession$DrmSessionException
            boolean r1 = r7 instanceof android.media.MediaDrm.MediaDrmStateException
            r2 = 1
            if (r1 == 0) goto L17
            r6 = r7
            android.media.MediaDrm$MediaDrmStateException r6 = (android.media.MediaDrm.MediaDrmStateException) r6
            java.lang.String r6 = r6.getDiagnosticInfo()
            int r6 = defpackage.AbstractC3558.m8131(r6)
            int r6 = defpackage.AbstractC3558.m8103(r6)
            goto L5a
        L17:
            boolean r1 = r7 instanceof android.media.MediaDrmResetException
            r3 = 6006(0x1776, float:8.416E-42)
            if (r1 == 0) goto L1f
        L1d:
            r6 = r3
            goto L5a
        L1f:
            boolean r1 = r7 instanceof android.media.NotProvisionedException
            r4 = 6002(0x1772, float:8.41E-42)
            if (r1 != 0) goto L54
            boolean r1 = ᵯˉˋ.ᵧᵾˀˈ(r7)
            if (r1 == 0) goto L2c
            goto L54
        L2c:
            boolean r1 = r7 instanceof android.media.DeniedByServerException
            if (r1 == 0) goto L33
            r6 = 6007(0x1777, float:8.418E-42)
            goto L5a
        L33:
            boolean r1 = r7 instanceof androidx.media3.exoplayer.drm.UnsupportedDrmException
            if (r1 == 0) goto L3a
            r6 = 6001(0x1771, float:8.409E-42)
            goto L5a
        L3a:
            boolean r1 = r7 instanceof androidx.media3.exoplayer.drm.DefaultDrmSessionManager$MissingSchemeDataException
            if (r1 == 0) goto L41
            r6 = 6003(0x1773, float:8.412E-42)
            goto L5a
        L41:
            boolean r1 = r7 instanceof androidx.media3.exoplayer.drm.KeysExpiredException
            if (r1 == 0) goto L48
            r6 = 6008(0x1778, float:8.419E-42)
            goto L5a
        L48:
            if (r6 != r2) goto L4b
            goto L1d
        L4b:
            r1 = 2
            if (r6 != r1) goto L51
            r6 = 6004(0x1774, float:8.413E-42)
            goto L5a
        L51:
            r1 = 3
            if (r6 != r1) goto L56
        L54:
            r6 = r4
            goto L5a
        L56:
            ᵨᴵᵺ.ᵻᵢﹳᵰ()
            return
        L5a:
            r0.<init>(r6, r7)
            r5.f6643 = r0
            java.lang.String r6 = "DRM session error"
            ᵳʿˉ.ᵸˑ(r6, r7)
            boolean r6 = r7 instanceof java.lang.Exception
            if (r6 == 0) goto L8a
            ᵢʝᵱᵦ r6 = r5.f6659
            java.lang.Object r0 = r6.f12206
            monitor-enter(r0)
            java.util.Set r6 = r6.f12208     // Catch: java.lang.Throwable -> L87
            monitor-exit(r0)     // Catch: java.lang.Throwable -> L87
            java.util.Iterator r6 = r6.iterator()
        L74:
            boolean r0 = r6.hasNext()
            if (r0 == 0) goto L9e
            java.lang.Object r0 = r6.next()
            ᵔːⁱ r0 = (defpackage.C2221) r0
            r1 = r7
            java.lang.Exception r1 = (java.lang.Exception) r1
            r0.m5885(r1)
            goto L74
        L87:
            r5 = move-exception
            monitor-exit(r0)     // Catch: java.lang.Throwable -> L87
            throw r5
        L8a:
            boolean r6 = r7 instanceof java.lang.Error
            if (r6 == 0) goto La6
            boolean r6 = ᵯˉˋ.ᵢˇᵭ(r7)
            if (r6 != 0) goto L9e
            boolean r6 = ᵯˉˋ.ᵧᵾˀˈ(r7)
            if (r6 == 0) goto L9b
            goto L9e
        L9b:
            java.lang.Error r7 = (java.lang.Error) r7
            throw r7
        L9e:
            int r6 = r5.f6638
            r7 = 4
            if (r6 == r7) goto La5
            r5.f6638 = r2
        La5:
            return
        La6:
            java.lang.String r5 = "Unexpected Throwable subclass"
            defpackage.C1260.m3810(r5, r7)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C1669.m4793(int, java.lang.Throwable):void");
    }

    @Override // defpackage.InterfaceC1660
    /* renamed from: ˎˏʜʾ */
    public final DrmSession$DrmSessionException mo4740() {
        m4792();
        if (this.f6638 == 1) {
            return this.f6643;
        }
        return null;
    }

    @Override // defpackage.InterfaceC1660
    /* renamed from: ˏˋٴ */
    public final boolean mo4741(String str) {
        m4792();
        byte[] bArr = this.f6650;
        bArr.getClass();
        return this.f6655.mo1453(str, bArr);
    }

    @Override // defpackage.InterfaceC1660
    /* renamed from: ˏᵙ */
    public final void mo4742(C2221 c2221) {
        m4792();
        int i = this.f6646;
        if (i <= 0) {
            ᵳʿˉ.ᵶᵷᵕ("release() called on a session that's already fully released.");
            return;
        }
        int i2 = i - 1;
        this.f6646 = i2;
        if (i2 == 0) {
            this.f6638 = 0;
            HandlerC3737 handlerC3737 = this.f6652;
            String str = AbstractC3558.f13329;
            handlerC3737.removeCallbacksAndMessages(null);
            this.f6645.m8100();
            this.f6645 = null;
            this.f6657.quit();
            this.f6657 = null;
            this.f6651 = null;
            this.f6643 = null;
            this.f6662 = null;
            synchronized (this.f6654) {
                this.f6661 = null;
            }
            this.f6648 = null;
            byte[] bArr = this.f6650;
            if (bArr != null) {
                this.f6655.mo1452(bArr);
                this.f6650 = null;
            }
        }
        if (c2221 != null) {
            this.f6659.m7580(c2221);
            if (this.f6659.m7581(c2221) == 0) {
                c2221.m5881();
            }
        }
        C3718 c3718 = this.f6660;
        int i3 = this.f6646;
        C4788 c4788 = (C4788) c3718.f13883;
        if (i3 == 1 && c4788.f17782 > 0 && c4788.f17779 != -9223372036854775807L) {
            c4788.f17793.add(this);
            Handler handler = c4788.f17785;
            handler.getClass();
            handler.postAtTime(new RunnableC3566(15, this), this, SystemClock.uptimeMillis() + c4788.f17779);
        } else if (i3 == 0) {
            c4788.f17791.remove(this);
            if (c4788.f17777 == this) {
                c4788.f17777 = null;
            }
            if (c4788.f17796 == this) {
                c4788.f17796 = null;
            }
            ᵪᵨ r0 = c4788.f17776;
            HashSet hashSet = (HashSet) r0.ᵢˇᵭ;
            hashSet.remove(this);
            if (((C1669) r0.ᵿʗᵝʽ) == this) {
                r0.ᵿʗᵝʽ = null;
                if (!hashSet.isEmpty()) {
                    C1669 c1669 = (C1669) hashSet.iterator().next();
                    r0.ᵿʗᵝʽ = c1669;
                    C5353 c5353Mo1450 = c1669.f6655.mo1450();
                    c1669.f6648 = c5353Mo1450;
                    HandlerC3557 handlerC3557 = c1669.f6645;
                    String str2 = AbstractC3558.f13329;
                    c5353Mo1450.getClass();
                    handlerC3557.getClass();
                    handlerC3557.obtainMessage(1, new C4961(C0417.f2319.getAndIncrement(), true, SystemClock.elapsedRealtime(), c5353Mo1450)).sendToTarget();
                }
            }
            if (c4788.f17779 != -9223372036854775807L) {
                Handler handler2 = c4788.f17785;
                handler2.getClass();
                handler2.removeCallbacksAndMessages(this);
                c4788.f17793.remove(this);
            }
        }
        c4788.m10110();
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final void m4794(InterfaceC4038 interfaceC4038) {
        Set set;
        C3244 c3244 = this.f6659;
        synchronized (c3244.f12206) {
            set = c3244.f12208;
        }
        Iterator it = set.iterator();
        while (it.hasNext()) {
            interfaceC4038.accept((C2221) it.next());
        }
    }

    @Override // defpackage.InterfaceC1660
    /* renamed from: ᵥᵯˎ */
    public final UUID mo4743() {
        m4792();
        return this.f6639;
    }

    /* JADX WARN: Removed duplicated region for block: B:24:0x0053  */
    /* JADX WARN: Removed duplicated region for block: B:25:0x0059  */
    /* renamed from: ᵪʩ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean m4795() {
        /*
            r4 = this;
            boolean r0 = r4.m4799()
            r1 = 1
            if (r0 == 0) goto L8
            return r1
        L8:
            ᵦᵬᵴ r0 = r4.f6655     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            byte[] r0 = r0.mo1459()     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            r4.f6650 = r0     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            ᵦᵬᵴ r2 = r4.f6655     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            ˋᵺᵣ r3 = r4.f6656     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            r2.mo1455(r0, r3)     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            ᵦᵬᵴ r0 = r4.f6655     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            byte[] r2 = r4.f6650     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            ᵴˊˏ r0 = r0.mo1458(r2)     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            r4.f6651 = r0     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            r0 = 3
            r4.f6638 = r0     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            ᵢʝᵱᵦ r2 = r4.f6659     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            java.lang.Object r3 = r2.f12206     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            monitor-enter(r3)     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            java.util.Set r2 = r2.f12208     // Catch: java.lang.Throwable -> L4a
            monitor-exit(r3)     // Catch: java.lang.Throwable -> L4a
            java.util.Iterator r2 = r2.iterator()     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
        L30:
            boolean r3 = r2.hasNext()     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            if (r3 == 0) goto L40
            java.lang.Object r3 = r2.next()     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            ᵔːⁱ r3 = (defpackage.C2221) r3     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            r3.m5882(r0)     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            goto L30
        L40:
            byte[] r0 = r4.f6650     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            r0.getClass()     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
            return r1
        L46:
            r0 = move-exception
            goto L4d
        L48:
            r0 = move-exception
            goto L4d
        L4a:
            r0 = move-exception
            monitor-exit(r3)     // Catch: java.lang.Throwable -> L4a
            throw r0     // Catch: java.lang.NoSuchMethodError -> L46 java.lang.Exception -> L48 android.media.NotProvisionedException -> L5d
        L4d:
            boolean r2 = ᵯˉˋ.ᵧᵾˀˈ(r0)
            if (r2 == 0) goto L59
            ᵪᵨ r0 = r4.f6642
            r0.ᵡⁱᵥ(r4)
            goto L62
        L59:
            r4.m4793(r1, r0)
            goto L62
        L5d:
            ᵪᵨ r0 = r4.f6642
            r0.ᵡⁱᵥ(r4)
        L62:
            r4 = 0
            return r4
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C1669.m4795():boolean");
    }

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final void m4796(Throwable th, boolean z) {
        if ((th instanceof NotProvisionedException) || ᵯˉˋ.ᵧᵾˀˈ(th)) {
            this.f6642.ᵡⁱᵥ(this);
        } else {
            m4793(z ? 1 : 2, th);
        }
    }

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public final void m4797(int i, boolean z, byte[] bArr) {
        try {
            synchronized (this.f6654) {
                try {
                    this.f6661 = new ˑᵽʾʦ((byte) 0, 5);
                    List list = this.f6649;
                    if (list != null) {
                        AbstractC2692.m6700(list);
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
            C0895 c0895Mo1454 = this.f6655.mo1454(bArr, this.f6649, i, this.f6640);
            this.f6662 = c0895Mo1454;
            HandlerC3557 handlerC3557 = this.f6645;
            String str = AbstractC3558.f13329;
            c0895Mo1454.getClass();
            handlerC3557.getClass();
            handlerC3557.obtainMessage(2, new C4961(C0417.f2319.getAndIncrement(), z, SystemClock.elapsedRealtime(), c0895Mo1454)).sendToTarget();
        } catch (Exception | NoSuchMethodError e) {
            m4796(e, true);
        }
    }

    @Override // defpackage.InterfaceC1660
    /* renamed from: ᵴᵳ */
    public final boolean mo4744() {
        m4792();
        return this.f6637;
    }

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final void m4798(boolean z) {
        long jMin;
        String str;
        Set set;
        if (this.f6641) {
            return;
        }
        byte[] bArr = this.f6650;
        String str2 = AbstractC3558.f13329;
        boolean z2 = true;
        if (this.f6647 == null) {
            m4797(1, z, bArr);
            return;
        }
        if (this.f6638 != 4) {
            try {
                this.f6655.mo1461(this.f6650, this.f6647);
            } catch (Exception | NoSuchMethodError e) {
                m4793(1, e);
                z2 = false;
            }
            if (!z2) {
                return;
            }
        }
        if (AbstractC1360.f5608.equals(this.f6639)) {
            m4792();
            byte[] bArr2 = this.f6650;
            Pair pair = null;
            Map mapMo1460 = bArr2 == null ? null : this.f6655.mo1460(bArr2);
            if (mapMo1460 != null) {
                long j = -9223372036854775807L;
                try {
                    str = (String) mapMo1460.get("LicenseDurationRemaining");
                } catch (NumberFormatException unused) {
                }
                long j2 = str != null ? Long.parseLong(str) : -9223372036854775807L;
                Long lValueOf = Long.valueOf(j2);
                try {
                    String str3 = (String) mapMo1460.get("PlaybackDurationRemaining");
                    if (str3 != null) {
                        j = Long.parseLong(str3);
                    }
                } catch (NumberFormatException unused2) {
                }
                pair = new Pair(lValueOf, Long.valueOf(j));
            }
            pair.getClass();
            jMin = Math.min(((Long) pair.first).longValue(), ((Long) pair.second).longValue());
        } else {
            jMin = Long.MAX_VALUE;
        }
        if (jMin <= 60) {
            ᵳʿˉ.ᵝᵵᵺ("Offline license has expired or will expire soon. Remaining seconds: " + jMin);
            m4797(2, z, bArr);
            return;
        }
        if (jMin <= 0) {
            m4793(2, new KeysExpiredException());
            return;
        }
        this.f6638 = 4;
        C3244 c3244 = this.f6659;
        synchronized (c3244.f12206) {
            set = c3244.f12208;
        }
        Iterator it = set.iterator();
        while (it.hasNext()) {
            ((C2221) it.next()).m5884();
        }
    }

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final boolean m4799() {
        int i = this.f6638;
        return i == 3 || i == 4;
    }

    @Override // defpackage.InterfaceC1660
    /* renamed from: ᵹᵝᵶ */
    public final C4641 mo4745() {
        m4792();
        return this.f6651;
    }

    @Override // defpackage.InterfaceC1660
    /* renamed from: ᵻᵢﹳᵰ */
    public final void mo4746(C2221 c2221) {
        m4792();
        if (this.f6646 < 0) {
            ᵳʿˉ.ᵶᵷᵕ("Session reference count less than zero: " + this.f6646);
            this.f6646 = 0;
        }
        if (c2221 != null) {
            C3244 c3244 = this.f6659;
            synchronized (c3244.f12206) {
                try {
                    ArrayList arrayList = new ArrayList(c3244.f12207);
                    arrayList.add(c2221);
                    c3244.f12207 = DesugarCollections.unmodifiableList(arrayList);
                    Integer num = (Integer) c3244.f12205.get(c2221);
                    if (num == null) {
                        HashSet hashSet = new HashSet(c3244.f12208);
                        hashSet.add(c2221);
                        c3244.f12208 = DesugarCollections.unmodifiableSet(hashSet);
                    }
                    c3244.f12205.put(c2221, Integer.valueOf(num != null ? num.intValue() + 1 : 1));
                } finally {
                }
            }
        }
        int i = this.f6646 + 1;
        this.f6646 = i;
        if (i == 1) {
            ᵛᵾˏ.ᵿʗᵝʽ(this.f6638 == 2);
            HandlerThread handlerThread = new HandlerThread("ExoPlayer:DrmRequestHandler");
            this.f6657 = handlerThread;
            handlerThread.start();
            this.f6645 = new HandlerC3557(this, this.f6657.getLooper());
            if (m4795()) {
                m4798(true);
            }
        } else if (c2221 != null && m4799() && this.f6659.m7581(c2221) == 1) {
            c2221.m5882(this.f6638);
        }
        C4788 c4788 = (C4788) this.f6660.f13883;
        if (c4788.f17779 != -9223372036854775807L) {
            c4788.f17793.remove(this);
            Handler handler = c4788.f17785;
            handler.getClass();
            handler.removeCallbacksAndMessages(this);
        }
    }
}
