package com.cvte.vman.impl;

import android.os.Parcel;
import com.cvte.vman.RGBLedCtrl;
import com.cvte.vman.VmanMiddleWare;
import com.cvte.vman.instance.InvokeCmd;
import com.cvte.vman.types.EnumRGBLedBehavior;
import com.cvte.vman.types.EnumRGBLedBluetoothState;
import com.cvte.vman.types.EnumRGBLedColor;
import com.cvte.vman.types.EnumRGBLedDiagnosisState;
import com.cvte.vman.types.EnumRGBLedMicrophoneState;
import com.cvte.vman.types.EnumRGBLedOtaState;
import com.cvte.vman.types.EnumRGBLedPowerState;
import com.cvte.vman.types.EnumStandByModeType;
import com.cvte.vman.types.EnumVaLedState;
import com.cvte.vman.utils.CLog;
import java.util.ArrayList;
import java.util.List;

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

    private RGBLedCtrlManager() {
    }

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

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean getPowerLedEnableState() {
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_GET_POWER_LED_ENABLE_STATE);
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public int getRGBLedBrightness() {
        int i2;
        CLog.d("getRGBLedBrightness");
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(InvokeCmd.CMD_RGBLED_GET_RGB_BRIGHTNESS);
        if (parcelExcuteCommandSet_Parcel.dataSize() > 0) {
            parcelExcuteCommandSet_Parcel.setDataPosition(0);
            parcelExcuteCommandSet_Parcel.readInt();
            i2 = parcelExcuteCommandSet_Parcel.readInt();
        } else {
            CLog.e("getRGBLedBrightness failed");
            i2 = -1;
        }
        parcelExcuteCommandSet_Parcel.recycle();
        return i2;
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public List<EnumRGBLedColor> getSupportRGBLedColorList() {
        CLog.d("getSupportRGBColorList");
        ArrayList arrayList = new ArrayList();
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(InvokeCmd.CMD_RGBLED_GET_SUPPORT_COLOR_LIST);
        parcelExcuteCommandSet_Parcel.readInt();
        int i2 = parcelExcuteCommandSet_Parcel.readInt();
        for (int i3 = 0; i3 < i2; i3++) {
            arrayList.add(EnumRGBLedColor.valueOf(parcelExcuteCommandSet_Parcel.readInt()));
        }
        parcelExcuteCommandSet_Parcel.recycle();
        return arrayList;
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public EnumVaLedState getVaLedState() {
        int iExcuteCommandSet_int = VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_RGBLED_GET_VA_LED_STATE);
        EnumVaLedState enumVaLedState = EnumVaLedState.LED_STATE_NULL;
        if (iExcuteCommandSet_int == EnumVaLedState.LED_STATE_ANDROID_STARTING.ordinal()) {
            enumVaLedState = EnumVaLedState.LED_STATE_ANDROID_STARTING;
        } else if (iExcuteCommandSet_int == EnumVaLedState.LED_STATE_ANDROID_BOOT_COMPLETE.ordinal()) {
            enumVaLedState = EnumVaLedState.LED_STATE_ANDROID_BOOT_COMPLETE;
        } else if (iExcuteCommandSet_int == EnumVaLedState.LED_STATE_ANDROID_NORMAL.ordinal()) {
            enumVaLedState = EnumVaLedState.LED_STATE_ANDROID_NORMAL;
        } else if (iExcuteCommandSet_int == EnumVaLedState.LED_STATE_CONFERENCE_TELE.ordinal()) {
            enumVaLedState = EnumVaLedState.LED_STATE_CONFERENCE_TELE;
        } else if (iExcuteCommandSet_int == EnumVaLedState.LED_STATE_CONFERENCE_IN_COMMUNICATION.ordinal()) {
            enumVaLedState = EnumVaLedState.LED_STATE_CONFERENCE_IN_COMMUNICATION;
        } else if (iExcuteCommandSet_int == EnumVaLedState.LED_STATE_CONFERENCE_MICPHONE_SILENCE.ordinal()) {
            enumVaLedState = EnumVaLedState.LED_STATE_CONFERENCE_MICPHONE_SILENCE;
        } else if (iExcuteCommandSet_int == EnumVaLedState.LED_STATE_CONFERENCE_MICPHONE_ON.ordinal()) {
            enumVaLedState = EnumVaLedState.LED_STATE_CONFERENCE_MICPHONE_ON;
        } else if (iExcuteCommandSet_int == EnumVaLedState.LED_STATE_NON_CONFERENCE_MICPHONE_SILENCE.ordinal()) {
            enumVaLedState = EnumVaLedState.LED_STATE_NON_CONFERENCE_MICPHONE_SILENCE;
        } else if (iExcuteCommandSet_int == EnumVaLedState.LED_STATE_NON_CONFERENCE_MICPHONE_ON.ordinal()) {
            enumVaLedState = EnumVaLedState.LED_STATE_NON_CONFERENCE_MICPHONE_ON;
        } else if (iExcuteCommandSet_int == EnumVaLedState.LED_STATE_ANDROID_UPGRADE.ordinal()) {
            enumVaLedState = EnumVaLedState.LED_STATE_ANDROID_UPGRADE;
        } else if (iExcuteCommandSet_int == EnumVaLedState.LED_STATE_ANDROID_SLEEP.ordinal()) {
            enumVaLedState = EnumVaLedState.LED_STATE_ANDROID_SLEEP;
        } else if (iExcuteCommandSet_int == EnumVaLedState.LED_STATE_OFF.ordinal()) {
            enumVaLedState = EnumVaLedState.LED_STATE_OFF;
        }
        CLog.d("getVaLedState  " + enumVaLedState.ordinal());
        return enumVaLedState;
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public EnumRGBLedColor resetRGBLedColor() {
        int i2;
        CLog.d("resetRGBLedColor");
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(InvokeCmd.CMD_RGBLED_RESET_DEFAULT_COLOR);
        if (parcelExcuteCommandSet_Parcel.dataSize() > 0) {
            parcelExcuteCommandSet_Parcel.setDataPosition(0);
            parcelExcuteCommandSet_Parcel.readInt();
            i2 = parcelExcuteCommandSet_Parcel.readInt();
        } else {
            CLog.e("resetRGBLedColor failed");
            i2 = -1;
        }
        parcelExcuteCommandSet_Parcel.recycle();
        return EnumRGBLedColor.valueOf(i2);
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setBluetoothState(EnumRGBLedBluetoothState enumRGBLedBluetoothState) {
        CLog.d("setBluetoothState = " + enumRGBLedBluetoothState);
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_SET_BLUETOOTH_STATE, enumRGBLedBluetoothState.ordinal());
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setDiagnosisState(EnumRGBLedDiagnosisState enumRGBLedDiagnosisState) {
        CLog.d("setDiagnosisState = " + enumRGBLedDiagnosisState);
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_SET_DIAGNOSIS_STATE, enumRGBLedDiagnosisState.ordinal());
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setIRInputState() {
        CLog.d("setIRInputState");
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_SET_IR_INPUT_STATE);
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setLedOff(int i2) {
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_SET_LED_OFF, i2);
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setLedOn(int i2) {
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_SET_LED_ON, i2);
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setLedOtaState(EnumRGBLedOtaState enumRGBLedOtaState) {
        CLog.d("setLedOtaState = " + enumRGBLedOtaState);
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_SET_OTA_STATE, enumRGBLedOtaState.ordinal());
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setMicrophoneState(EnumRGBLedMicrophoneState enumRGBLedMicrophoneState) {
        CLog.d("setMicrophoneState = " + enumRGBLedMicrophoneState);
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_SET_MICROPHONE_STATE, enumRGBLedMicrophoneState.ordinal());
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setPowerLedEnableState(boolean z) {
        CLog.d("setPowerLedEnableState = " + z);
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_SET_POWER_LED_ENABLE_STATE, z);
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setPowerStandbyState(EnumStandByModeType enumStandByModeType) {
        CLog.d("setPowerStandbyState = " + enumStandByModeType);
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_SET_POWER_STANDBY_STATE, enumStandByModeType.ordinal());
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setPowerState(EnumRGBLedPowerState enumRGBLedPowerState) {
        CLog.d("setBootCompleteState = " + enumRGBLedPowerState);
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_SET_POWER_STATE, enumRGBLedPowerState.ordinal());
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setRGBLedBrightness(int i2) {
        CLog.d("setRGBLedBrightness = " + i2);
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_SET_RGB_BRIGHTNESS, i2);
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setRGBLedColor(EnumRGBLedColor enumRGBLedColor) {
        CLog.d("setRGBColor");
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_SET_COLOR, enumRGBLedColor.ordinal());
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setRGBLedState(EnumRGBLedBehavior enumRGBLedBehavior, EnumRGBLedColor enumRGBLedColor, int i2, int i3) {
        CLog.d("setRGBLedState  " + enumRGBLedBehavior.ordinal() + " " + enumRGBLedColor.ordinal() + " " + i2 + " " + i3);
        Parcel parcelObtain = Parcel.obtain();
        parcelObtain.writeInt(InvokeCmd.CMD_RGBLED_SET_RGB_LED_STATE);
        parcelObtain.writeInt(enumRGBLedBehavior.ordinal());
        parcelObtain.writeInt(enumRGBLedColor.ordinal());
        parcelObtain.writeInt(i2);
        parcelObtain.writeInt(i3);
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(parcelObtain);
        if (parcelExcuteCommandSet_Parcel == null) {
            return false;
        }
        parcelExcuteCommandSet_Parcel.readInt();
        return parcelExcuteCommandSet_Parcel.readBoolean();
    }

    @Override // com.cvte.vman.RGBLedCtrl
    public boolean setVaLedState(EnumVaLedState enumVaLedState) {
        CLog.d("setVaLedState  " + enumVaLedState.ordinal());
        return VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_RGBLED_SET_VA_LED_STATE, enumVaLedState.ordinal());
    }
}
