package d.b.c;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import com.ifpdos.udi.service.core.pc.R;
import d.b.f.a;
import d.h.j.i;
import java.lang.ref.WeakReference;

/* JADX INFO: loaded from: classes.dex */
public class n extends Dialog implements g {

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

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final i.a f1607m;

    public class a implements i.a {
        public a() {
        }

        @Override // d.h.j.i.a
        public boolean superDispatchKeyEvent(KeyEvent keyEvent) {
            return n.this.b(keyEvent);
        }
    }

    public n(Context context, int i2) {
        int i3;
        if (i2 == 0) {
            TypedValue typedValue = new TypedValue();
            context.getTheme().resolveAttribute(R.attr.dialogTheme, typedValue, true);
            i3 = typedValue.resourceId;
        } else {
            i3 = i2;
        }
        super(context, i3);
        this.f1607m = new a();
        h hVarA = a();
        if (i2 == 0) {
            TypedValue typedValue2 = new TypedValue();
            context.getTheme().resolveAttribute(R.attr.dialogTheme, typedValue2, true);
            i2 = typedValue2.resourceId;
        }
        hVarA.z(i2);
        hVarA.m(null);
    }

    public h a() {
        if (this.f1606f == null) {
            d.e.c<WeakReference<h>> cVar = h.f1559f;
            this.f1606f = new i(getContext(), getWindow(), this, this);
        }
        return this.f1606f;
    }

    @Override // android.app.Dialog
    public void addContentView(View view, ViewGroup.LayoutParams layoutParams) {
        a().c(view, layoutParams);
    }

    public boolean b(KeyEvent keyEvent) {
        return super.dispatchKeyEvent(keyEvent);
    }

    @Override // android.app.Dialog, android.content.DialogInterface
    public void dismiss() {
        super.dismiss();
        a().n();
    }

    @Override // android.app.Dialog, android.view.Window.Callback
    public boolean dispatchKeyEvent(KeyEvent keyEvent) {
        return d.h.j.i.b(this.f1607m, getWindow().getDecorView(), this, keyEvent);
    }

    @Override // android.app.Dialog
    public <T extends View> T findViewById(int i2) {
        return (T) a().e(i2);
    }

    @Override // android.app.Dialog
    public void invalidateOptionsMenu() {
        a().k();
    }

    @Override // android.app.Dialog
    public void onCreate(Bundle bundle) {
        a().j();
        super.onCreate(bundle);
        a().m(bundle);
    }

    @Override // android.app.Dialog
    public void onStop() {
        super.onStop();
        a().s();
    }

    @Override // d.b.c.g
    public void onSupportActionModeFinished(d.b.f.a aVar) {
    }

    @Override // d.b.c.g
    public void onSupportActionModeStarted(d.b.f.a aVar) {
    }

    @Override // d.b.c.g
    public d.b.f.a onWindowStartingSupportActionMode(a.InterfaceC0019a interfaceC0019a) {
        return null;
    }

    @Override // android.app.Dialog
    public void setContentView(int i2) {
        a().v(i2);
    }

    @Override // android.app.Dialog
    public void setContentView(View view) {
        a().w(view);
    }

    @Override // android.app.Dialog
    public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
        a().x(view, layoutParams);
    }

    @Override // android.app.Dialog
    public void setTitle(int i2) {
        super.setTitle(i2);
        a().A(getContext().getString(i2));
    }

    @Override // android.app.Dialog
    public void setTitle(CharSequence charSequence) {
        super.setTitle(charSequence);
        a().A(charSequence);
    }
}
