package com.ifpdos.debugmenu.action;

import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.SystemProperties;
import com.ifpdos.debugmenu.action.base.ItemSwitchAction;
import d.i.c.a;

/* JADX INFO: loaded from: classes.dex */
public class SidbarEnableAction extends ItemSwitchAction {
    private static final String ACTION_SYSTEMBAR_VISIBLE_STATUS = "com.ifpdos.systembar.action.visible_status_changed";
    private static final String OFF_STATUS = "2";
    private static final String ON_STATUS = "0";
    private static final String PROP_SYSTEMBAR_VISIBLE_STATUS;

    static {
        PROP_SYSTEMBAR_VISIBLE_STATUS = (Build.VERSION.SDK_INT > 30 || !a.w()) ? "persist.sys.bar.visibility" : "persist.ctm.bar.visibility";
    }

    public SidbarEnableAction(Context context) {
        super(context);
    }

    @Override // com.ifpdos.debugmenu.action.base.ItemSwitchAction
    public boolean isOn(Context context) {
        return !OFF_STATUS.equals(SystemProperties.get(PROP_SYSTEMBAR_VISIBLE_STATUS));
    }

    @Override // com.ifpdos.debugmenu.action.base.ItemSwitchAction
    public void onSwitch(Context context, boolean z) {
        if (z) {
            SystemProperties.set(PROP_SYSTEMBAR_VISIBLE_STATUS, ON_STATUS);
            context.sendBroadcast(new Intent(ACTION_SYSTEMBAR_VISIBLE_STATUS));
        } else {
            SystemProperties.set(PROP_SYSTEMBAR_VISIBLE_STATUS, OFF_STATUS);
            context.sendBroadcast(new Intent(ACTION_SYSTEMBAR_VISIBLE_STATUS));
        }
    }
}
