package defpackage;

import android.content.Intent;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.os.Trace;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import ar.tvplayer.tv.R;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.atomic.AtomicInteger;

/* renamed from: ᵹᵕˎʜ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public abstract class AbstractActivityC5046 extends AbstractActivityC4047 implements InterfaceC2827, InterfaceC3068, InterfaceC0757 {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public C2430 f18847;

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public final CopyOnWriteArrayList f18848;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public final AtomicInteger f18849;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public final C4118 f18850;

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public final CopyOnWriteArrayList f18851;

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public boolean f18852;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public final ViewTreeObserverOnDrawListenerC2169 f18853;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public C3534 f18854;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final C0262 f18855;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final ᵶˉᵹʣ f18856;

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public final CopyOnWriteArrayList f18857;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public final C5371 f18858;

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public final CopyOnWriteArrayList f18859;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public final CopyOnWriteArrayList f18860;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final C4171 f18861;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final ᵧˉʙ f18862;

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public boolean f18863;

    public AbstractActivityC5046() {
        C0262 c0262 = new C0262();
        c0262.f1834 = new CopyOnWriteArraySet();
        this.f18855 = c0262;
        this.f18862 = new ᵧˉʙ(new RunnableC3566(8, this));
        C4171 c4171 = new C4171(this);
        this.f18861 = c4171;
        ᵶˉᵹʣ r2 = new ᵶˉᵹʣ(new C5347(this, new ᵬᵮˎ(14, this)));
        this.f18856 = r2;
        this.f18847 = null;
        this.f18853 = new ViewTreeObserverOnDrawListenerC2169(this);
        this.f18850 = new C4118(new ᐧﾞ(17, this));
        this.f18849 = new AtomicInteger();
        this.f18858 = new C5371(this);
        this.f18857 = new CopyOnWriteArrayList();
        this.f18860 = new CopyOnWriteArrayList();
        this.f18851 = new CopyOnWriteArrayList();
        this.f18859 = new CopyOnWriteArrayList();
        this.f18848 = new CopyOnWriteArrayList();
        int i = 0;
        this.f18863 = false;
        this.f18852 = false;
        c4171.m9082(new C4695(this, i));
        c4171.m9082(new C4695(this, 1));
        c4171.m9082(new C4695(this, 2));
        r2.ˎˑː();
        AbstractC4379.m9364(this);
        if (Build.VERSION.SDK_INT <= 23) {
            C4695 c4695 = new C4695();
            c4695.f17360 = this;
            c4171.m9082(c4695);
        }
        ((C5553) r2.ᵿʗᵝʽ).m11185("android:support:activity-result", new C1609(i, this));
        m10518(new C2061(this, i));
    }

    @Override // android.app.Activity
    public void addContentView(View view, ViewGroup.LayoutParams layoutParams) {
        m10515();
        this.f18853.m5799(getWindow().getDecorView());
        super.addContentView(view, layoutParams);
    }

    @Override // android.app.Activity
    public void onActivityResult(int i, int i2, Intent intent) {
        if (this.f18858.m11028(i, i2, intent)) {
            return;
        }
        super.onActivityResult(i, i2, intent);
    }

    @Override // android.app.Activity
    public void onBackPressed() {
        m10514().m6210();
    }

    @Override // android.app.Activity, android.content.ComponentCallbacks
    public void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
        Iterator it = this.f18857.iterator();
        while (it.hasNext()) {
            ((InterfaceC4387) it.next()).accept(configuration);
        }
    }

    @Override // defpackage.AbstractActivityC4047, android.app.Activity
    public void onCreate(Bundle bundle) {
        this.f18856.ᵮᵠـˌ(bundle);
        C0262 c0262 = this.f18855;
        c0262.f1833 = this;
        Iterator it = ((CopyOnWriteArraySet) c0262.f1834).iterator();
        while (it.hasNext()) {
            ((InterfaceC0610) it.next()).mo2499();
        }
        super.onCreate(bundle);
        int i = FragmentC3863.f14369;
        AbstractC3258.m7625(this);
    }

    @Override // android.app.Activity, android.view.Window.Callback
    public final boolean onCreatePanelMenu(int i, Menu menu) {
        if (i != 0) {
            return true;
        }
        super.onCreatePanelMenu(i, menu);
        getMenuInflater();
        Iterator it = ((CopyOnWriteArrayList) this.f18862.ᵿʗᵝʽ).iterator();
        while (it.hasNext()) {
            ((C0270) it.next()).f1854.m9966();
        }
        return true;
    }

    @Override // android.app.Activity, android.view.Window.Callback
    public boolean onMenuItemSelected(int i, MenuItem menuItem) {
        if (super.onMenuItemSelected(i, menuItem)) {
            return true;
        }
        if (i == 0) {
            Iterator it = ((CopyOnWriteArrayList) this.f18862.ᵿʗᵝʽ).iterator();
            while (it.hasNext()) {
                if (((C0270) it.next()).f1854.m9974()) {
                    return true;
                }
            }
        }
        return false;
    }

    @Override // android.app.Activity
    public final void onMultiWindowModeChanged(boolean z) {
        if (this.f18863) {
            return;
        }
        Iterator it = this.f18859.iterator();
        while (it.hasNext()) {
            ((InterfaceC4387) it.next()).accept(new C3117(z));
        }
    }

    @Override // android.app.Activity
    public final void onMultiWindowModeChanged(boolean z, Configuration configuration) {
        this.f18863 = true;
        try {
            super.onMultiWindowModeChanged(z, configuration);
            this.f18863 = false;
            Iterator it = this.f18859.iterator();
            while (it.hasNext()) {
                ((InterfaceC4387) it.next()).accept(new C3117(z));
            }
        } catch (Throwable th) {
            this.f18863 = false;
            throw th;
        }
    }

    @Override // android.app.Activity
    public final void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        Iterator it = this.f18851.iterator();
        while (it.hasNext()) {
            ((InterfaceC4387) it.next()).accept(intent);
        }
    }

    @Override // android.app.Activity, android.view.Window.Callback
    public void onPanelClosed(int i, Menu menu) {
        Iterator it = ((CopyOnWriteArrayList) this.f18862.ᵿʗᵝʽ).iterator();
        while (it.hasNext()) {
            ((C0270) it.next()).f1854.m9945();
        }
        super.onPanelClosed(i, menu);
    }

    @Override // android.app.Activity
    public final void onPictureInPictureModeChanged(boolean z) {
        if (this.f18852) {
            return;
        }
        Iterator it = this.f18848.iterator();
        while (it.hasNext()) {
            ((InterfaceC4387) it.next()).accept(new C2914(z));
        }
    }

    @Override // android.app.Activity
    public void onPictureInPictureModeChanged(boolean z, Configuration configuration) {
        this.f18852 = true;
        try {
            super.onPictureInPictureModeChanged(z, configuration);
            this.f18852 = false;
            Iterator it = this.f18848.iterator();
            while (it.hasNext()) {
                ((InterfaceC4387) it.next()).accept(new C2914(z));
            }
        } catch (Throwable th) {
            this.f18852 = false;
            throw th;
        }
    }

    @Override // android.app.Activity, android.view.Window.Callback
    public final boolean onPreparePanel(int i, View view, Menu menu) {
        if (i != 0) {
            return true;
        }
        super.onPreparePanel(i, view, menu);
        Iterator it = ((CopyOnWriteArrayList) this.f18862.ᵿʗᵝʽ).iterator();
        while (it.hasNext()) {
            ((C0270) it.next()).f1854.m9960();
        }
        return true;
    }

    @Override // android.app.Activity
    public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        if (this.f18858.m11028(i, -1, new Intent().putExtra("androidx.activity.result.contract.extra.PERMISSIONS", strArr).putExtra("androidx.activity.result.contract.extra.PERMISSION_GRANT_RESULTS", iArr))) {
            return;
        }
        super.onRequestPermissionsResult(i, strArr, iArr);
    }

    @Override // android.app.Activity
    public final Object onRetainNonConfigurationInstance() {
        C0852 c0852;
        C3534 c3534 = this.f18854;
        if (c3534 == null && (c0852 = (C0852) getLastNonConfigurationInstance()) != null) {
            c3534 = c0852.f3885;
        }
        if (c3534 == null) {
            return null;
        }
        C0852 c08522 = new C0852();
        c08522.f3885 = c3534;
        return c08522;
    }

    @Override // defpackage.AbstractActivityC4047, android.app.Activity
    public void onSaveInstanceState(Bundle bundle) {
        C4171 c4171 = this.f18861;
        if (c4171 != null) {
            c4171.m9081("setCurrentState");
            c4171.m9078(EnumC5294.f19813);
        }
        super.onSaveInstanceState(bundle);
        this.f18856.ᵧـˌᵎ(bundle);
    }

    @Override // android.app.Activity, android.content.ComponentCallbacks2
    public final void onTrimMemory(int i) {
        super.onTrimMemory(i);
        Iterator it = this.f18860.iterator();
        while (it.hasNext()) {
            ((InterfaceC4387) it.next()).accept(Integer.valueOf(i));
        }
    }

    @Override // android.app.Activity
    public final void reportFullyDrawn() {
        try {
            if (ˉˇʨ.ˑᵱ()) {
                Trace.beginSection(ˉˇʨ.ˎˑː("reportFullyDrawn() for ComponentActivity"));
            }
            super.reportFullyDrawn();
            C4118 c4118 = this.f18850;
            synchronized (c4118.f15384) {
                try {
                    c4118.f15381 = true;
                    ArrayList arrayList = (ArrayList) c4118.f15383;
                    int size = arrayList.size();
                    int i = 0;
                    while (i < size) {
                        Object obj = arrayList.get(i);
                        i++;
                        ((InterfaceC4622) obj).mo1401();
                    }
                    ((ArrayList) c4118.f15383).clear();
                } catch (Throwable th) {
                    throw th;
                }
            }
        } finally {
            Trace.endSection();
        }
    }

    @Override // android.app.Activity
    public void setContentView(int i) {
        m10515();
        this.f18853.m5799(getWindow().getDecorView());
        super.setContentView(i);
    }

    @Override // android.app.Activity
    public void setContentView(View view) {
        m10515();
        this.f18853.m5799(getWindow().getDecorView());
        super.setContentView(view);
    }

    @Override // android.app.Activity
    public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
        m10515();
        this.f18853.m5799(getWindow().getDecorView());
        super.setContentView(view, layoutParams);
    }

    @Override // defpackage.InterfaceC3985
    /* renamed from: ˆᵼᵷˊ */
    public final C4171 mo2484() {
        return this.f18861;
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final C2430 m10514() {
        if (this.f18847 == null) {
            this.f18847 = new C2430(new RunnableC2802(3, this));
            this.f18861.m9082(new C4695(this, 3));
        }
        return this.f18847;
    }

    @Override // defpackage.InterfaceC3068
    /* renamed from: ˎˏʜʾ */
    public final C0118 mo5995() {
        C0118 c0118 = new C0118();
        if (getApplication() != null) {
            c0118.m1225(C0869.f3958, getApplication());
        }
        c0118.m1225(AbstractC4379.f16373, this);
        c0118.m1225(AbstractC4379.f16374, this);
        if (getIntent() != null && getIntent().getExtras() != null) {
            c0118.m1225(AbstractC4379.f16372, getIntent().getExtras());
        }
        return c0118;
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final void m10515() {
        getWindow().getDecorView().setTag(R.id._11_res_0x7f0b0444, this);
        getWindow().getDecorView().setTag(R.id._11_res_0x7f0b0447, this);
        getWindow().getDecorView().setTag(R.id._11_res_0x7f0b0446, this);
        getWindow().getDecorView().setTag(R.id._11_res_0x7f0b0445, this);
        getWindow().getDecorView().setTag(R.id._11_res_0x7f0b032d, this);
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final void m10516(InterfaceC4387 interfaceC4387) {
        this.f18857.add(interfaceC4387);
    }

    @Override // defpackage.InterfaceC2827
    /* renamed from: ᵡʠ */
    public final C3534 mo2486() {
        if (getApplication() == null) {
            ᵹˉᵞ.ᵳٴᵶ("Your activity is not yet attached to the Application instance. You can't request ViewModel before onCreate call.");
            return null;
        }
        if (this.f18854 == null) {
            C0852 c0852 = (C0852) getLastNonConfigurationInstance();
            if (c0852 != null) {
                this.f18854 = c0852.f3885;
            }
            if (this.f18854 == null) {
                this.f18854 = new C3534();
            }
        }
        return this.f18854;
    }

    @Override // defpackage.InterfaceC0757
    /* renamed from: ᵤᵙᵷ */
    public final C5553 mo2487() {
        return (C5553) this.f18856.ᵿʗᵝʽ;
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final AbstractC0246 m10517(InterfaceC1758 interfaceC1758, ˁˈᵸ r4) {
        return this.f18858.m11027("activity_rq#" + this.f18849.getAndIncrement(), this, r4, interfaceC1758);
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final void m10518(InterfaceC0610 interfaceC0610) {
        C0262 c0262 = this.f18855;
        if (((AbstractActivityC5046) c0262.f1833) != null) {
            interfaceC0610.mo2499();
        }
        ((CopyOnWriteArraySet) c0262.f1834).add(interfaceC0610);
    }
}
