package com.cvte.vman.impl;

import android.os.Parcel;
import android.text.TextUtils;
import com.cvte.vman.ExtendDisplayCtrl;
import com.cvte.vman.VmanMiddleWare;
import com.cvte.vman.entity.EntityExtendDisplayEdidInfo;
import com.cvte.vman.entity.EntitySplitModeInfo;
import com.cvte.vman.instance.InvokeCmd;
import com.cvte.vman.types.EnumExtendDisplayType;
import com.cvte.vman.types.EnumSplitMode;
import com.cvte.vman.utils.CLog;
import java.util.ArrayList;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public class ExtendDisplayCtrlManager extends ExtendDisplayCtrl {
    public static final int AMP_MUTE = 1;
    public static final int AMP_UNMUTE = 0;
    public static final int OUT_DEV_TYPE_HDMIOUT = 1;
    public static final int OUT_DEV_TYPE_TYPECOUT = 2;
    public static final String TAG = "Cvte@ExtendDisplayCtrlManager";
    private static ExtendDisplayCtrlManager mExtendDisplayCtrlManager;

    private ExtendDisplayCtrlManager() {
    }

    public static synchronized ExtendDisplayCtrlManager getInstance() {
        try {
            if (mExtendDisplayCtrlManager == null) {
                synchronized (ExtendDisplayCtrlManager.class) {
                    try {
                        if (mExtendDisplayCtrlManager == null) {
                            mExtendDisplayCtrlManager = new ExtendDisplayCtrlManager();
                        }
                    } finally {
                    }
                }
            }
        } catch (Throwable th) {
            throw th;
        }
        return mExtendDisplayCtrlManager;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public String getExtendDisplayColorFormat() {
        String strExcuteCommandSet_Str = VmanMiddleWare.getInstance().excuteCommandSet_Str(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_COLOR_FORMAT);
        CLog.d("return " + strExcuteCommandSet_Str);
        return strExcuteCommandSet_Str;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public EntityExtendDisplayEdidInfo getExtendDisplayConnectEdidInfo(int i2) {
        CLog.d("getExtendDisplayConnectEdidInfo");
        EntityExtendDisplayEdidInfo entityExtendDisplayEdidInfo = new EntityExtendDisplayEdidInfo();
        Parcel parcelObtain = Parcel.obtain();
        parcelObtain.writeInt(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_DISPLAY_EDID_INFO);
        parcelObtain.writeInt(i2);
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(parcelObtain);
        parcelExcuteCommandSet_Parcel.setDataPosition(0);
        parcelExcuteCommandSet_Parcel.readInt();
        entityExtendDisplayEdidInfo.vendor_id = parcelExcuteCommandSet_Parcel.readString();
        entityExtendDisplayEdidInfo.product_id = parcelExcuteCommandSet_Parcel.readString();
        entityExtendDisplayEdidInfo.serial_number = parcelExcuteCommandSet_Parcel.readString();
        entityExtendDisplayEdidInfo.model_name = parcelExcuteCommandSet_Parcel.readString();
        CLog.d("return vendor_id " + entityExtendDisplayEdidInfo.vendor_id + " product_id " + entityExtendDisplayEdidInfo.product_id + " serial_number " + entityExtendDisplayEdidInfo.serial_number + " model_name " + entityExtendDisplayEdidInfo.model_name);
        return entityExtendDisplayEdidInfo;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean getExtendDisplayEnabled() {
        int iExcuteCommandSet_int = VmanMiddleWare.getInstance().excuteCommandSet_int(4097);
        CLog.d("return " + iExcuteCommandSet_int);
        return iExcuteCommandSet_int == 1;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean getExtendDisplayForceDVI() {
        int iExcuteCommandSet_int = VmanMiddleWare.getInstance().excuteCommandSet_int(4104);
        CLog.d("return " + iExcuteCommandSet_int);
        return iExcuteCommandSet_int == 1;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean getExtendDisplayHDCPStatus() {
        int iExcuteCommandSet_int = VmanMiddleWare.getInstance().excuteCommandSet_int(4102);
        CLog.d("return " + iExcuteCommandSet_int);
        return iExcuteCommandSet_int == 1;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public String getExtendDisplayResolution() {
        String strExcuteCommandSet_Str = VmanMiddleWare.getInstance().excuteCommandSet_Str(4100);
        CLog.d("return " + strExcuteCommandSet_Str);
        return strExcuteCommandSet_Str;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public List<String> getExtendDisplaySuportColorFormatList() {
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_SUPORT_COLOR_FORMAT_LIST);
        parcelExcuteCommandSet_Parcel.setDataPosition(0);
        parcelExcuteCommandSet_Parcel.readInt();
        int i2 = parcelExcuteCommandSet_Parcel.readInt();
        ArrayList arrayList = new ArrayList();
        for (int i3 = 0; i3 < i2; i3++) {
            arrayList.add(parcelExcuteCommandSet_Parcel.readString());
        }
        parcelExcuteCommandSet_Parcel.recycle();
        CLog.d("return " + TextUtils.join("; ", arrayList));
        return arrayList;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public List<String> getExtendDisplaySuportResolutionList() {
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(4099);
        parcelExcuteCommandSet_Parcel.setDataPosition(0);
        parcelExcuteCommandSet_Parcel.readInt();
        int i2 = parcelExcuteCommandSet_Parcel.readInt();
        ArrayList arrayList = new ArrayList();
        for (int i3 = 0; i3 < i2; i3++) {
            arrayList.add(parcelExcuteCommandSet_Parcel.readString());
        }
        parcelExcuteCommandSet_Parcel.recycle();
        CLog.d("return " + TextUtils.join("; ", arrayList));
        return arrayList;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public List<String> getExtendDisplayUserResolutionList() {
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_USER_RESOLUTION_LIST);
        parcelExcuteCommandSet_Parcel.setDataPosition(0);
        parcelExcuteCommandSet_Parcel.readInt();
        int i2 = parcelExcuteCommandSet_Parcel.readInt();
        ArrayList arrayList = new ArrayList();
        for (int i3 = 0; i3 < i2; i3++) {
            arrayList.add(parcelExcuteCommandSet_Parcel.readString());
        }
        parcelExcuteCommandSet_Parcel.recycle();
        CLog.d("return " + TextUtils.join("; ", arrayList));
        return arrayList;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public EnumExtendDisplayType getExterndDisplayType() {
        int iExcuteCommandSet_int = VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_DISPLAY_TYPE);
        CLog.d("return " + iExcuteCommandSet_int);
        return EnumExtendDisplayType.valueOf(iExcuteCommandSet_int);
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean getHdmiInOutEnabled() {
        int iExcuteCommandSet_int = VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_HDMI_IN_OUT);
        CLog.d("return " + iExcuteCommandSet_int);
        return iExcuteCommandSet_int == 1;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean getOverscan(int i2, int i3, int i4, int i5) {
        int iExcuteCommandSet_int = VmanMiddleWare.getInstance().excuteCommandSet_int(4108, i2, i3, i4, i5);
        CLog.d("return " + iExcuteCommandSet_int);
        return iExcuteCommandSet_int == 1;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean getOverscanEnable() {
        int iExcuteCommandSet_int = VmanMiddleWare.getInstance().excuteCommandSet_int(4106);
        CLog.d("return " + iExcuteCommandSet_int);
        return iExcuteCommandSet_int == 1;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public int getSpeakerOutPutMode(int i2) {
        int iExcuteCommandSet_int = VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_AUDIO_GET_SPEAKER_MODE, i2);
        CLog.i("getSpeakerOutPutMode mute = " + iExcuteCommandSet_int);
        return iExcuteCommandSet_int;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public EntitySplitModeInfo getSplitModeInfo() {
        EntitySplitModeInfo entitySplitModeInfo = new EntitySplitModeInfo();
        Parcel parcelObtain = Parcel.obtain();
        parcelObtain.writeInt(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_SPLIT_MODE_INFO);
        Parcel parcelExcuteCommandSet_Parcel = VmanMiddleWare.getInstance().excuteCommandSet_Parcel(parcelObtain);
        if (parcelExcuteCommandSet_Parcel.dataSize() <= 0) {
            CLog.d("getSplitModeInfo failed");
            return entitySplitModeInfo;
        }
        parcelExcuteCommandSet_Parcel.setDataPosition(0);
        int i2 = parcelExcuteCommandSet_Parcel.readInt();
        entitySplitModeInfo.mode = EnumSplitMode.valueOf(parcelExcuteCommandSet_Parcel.readInt());
        entitySplitModeInfo.order = parcelExcuteCommandSet_Parcel.readString();
        CLog.d("return value " + i2 + " splitModeInfo " + entitySplitModeInfo.mode + " " + entitySplitModeInfo.order);
        return entitySplitModeInfo;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean getStreamOutDevPlugStatus(int i2) {
        int iExcuteCommandSet_int = VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_OUT_DEV_PLUG_STATUS, i2);
        CLog.i("getStreamOutDevPlugStatus ret = " + iExcuteCommandSet_int);
        return iExcuteCommandSet_int == 1;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean getTypecOutHDCPStatus() {
        int iExcuteCommandSet_int = VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_GET_TYPEC_OUT_HDCP_STATUS);
        CLog.d("return " + iExcuteCommandSet_int);
        return iExcuteCommandSet_int == 1;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean isVedioMute() {
        boolean zExcuteCommandSet_bool = VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_IS_VEDIO_MUTE);
        CLog.d("isVedioMute " + zExcuteCommandSet_bool);
        return zExcuteCommandSet_bool;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setExtendDisplayColorFormat(String str) {
        CLog.d(str + " return " + VmanMiddleWare.getInstance().excuteCommandSet_Str(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_SET_COLOR_FORMAT, str));
        return true;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setExtendDisplayEnabled(boolean z2) {
        VmanMiddleWare.getInstance().excuteCommandSet_int(4098, z2 ? 1 : 0);
        CLog.d("set to " + (z2 ? 1 : 0));
        return true;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setExtendDisplayEnabled_p2(int i2, boolean z2) {
        VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_SET_DISPLAY_P2_STATUS, i2, z2 ? 1 : 0);
        CLog.d("set " + i2 + " to " + (z2 ? 1 : 0));
        return true;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setExtendDisplayForceDVI(boolean z2) {
        VmanMiddleWare.getInstance().excuteCommandSet_int(4105, z2 ? 1 : 0);
        CLog.d("set to " + (z2 ? 1 : 0));
        return true;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setExtendDisplayHDCPStatus(boolean z2) {
        VmanMiddleWare.getInstance().excuteCommandSet_int(4103, z2 ? 1 : 0);
        CLog.d("set to " + (z2 ? 1 : 0));
        return true;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setExtendDisplayResolution(String str) {
        CLog.d(str + " return " + VmanMiddleWare.getInstance().excuteCommandSet_Str(4101, str));
        return true;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setExterndDisplayType(EnumExtendDisplayType enumExtendDisplayType) {
        int iExcuteCommandSet_int = VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_SET_DISPLAY_TYPE, enumExtendDisplayType.ordinal());
        CLog.d("set to " + enumExtendDisplayType);
        return iExcuteCommandSet_int == 0;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setHdmiInOutEnabled(boolean z2) {
        VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_SET_HDMI_IN_OUT, z2 ? 1 : 0);
        CLog.d("set to " + (z2 ? 1 : 0));
        return true;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setOverscan(int i2, int i3) {
        VmanMiddleWare.getInstance().excuteCommandSet_int(4109, i2, i3);
        CLog.d("set to " + i3);
        return true;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setOverscanEnable(boolean z2) {
        VmanMiddleWare.getInstance().excuteCommandSet_int(4107, z2 ? 1 : 0);
        CLog.d("set to " + (z2 ? 1 : 0));
        return true;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setSpeakerOutPutMode(int i2, int i3) {
        CLog.i("setSpeakerOutPutMode  typt = " + i2 + " mute = " + i3);
        VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_AUDIO_SET_SPEAKER_MODE, i2, i3);
        return true;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setSplitModeInfo(EntitySplitModeInfo entitySplitModeInfo) {
        Parcel parcelObtain = Parcel.obtain();
        parcelObtain.writeInt(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_SET_SPLIT_MODE_INFO);
        parcelObtain.writeInt(entitySplitModeInfo.mode.ordinal());
        parcelObtain.writeString(entitySplitModeInfo.order);
        int iExcuteCommandSet_int = VmanMiddleWare.getInstance().excuteCommandSet_int(parcelObtain);
        CLog.d("setSplitModeInfo return " + iExcuteCommandSet_int);
        return iExcuteCommandSet_int == 1;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setTypecOutHDCPStatus(boolean z2) {
        VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_SET_TYPEC_OUT_HDCP_STATUS, z2 ? 1 : 0);
        CLog.d("set to " + (z2 ? 1 : 0));
        return true;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean setVedioMute(boolean z2) {
        boolean zExcuteCommandSet_bool = VmanMiddleWare.getInstance().excuteCommandSet_bool(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_SET_VEDIO_MUTE, z2 ? 1 : 0);
        CLog.d("setVedioMute " + zExcuteCommandSet_bool);
        return zExcuteCommandSet_bool;
    }

    @Override // com.cvte.vman.ExtendDisplayCtrl
    public boolean toDoScreenShake(boolean z2) {
        CLog.d("set to " + VmanMiddleWare.getInstance().excuteCommandSet_int(InvokeCmd.CMD_EXTENDDISPLAY_CTRL_SET_DISPLAYOFFSET, z2 ? 1 : 0));
        return true;
    }
}
