package com.seewo.ota.m.t;

import android.R;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.widget.TextView;
import f.z.d.k;

/* JADX INFO: compiled from: SchedulerOTAExtendDialog.kt */
/* JADX INFO: loaded from: classes.dex */
public final class g extends Dialog {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private TextView f2207b;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public g(Context context) {
        super(context);
        k.e(context, "context");
    }

    @SuppressLint({"WrongConstant"})
    private final void a() {
        Window window = getWindow();
        window.setLayout(-1, -1);
        window.setBackgroundDrawableResource(R.color.transparent);
        window.setType(2018);
        window.setFormat(1);
        window.setFlags(131840, 131840);
        window.setGravity(17);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean c(DialogInterface dialogInterface, int i2, KeyEvent keyEvent) {
        return i2 == 4;
    }

    private final void d() {
        TextView textView = this.f2207b;
        if (textView != null) {
            textView.setText(com.seewo.ota.R.string.auto_upgrade_system_point);
        } else {
            k.p("mUpgradeTip");
            throw null;
        }
    }

    @Override // android.app.Dialog
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        requestWindowFeature(1);
        setContentView(com.seewo.ota.R.layout.schedule_upgrade_layout);
        a();
        setCancelable(false);
        setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.seewo.ota.m.t.e
            @Override // android.content.DialogInterface.OnKeyListener
            public final boolean onKey(DialogInterface dialogInterface, int i2, KeyEvent keyEvent) {
                return g.c(dialogInterface, i2, keyEvent);
            }
        });
        View viewFindViewById = findViewById(com.seewo.ota.R.id.upgrade_tip);
        k.d(viewFindViewById, "findViewById(R.id.upgrade_tip)");
        this.f2207b = (TextView) viewFindViewById;
        d();
    }
}
