package com.bytedance.android.live.liveinteract.multilive.anchor.ui.dialog;

import X.2cN;
import X.3Cz;
import X.6Is;
import X.AnonymousClass0CB;
import X.AnonymousClass0CH;
import X.AnonymousClass0CN;
import X.AnonymousClass1YD;
import X.AnonymousClass1YE;
import X.AnonymousClass2BQ;
import X.C09630aP;
import X.C14700ia;
import X.C21150sz;
import X.C21630tl;
import X.C21650tn;
import X.C33641Vi;
import X.C41491kh;
import X.C46321sU;
import X.C54052Bv;
import X.GJB;
import X.Gg0;
import X.Hjh;
import X.M12;
import X.Mk2;
import X.Mk3;
import android.content.Context;
import android.os.Bundle;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.sdk.datachannel.DataChannel;
import java.util.concurrent.TimeUnit;
import kotlin.h.b.n;
import org.json.JSONObject;

public final class MultiLiveAnchorOpenCameraDialog extends 3Cz implements 6Is {
    public static final C21630tl LIZJ = new C21630tl((byte) 0);
    @C14700ia(LIZ = "MULTI_GUEST_DATA_HOLDER")
    public C33641Vi LIZ;
    public Context LIZIZ;
    public 2cN LIZLLL;
    public boolean LJ;
    public final String LJFF = "MultiLiveAnchorOpenCamera";
    public DataChannel LJI;
    public AnonymousClass0CH LJII;
    public String LJIIIIZZ;

    static {
        Covode.recordClassIndex(8712);
    }

    public final int LIZJ() {
        return 2131561639;
    }

    @AnonymousClass0CN(LIZ = AnonymousClass0CB.ON_PAUSE)
    public final void onPause() {
        this.LJ = true;
    }

    public final void onStateChanged(AnonymousClass0CH r2, AnonymousClass0CB r3) {
        if (r3 == AnonymousClass0CB.ON_RESUME) {
            onResume();
        } else if (r3 == AnonymousClass0CB.ON_PAUSE) {
            onPause();
        }
    }

    public final void LIZ() {
        LIZIZ();
        dismiss();
    }

    @AnonymousClass0CN(LIZ = AnonymousClass0CB.ON_RESUME)
    public final void onResume() {
        if (this.LJ) {
            LIZ();
        }
        this.LJ = false;
    }

    /* JADX WARNING: type inference failed for: r0v2, types: [X.0CG] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void dismiss() {
        /*
            r5 = this;
            com.bytedance.android.live.liveinteract.multilive.anchor.ui.dialog.MultiLiveAnchorOpenCameraDialog.super.dismiss()
            com.bytedance.ies.sdk.datachannel.DataChannel r4 = r5.LJI
            if (r4 == 0) goto L_0x0014
            java.lang.Class<X.2BQ> r3 = X.AnonymousClass2BQ.class
            X.0sz r2 = new X.0sz
            r1 = 0
            java.lang.String r0 = r5.LJIIIIZZ
            r2.<init>(r1, r0)
            r4.LIZJ(r3, r2)
        L_0x0014:
            X.2cN r0 = r5.LIZLLL
            if (r0 == 0) goto L_0x001b
            r0.dispose()
        L_0x001b:
            X.0CH r0 = r5.LJII
            X.0CD r1 = r0.getLifecycle()
            r0 = r5
            r1.LIZIZ(r0)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.live.liveinteract.multilive.anchor.ui.dialog.MultiLiveAnchorOpenCameraDialog.dismiss():void");
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [android.app.Dialog] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void show() {
        /*
            r2 = this;
            com.bytedance.android.live.liveinteract.multilive.anchor.ui.dialog.MultiLiveAnchorOpenCameraDialog.super.show()
            r1 = r2
            X.2fU r0 = X.2fU.LIZ
            r0.LIZ(r1)
            android.view.Window r0 = r2.getWindow()
            if (r0 == 0) goto L_0x0022
            android.view.WindowManager$LayoutParams r1 = r0.getAttributes()
            if (r1 == 0) goto L_0x0018
            r0 = 0
            r1.dimAmount = r0
        L_0x0018:
            android.view.Window r0 = r2.getWindow()
            if (r0 == 0) goto L_0x0021
            r0.setAttributes(r1)
        L_0x0021:
            return
        L_0x0022:
            r1 = 0
            goto L_0x0018
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.live.liveinteract.multilive.anchor.ui.dialog.MultiLiveAnchorOpenCameraDialog.show():void");
    }

    private final void LIZIZ() {
        C33641Vi r1 = this.LIZ;
        if (r1 == null) {
            n.LIZ("");
        }
        r1.LJFF = true;
        Gg0.LIZ().LIZ(new GJB(40));
        DataChannel dataChannel = this.LJI;
        if (dataChannel != null) {
            dataChannel.LIZJ(C54052Bv.class, true);
        }
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("log_name", "ttlive_multilive_anchor_switch_camera");
        jSONObject.put("switch", "on");
        jSONObject.put("way", "Anchor's camera is opened forcedly in MultiLiveAnchorOpenCameraDialog");
        C09630aP.LIZ(4, this.LJFF, jSONObject.toString());
    }

    /* JADX WARNING: type inference failed for: r5v0, types: [com.bytedance.android.live.liveinteract.multilive.anchor.ui.dialog.MultiLiveAnchorOpenCameraDialog, X.3Cz, android.app.Dialog] */
    public final void onCreate(Bundle bundle) {
        MultiLiveAnchorOpenCameraDialog.super.onCreate(bundle);
        this.LJII.getLifecycle().LIZ(this);
        setCanceledOnTouchOutside(false);
        setCancelable(false);
        DataChannel dataChannel = this.LJI;
        if (dataChannel != null) {
            dataChannel.LIZJ(AnonymousClass2BQ.class, new C21150sz(true, this.LJIIIIZZ));
        }
        this.LIZLLL = Hjh.LIZ(1, TimeUnit.SECONDS).LIZIZ(6).LIZ(Mk2.LIZ(Mk3.LIZ)).LIZ(new AnonymousClass1YD(this), AnonymousClass1YE.LIZ);
        ((C46321sU) findViewById(2131368238)).setOnClickListener(new C21650tn(this));
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public MultiLiveAnchorOpenCameraDialog(Context context, DataChannel dataChannel, AnonymousClass0CH r4, String str) {
        super(context);
        M12.LIZ(context, r4, str);
        this.LIZIZ = context;
        this.LJI = dataChannel;
        this.LJII = r4;
        this.LJIIIIZZ = str;
        C41491kh.LIZ.LIZ((Object) this);
    }
}
