package com.google.android.gms.internal.ads;

import android.os.RemoteException;
import androidx.annotation.Nullable;
import androidx.media3.exoplayer.rtsp.SessionDescription;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/* JADX INFO: loaded from: classes2.dex */
public final class m60 extends n7.o2 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final c40 f13978a;

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final boolean f13981d;

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public boolean f13983f;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public float f13985h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public float f13986i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public float f13987j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public boolean f13988k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public boolean f13989l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public tr f13990m;

    @Nullable
    private n7.r2 zzf;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Object f13979b = new Object();

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public boolean f13984g = true;

    public m60(c40 c40Var, float f10, boolean z10, boolean z11) {
        this.f13978a = c40Var;
        this.f13985h = f10;
        this.f13980c = z10;
        this.f13981d = z11;
    }

    private final void zzw(String str, @Nullable Map map) {
        HashMap map2 = map == null ? new HashMap() : new HashMap(map);
        map2.put("action", str);
        b30.f9364f.execute(new bv(this, map2, 19));
    }

    @Override // n7.p2
    public final void I(boolean z10) {
        zzw(true != z10 ? "unmute" : "mute", null);
    }

    public final void S2(n7.u3 u3Var) {
        Object obj = this.f13979b;
        boolean z10 = u3Var.f31064b;
        boolean z11 = u3Var.f31065c;
        synchronized (obj) {
            this.f13988k = z10;
            this.f13989l = z11;
        }
        boolean z12 = u3Var.f31063a;
        String str = true != z10 ? SessionDescription.SUPPORTED_SDP_VERSION : "1";
        String str2 = true != z11 ? SessionDescription.SUPPORTED_SDP_VERSION : "1";
        String str3 = true != z12 ? SessionDescription.SUPPORTED_SDP_VERSION : "1";
        androidx.collection.f fVar = new androidx.collection.f(3);
        fVar.put("muteStart", str3);
        fVar.put("customControlsRequested", str);
        fVar.put("clickToExpandRequested", str2);
        zzw("initialState", Collections.unmodifiableMap(fVar));
    }

    public final void T2(float f10, float f11, float f12, int i10, boolean z10) {
        boolean z11;
        boolean z12;
        int i11;
        synchronized (this.f13979b) {
            try {
                z11 = true;
                if (f11 == this.f13985h && f12 == this.f13987j) {
                    z11 = false;
                }
                this.f13985h = f11;
                if (!((Boolean) n7.y.f31093e.f31096c.b(ao.Zd)).booleanValue()) {
                    this.f13986i = f10;
                }
                z12 = this.f13984g;
                this.f13984g = z10;
                i11 = this.f13982e;
                this.f13982e = i10;
                float f13 = this.f13987j;
                this.f13987j = f12;
                if (Math.abs(f12 - f13) > 1.0E-4f) {
                    this.f13978a.o().invalidate();
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        if (z11) {
            try {
                tr trVar = this.f13990m;
                if (trVar != null) {
                    trVar.O0(2, trVar.O());
                }
            } catch (RemoteException e10) {
                q7.j.zzl("#007 Could not call remote method.", e10);
            }
        }
        b30.f9364f.execute(new l60(this, i11, i10, z12, z10));
    }

    public final /* synthetic */ void U2(int i10, int i11, boolean z10, boolean z11) {
        int i12;
        boolean z12;
        boolean z13;
        n7.r2 r2Var;
        n7.r2 r2Var2;
        n7.r2 r2Var3;
        synchronized (this.f13979b) {
            try {
                boolean z14 = this.f13983f;
                if (z14 || i11 != 1) {
                    i12 = i11;
                    z12 = false;
                } else {
                    i11 = 1;
                    i12 = 1;
                    z12 = true;
                }
                boolean z15 = i10 != i11;
                if (z15 && i12 == 1) {
                    z13 = true;
                    i12 = 1;
                } else {
                    z13 = false;
                }
                boolean z16 = z15 && i12 == 2;
                boolean z17 = z15 && i12 == 3;
                this.f13983f = z14 || z12;
                if (z12) {
                    try {
                        n7.r2 r2Var4 = this.zzf;
                        if (r2Var4 != null) {
                            r2Var4.zze();
                        }
                    } catch (RemoteException e10) {
                        q7.j.zzl("#007 Could not call remote method.", e10);
                    }
                }
                if (z13 && (r2Var3 = this.zzf) != null) {
                    r2Var3.zzf();
                }
                if (z16 && (r2Var2 = this.zzf) != null) {
                    r2Var2.zzg();
                }
                if (z17) {
                    n7.r2 r2Var5 = this.zzf;
                    if (r2Var5 != null) {
                        r2Var5.zzh();
                    }
                    this.f13978a.t();
                }
                if (z10 != z11 && (r2Var = this.zzf) != null) {
                    r2Var.O1(z11);
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @Override // n7.p2
    public final void g() {
        zzw("stop", null);
    }

    @Override // n7.p2
    public final boolean m() {
        boolean z10;
        synchronized (this.f13979b) {
            try {
                z10 = false;
                if (this.f13980c && this.f13988k) {
                    z10 = true;
                }
            } finally {
            }
        }
        return z10;
    }

    @Override // n7.p2
    public final void zze() {
        zzw("play", null);
    }

    @Override // n7.p2
    public final void zzf() {
        zzw("pause", null);
    }

    @Override // n7.p2
    public final boolean zzh() {
        boolean z10;
        synchronized (this.f13979b) {
            z10 = this.f13984g;
        }
        return z10;
    }

    @Override // n7.p2
    public final int zzi() {
        int i10;
        synchronized (this.f13979b) {
            i10 = this.f13982e;
        }
        return i10;
    }

    @Override // n7.p2
    public final float zzj() {
        float f10;
        synchronized (this.f13979b) {
            f10 = this.f13985h;
        }
        return f10;
    }

    @Override // n7.p2
    public final float zzk() {
        float f10;
        synchronized (this.f13979b) {
            f10 = this.f13986i;
        }
        return f10;
    }

    @Override // n7.o2, n7.p2
    public final void zzl(@Nullable n7.r2 r2Var) {
        synchronized (this.f13979b) {
            this.zzf = r2Var;
        }
    }

    @Override // n7.p2
    public final float zzm() {
        float f10;
        synchronized (this.f13979b) {
            f10 = this.f13987j;
        }
        return f10;
    }

    @Override // n7.o2, n7.p2
    @Nullable
    public final n7.r2 zzo() throws RemoteException {
        n7.r2 r2Var;
        synchronized (this.f13979b) {
            r2Var = this.zzf;
        }
        return r2Var;
    }

    @Override // n7.p2
    public final boolean zzp() {
        boolean z10;
        Object obj = this.f13979b;
        boolean zM = m();
        synchronized (obj) {
            z10 = false;
            if (!zM) {
                try {
                    if (this.f13989l && this.f13981d) {
                        z10 = true;
                    }
                } finally {
                }
            }
        }
        return z10;
    }
}
