package com.cvte.vman.impl;

import android.os.Parcel;
import c.a.a.a.a;
import com.cvte.vman.PcModuleCtrl;
import com.cvte.vman.VmanMiddleWare;
import com.cvte.vman.instance.InvokeCmd;
import com.cvte.vman.types.EnumBrandCode;
import com.cvte.vman.types.EnumPcBootMode;
import com.cvte.vman.types.EnumPcStateType;
import com.cvte.vman.types.EnumPcType;
import com.cvte.vman.utils.CLog;
import java.util.ArrayList;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public class PcModuleCtrlManager extends PcModuleCtrl {
    public static final String TAG = "Cvte@PcModuleCtrlManager";
    private static PcModuleCtrlManager mPcModuleCtrlManager;

    private PcModuleCtrlManager() {
    }

    public static synchronized PcModuleCtrlManager getInstance() {
        if (mPcModuleCtrlManager == null) {
            synchronized (PcModuleCtrlManager.class) {
                if (mPcModuleCtrlManager == null) {
                    mPcModuleCtrlManager = new PcModuleCtrlManager();
                }
            }
        }
        return mPcModuleCtrlManager;
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public boolean GetPcShareNetEnable() {
        CLog.d("GetPcShareNetEnable");
        return VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_PC_MODULE_GET_SHARE_NET_ENABLE) == 1;
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public boolean SetPcShareNetEnable(boolean z) {
        CLog.d("SetPcShareNetEnable");
        return VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_PC_MODULE_SET_SHARE_NET_ENABLE, z ? 1 : 0) == 1;
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public EnumBrandCode getDefaultMachineBrandCode() {
        CLog.d("getDefulatMachineBrandCode");
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(InvokeCmd.CMD_PC_MODULE_GET_DEFAULT_BRANDCODE);
        parcelExcuteCommandSet_Parcel.readInt();
        int i = parcelExcuteCommandSet_Parcel.readInt();
        parcelExcuteCommandSet_Parcel.recycle();
        return EnumBrandCode.valueOf(i);
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public EnumBrandCode getMachineBrandCode() {
        CLog.d("getMachineBrandCode");
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(InvokeCmd.CMD_PC_MODULE_GET_MACHINE_BRANDCODE);
        parcelExcuteCommandSet_Parcel.readInt();
        int i = parcelExcuteCommandSet_Parcel.readInt();
        parcelExcuteCommandSet_Parcel.recycle();
        return EnumBrandCode.valueOf(i);
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public List<EnumBrandCode> getMachineBrandCodeList() {
        CLog.d("getMachineBrandCodeList");
        ArrayList arrayList = new ArrayList();
        Parcel parcelA = a.a(InvokeCmd.CMD_PC_MODULE_GET_MACHINE_BRANDCODE_LIST);
        int i = parcelA.readInt();
        for (int i2 = 0; i2 < i; i2++) {
            arrayList.add(EnumBrandCode.valueOf(parcelA.readInt()));
        }
        parcelA.recycle();
        return arrayList;
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public EnumPcBootMode getPcBootMode() {
        int i;
        CLog.d("getPcBootMode");
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(InvokeCmd.CMD_PC_MODULE_GET_BOOT_MODE);
        if (parcelExcuteCommandSet_Parcel.dataSize() > 0) {
            parcelExcuteCommandSet_Parcel.setDataPosition(0);
            parcelExcuteCommandSet_Parcel.readInt();
            i = parcelExcuteCommandSet_Parcel.readInt();
        } else {
            CLog.e("getPcBootMode failed");
            i = -1;
        }
        parcelExcuteCommandSet_Parcel.recycle();
        return EnumPcBootMode.valueOf(i);
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public String getPcBrandCode() {
        CLog.d("getPcBrandCode");
        return null;
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public EnumPcStateType getPcStatus() {
        return getPcStatus(EnumPcType.PC);
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public EnumPcStateType getPcStatus(EnumPcType enumPcType) {
        Parcel parcelObtain = Parcel.obtain();
        Parcel.obtain();
        parcelObtain.writeInt(11776);
        parcelObtain.writeInt(enumPcType.ordinal());
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(parcelObtain);
        if (parcelExcuteCommandSet_Parcel.dataSize() <= 0) {
            CLog.e("getPcStatus failed");
            return EnumPcStateType.PC_STATE_RESERVE_MAX;
        }
        parcelExcuteCommandSet_Parcel.setDataPosition(0);
        int i = parcelExcuteCommandSet_Parcel.readInt();
        int i2 = parcelExcuteCommandSet_Parcel.readInt();
        CLog.w("getPcStatus" + enumPcType + " success, ret = " + i + ", val = " + i2);
        return EnumPcStateType.valueOf(i2);
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public List<EnumPcBootMode> getSupportPcBootModeList() {
        CLog.d("getSupportPcBootModeList");
        ArrayList arrayList = new ArrayList();
        Parcel parcelA = a.a(InvokeCmd.CMD_PC_MODULE_GET_BOOT_MODE_LIST);
        int i = parcelA.readInt();
        for (int i2 = 0; i2 < i; i2++) {
            arrayList.add(EnumPcBootMode.valueOf(parcelA.readInt()));
        }
        parcelA.recycle();
        return arrayList;
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public boolean isBrandCodeMatch() {
        Parcel parcelObtain = Parcel.obtain();
        Parcel.obtain();
        parcelObtain.writeInt(InvokeCmd.CMD_PC_MODULE_IS_BRANDCODE_MATCH);
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(parcelObtain);
        if (parcelExcuteCommandSet_Parcel.dataSize() <= 0) {
            CLog.w("isBrandCodeMatch() reply data size is 0");
            return false;
        }
        parcelExcuteCommandSet_Parcel.setDataPosition(0);
        parcelExcuteCommandSet_Parcel.readInt();
        return parcelExcuteCommandSet_Parcel.readBoolean();
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public int sendPcSerialData(byte[] bArr) {
        CLog.d("sendPcSerialData");
        return 0;
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public boolean setMachineBrandCode(EnumBrandCode enumBrandCode) {
        CLog.d("setMachineBrandCode");
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_PC_MODULE_SET_MACHINE_BRANDCODE, enumBrandCode.ordinal());
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public boolean setPcBootMode(EnumPcBootMode enumPcBootMode) {
        CLog.d("setPcBootMode");
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_PC_MODULE_SET_BOOT_MODE, enumPcBootMode.ordinal());
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public int setPcPowerOff() {
        CLog.d("setPcPowerOff");
        return VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_PC_MODULE_SET_POWEROFF);
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public int setPcPowerOn() {
        CLog.d("setPcPowerOn");
        return VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_PC_MODULE_SET_POWERON);
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public int setPcRecovery() {
        return setPcRecovery(EnumPcType.PC);
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public int setPcRecovery(EnumPcType enumPcType) {
        CLog.d("setPcRecovery" + enumPcType);
        Parcel parcelObtain = Parcel.obtain();
        Parcel.obtain();
        parcelObtain.writeInt(InvokeCmd.CMD_PC_MODULE_SET_RECOVERY);
        parcelObtain.writeInt(enumPcType.ordinal());
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(parcelObtain);
        if (parcelExcuteCommandSet_Parcel.dataSize() > 0) {
            CLog.d("setPcRecovery success");
            return parcelExcuteCommandSet_Parcel.readInt();
        }
        CLog.e("setPcRecovery failed");
        return -1;
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public int setPcSwitchOff() {
        return setPcSwitchOff(EnumPcType.PC);
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public int setPcSwitchOff(EnumPcType enumPcType) {
        CLog.d("setPcSwitchOff" + enumPcType);
        Parcel parcelObtain = Parcel.obtain();
        Parcel.obtain();
        parcelObtain.writeInt(InvokeCmd.CMD_PC_MODULE_SET_SWITCHOFF);
        parcelObtain.writeInt(enumPcType.ordinal());
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(parcelObtain);
        if (parcelExcuteCommandSet_Parcel.dataSize() > 0) {
            CLog.d("setPcSwitchOff success");
            return parcelExcuteCommandSet_Parcel.readInt();
        }
        CLog.e("setPcSwitchOff failed");
        return -1;
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public int setPcSwitchOn() {
        return setPcSwitchOn(EnumPcType.PC);
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public int setPcSwitchOn(EnumPcType enumPcType) {
        CLog.d("setPcSwitchOn" + enumPcType);
        Parcel parcelObtain = Parcel.obtain();
        Parcel.obtain();
        parcelObtain.writeInt(InvokeCmd.CMD_PC_MODULE_SET_SWITCHON);
        parcelObtain.writeInt(enumPcType.ordinal());
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(parcelObtain);
        if (parcelExcuteCommandSet_Parcel.dataSize() > 0) {
            CLog.d("setPcSwitchOn success");
            return parcelExcuteCommandSet_Parcel.readInt();
        }
        CLog.e("setPcSwitchOn failed");
        return -1;
    }

    @Override // com.cvte.vman.PcModuleCtrl
    public boolean skipBrandCodeMatch() {
        Parcel parcelObtain = Parcel.obtain();
        Parcel.obtain();
        parcelObtain.writeInt(InvokeCmd.CMD_PC_MODULE_SKIP_BRANDCODE_MATCH);
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(parcelObtain);
        if (parcelExcuteCommandSet_Parcel.dataSize() <= 0) {
            CLog.w("skipBrandCodeMatch() reply data size is 0");
            return false;
        }
        parcelExcuteCommandSet_Parcel.setDataPosition(0);
        parcelExcuteCommandSet_Parcel.readInt();
        return parcelExcuteCommandSet_Parcel.readBoolean();
    }
}
