package com.cvte.vman.impl;

import android.os.Parcel;
import com.cvte.vman.PcModuleCtrl;
import com.cvte.vman.VmanMiddleWare;
import com.cvte.vman.instance.InvokeCmd;
import com.cvte.vman.types.EnumPcBootMode;
import com.cvte.vman.types.EnumPcStateType;
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 EnumPcStateType getPcStatus() {
        Parcel parcelObtain = Parcel.obtain();
        Parcel.obtain();
        parcelObtain.writeInt(11776);
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(parcelObtain);
        if (parcelExcuteCommandSet_Parcel.dataSize() > 0) {
            parcelExcuteCommandSet_Parcel.setDataPosition(0);
            int i = parcelExcuteCommandSet_Parcel.readInt();
            int i2 = parcelExcuteCommandSet_Parcel.readInt();
            CLog.w("getPcStatus success, ret = " + i + ", val = " + i2);
            return EnumPcStateType.valueOf(i2);
        }
        CLog.e("getPcStatus failed");
        return EnumPcStateType.PC_STATE_RESERVE_MAX;
    }

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

    @Override // com.cvte.vman.PcModuleCtrl
    public int setPcSwitchOn() {
        CLog.d("setPcSwitchOn");
        Parcel parcelObtain = Parcel.obtain();
        Parcel.obtain();
        parcelObtain.writeInt(InvokeCmd.CMD_PC_MODULE_SET_SWITCHON);
        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 int setPcSwitchOff() {
        CLog.d("setPcSwitchOff");
        Parcel parcelObtain = Parcel.obtain();
        Parcel.obtain();
        parcelObtain.writeInt(InvokeCmd.CMD_PC_MODULE_SET_SWITCHOFF);
        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 setPcRecovery() {
        CLog.d("setPcRecovery");
        Parcel parcelObtain = Parcel.obtain();
        Parcel.obtain();
        parcelObtain.writeInt(InvokeCmd.CMD_PC_MODULE_SET_RECOVERY);
        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 sendPcSerialData(byte[] bArr) {
        CLog.d("sendPcSerialData");
        return 0;
    }

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

    @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 EnumPcBootMode getPcBootMode() {
        CLog.d("getPcBootMode");
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(InvokeCmd.CMD_PC_MODULE_GET_BOOT_MODE);
        parcelExcuteCommandSet_Parcel.readInt();
        int i = parcelExcuteCommandSet_Parcel.readInt();
        parcelExcuteCommandSet_Parcel.recycle();
        return EnumPcBootMode.valueOf(i);
    }
}
