package androidx.activity;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class p implements Runnable {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f496a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ ComponentActivity f497b;

    public /* synthetic */ p(ComponentActivity componentActivity, int i10) {
        this.f496a = i10;
        this.f497b = componentActivity;
    }

    @Override // java.lang.Runnable
    public final void run() {
        int i10 = this.f496a;
        ComponentActivity componentActivity = this.f497b;
        switch (i10) {
            case 0:
                try {
                    super/*android.app.Activity*/.onBackPressed();
                    return;
                } catch (IllegalStateException e10) {
                    if (!nb.g.c(e10.getMessage(), "Can not perform this action after onSaveInstanceState")) {
                        throw e10;
                    }
                    return;
                } catch (NullPointerException e11) {
                    if (!nb.g.c(e11.getMessage(), "Attempt to invoke virtual method 'android.os.Handler android.app.FragmentHostCallback.getHandler()' on a null object reference")) {
                        throw e11;
                    }
                    return;
                }
            default:
                int i11 = ComponentActivity.f462a;
                componentActivity.invalidateMenu();
                return;
        }
    }
}
