package com.mstar.android.tv;

import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.Log;
import com.mstar.android.tv.IEventClient;
import com.mstar.android.tv.ITvService;
import com.mstar.android.tvapi.common.exception.TvCommonException;
import com.mstar.android.tvapi.common.listener.OnAudioEventListener;
import com.mstar.android.tvapi.common.vo.AudioSrsTableEntry;
import com.mstar.android.tvapi.common.vo.DolbyDapParamter;
import com.mstar.android.tvapi.common.vo.EnumAudioReturn;
import com.mstar.android.tvapi.common.vo.EnumAuidoCaptureDeviceType;
import com.mstar.android.tvapi.common.vo.EnumAuidoCaptureSource;
import com.mstar.android.tvapi.common.vo.EnumDtvSoundMode;
import com.mstar.android.tvapi.common.vo.EnumOnOffType;
import com.mstar.android.tvapi.common.vo.EnumSoundMode;
import com.mstar.android.tvapi.common.vo.EnumSpdifType;
import com.mstar.android.tvapi.common.vo.EnumSurroundMode;
import com.mstar.android.tvapi.common.vo.MuteType;
import com.mstar.android.tvapi.dtv.vo.AudioAc4Presentation;
import java.util.ArrayList;
import java.util.Iterator;

/* JADX INFO: loaded from: classes.dex */
public class TvAudioManager extends IEventClient.Stub {
    public static final short AAC_LEVEL1 = 80;
    public static final short AAC_LEVEL1_BRAZIL = 40;
    public static final short AAC_LEVEL2 = 81;
    public static final short AAC_LEVEL2_BRAZIL = 41;
    public static final short AAC_LEVEL4 = 82;
    public static final short AAC_LEVEL4_BRAZIL = 42;
    public static final short AAC_LEVEL5 = 83;
    public static final short AAC_LEVEL5_BRAZIL = 43;
    public static final short AAC_LEVEL_RESERVED = 0;
    public static final int ADVSND_DBX_TOTAL_SONIC_MODE = 143;
    public static final int ADVSND_DBX_TOTAL_VOLUME_MODE = 144;
    public static final int AD_SWITCH_RANK = 16;
    public static final int AUDIO_AC3P_INFOTYPE_MIXER_BALANCE = 23;
    public static final int AUDIO_CAPABILITY_AD = 0;
    public static final int AUDIO_CAPABILITY_DOLBY_DAP_VERSION = 2;
    public static final int AUDIO_CAPABILITY_NUMBER_OF_PEQ_BAND = 1;
    public static final int AUDIO_CAPTURE_DEVICE_TYPE_DEVICE0 = 0;
    public static final int AUDIO_CAPTURE_DEVICE_TYPE_DEVICE1 = 1;
    public static final int AUDIO_CAPTURE_DEVICE_TYPE_DEVICE2 = 2;
    public static final int AUDIO_CAPTURE_DEVICE_TYPE_DEVICE3 = 3;
    public static final int AUDIO_CAPTURE_DEVICE_TYPE_DEVICE4 = 4;
    public static final int AUDIO_CAPTURE_DEVICE_TYPE_DEVICE5 = 5;
    public static final int AUDIO_CAPTURE_SOURCE_MAIN_SOUND = 0;
    public static final int AUDIO_CAPTURE_SOURCE_MICROPHONE_SOUND = 2;
    public static final int AUDIO_CAPTURE_SOURCE_MIXED_SOUND = 3;
    public static final int AUDIO_CAPTURE_SOURCE_SUB_SOUND = 1;
    public static final int AUDIO_CAPTURE_SOURCE_USER_DEFINE1 = 4;
    public static final int AUDIO_CAPTURE_SOURCE_USER_DEFINE2 = 5;
    public static final int AUDIO_DOLBY_DAP_VERSION_V1 = 1;
    public static final int AUDIO_DOLBY_DAP_VERSION_V2 = 2;
    public static final int AUDIO_MUTE_ALL = 19;
    public static final int AUDIO_MUTE_BYBLOCK = 5;
    public static final int AUDIO_MUTE_BYCHIP = 4;
    public static final int AUDIO_MUTE_BYSYNC = 3;
    public static final int AUDIO_MUTE_BYUSER = 2;
    public static final int AUDIO_MUTE_CI = 11;
    public static final int AUDIO_MUTE_DURING_LIMITED_TIME = 9;
    public static final int AUDIO_MUTE_INTERNAL1 = 6;
    public static final int AUDIO_MUTE_INTERNAL2 = 7;
    public static final int AUDIO_MUTE_INTERNAL3 = 8;
    public static final int AUDIO_MUTE_MHEGAP = 10;
    public static final int AUDIO_MUTE_MOMENT = 1;
    public static final int AUDIO_MUTE_PERMANENT = 0;
    public static final int AUDIO_MUTE_SCAN = 12;
    public static final int AUDIO_MUTE_SOURCESWITCH = 13;
    public static final int AUDIO_MUTE_USER_DATA_IN = 20;
    public static final int AUDIO_MUTE_USER_HP = 15;
    public static final int AUDIO_MUTE_USER_SCART1 = 17;
    public static final int AUDIO_MUTE_USER_SCART2 = 18;
    public static final int AUDIO_MUTE_USER_SPDIF = 16;
    public static final int AUDIO_MUTE_USER_SPEAKER = 14;
    public static final int AUDIO_RETURN_NOT_OK = 0;
    public static final int AUDIO_RETURN_OK = 1;
    public static final int AUDIO_RETURN_UNSUPPORT = 2;
    public static final short AUDIO_TYPE_AAC = 3;
    public static final short AUDIO_TYPE_AC3P = 4;
    public static final short AUDIO_TYPE_AC4 = 10;
    public static final short AUDIO_TYPE_DRA1 = 21;
    public static final short AUDIO_TYPE_Dolby_D = 1;
    public static final short AUDIO_TYPE_MPEG = 0;
    public static final int AUDIO_VOL_SOURCE_COMPENSATION = 6;
    public static final int AUDIO_VOL_SOURCE_HP_OUT = 1;
    public static final int AUDIO_VOL_SOURCE_LINE_OUT = 2;
    public static final int AUDIO_VOL_SOURCE_SCART1_OUT = 3;
    public static final int AUDIO_VOL_SOURCE_SCART2_OUT = 4;
    public static final int AUDIO_VOL_SOURCE_SPDIF_OUT = 5;
    public static final int AUDIO_VOL_SOURCE_SPEAKER_OUT = 0;
    public static final int DAP_GAME_MODE = 3;
    public static final int DAP_MODE_PARAM_ATMOS = 3;
    public static final int DAP_MODE_PARAM_AUTO_VOLUME = 2;
    public static final int DAP_MODE_PARAM_DIALOG_ENHANCER = 1;
    public static final int DAP_MODE_PARAM_SURROUND_VIRTUAL = 0;
    public static final int DAP_MOVIE_MODE = 0;
    public static final int DAP_MUSIC_MODE = 1;
    public static final int DAP_NEWS_MODE = 2;
    public static final int DAP_STADIUM_MODE = 4;
    public static final int DAP_STANDARD_MODE = 5;
    public static final int DAP_USER_MODE = 6;
    public static final int DBX_TOTAL_SURROUND_MODE = 145;
    public static final int DOLBY_DAP_BASS_PARAMTER = 11;
    public static final int DOLBY_DAP_CALIBRATION_BOOST = 3;
    public static final int DOLBY_DAP_DE_PARAMTER = 7;
    public static final int DOLBY_DAP_GAIN_PARAMTER = 0;
    public static final int DOLBY_DAP_GEQ_PARAMTER = 9;
    public static final int DOLBY_DAP_IEQ_PARAMTER = 6;
    public static final int DOLBY_DAP_LEVLER_PARAMTER = 4;
    public static final int DOLBY_DAP_MI_PARAMTER = 2;
    public static final int DOLBY_DAP_MODELER_PARAMTER = 5;
    public static final int DOLBY_DAP_OPTIMIZER_PARAMTER = 10;
    public static final int DOLBY_DAP_REGULATOR_PARAMTER = 13;
    public static final int DOLBY_DAP_REG_PARAMTER = 12;
    public static final int DOLBY_DAP_SURROUNDVIRTUALIZER_PARAMTER = 1;
    public static final int DOLBY_DAP_VIRTUAL_BASS_PARAMTER = 14;
    public static final int DOLBY_DAP_VOL_MAX_BOOST = 8;
    public static final int DTV_SOUND_MODE_LEFT = 1;
    public static final int DTV_SOUND_MODE_MIXED = 3;
    public static final int DTV_SOUND_MODE_RIGHT = 2;
    public static final int DTV_SOUND_MODE_STEREO = 0;
    public static final short HE_AAC_LEVEL2 = 88;
    public static final short HE_AAC_LEVEL2_BRAZIL = 44;
    public static final short HE_AAC_LEVEL3 = 89;
    public static final short HE_AAC_LEVEL3_BRAZIL = 45;
    public static final short HE_AAC_LEVEL4 = 90;
    public static final short HE_AAC_LEVEL4_BRAZIL = 46;
    public static final short HE_AAC_LEVEL5 = 91;
    public static final short HE_AAC_LEVEL5_BRAZIL = 47;
    public static final int ON_OFF_TYPE_OFF = 0;
    public static final int ON_OFF_TYPE_ON = 1;
    public static final int PERSONAL_HIGH = 3;
    public static final int PERSONAL_LOW = 1;
    public static final int PERSONAL_MID = 2;
    public static final int PERSONAL_OFF = 0;
    public static final int RESERVE1 = 3;
    public static final int RESERVE2 = 4;
    public static final int RESERVE3 = 5;
    public static final int SOUND_MODE_MOVIE = 2;
    public static final int SOUND_MODE_MUSIC = 1;
    public static final int SOUND_MODE_ONSITE1 = 5;
    public static final int SOUND_MODE_ONSITE2 = 6;
    public static final int SOUND_MODE_SPORTS = 3;
    public static final int SOUND_MODE_STANDARD = 0;
    public static final int SOUND_MODE_USER = 4;
    public static final int SPDIF_TYPE_BYPASS = 3;
    public static final int SPDIF_TYPE_NONPCM = 2;
    public static final int SPDIF_TYPE_OFF = 1;
    public static final int SPDIF_TYPE_PCM = 0;
    public static final int SPDIF_TYPE_TRANSCODE = 4;
    public static final int SURROUND_MODE_OFF = 0;
    public static final int SURROUND_MODE_ON = 1;
    private static final String TAG = "TvAudioManager";
    public static final int TVAUDIO_AP_SET_VOLUME = 1;
    public static final int TVAUDIO_DOLBY_ATMOS_INFO = 1001;
    private static final int TVAUDIO_DOLBY_EVENT_END = 1999;
    private static final int TVAUDIO_DOLBY_EVENT_START = 1000;
    private static final int TVAUDIO_VOLUME_EVENT_END = 999;
    private static final int TVAUDIO_VOLUME_EVENT_START = 0;
    private static TvAudioManager mInstance;
    private static ITvAudio mService;
    private EventHandler mHandler;

    @Deprecated
    private ArrayList<OnAudioEventListener> mAudioListeners = new ArrayList<>();
    private ArrayList<OnVolumeEventListener> mVolumeEventListeners = new ArrayList<>();
    private ArrayList<OnDolbyEventListener> mDolbyEventListeners = new ArrayList<>();

    private class EventHandler extends Handler {
        EventHandler(Looper looper) {
            super(looper);
        }

        @Override // android.os.Handler
        public void handleMessage(Message message) {
            int i2 = message.what;
            if (i2 > 0 && i2 < 999) {
                synchronized (TvAudioManager.this.mVolumeEventListeners) {
                    try {
                        Iterator it = TvAudioManager.this.mVolumeEventListeners.iterator();
                        while (it.hasNext()) {
                            ((OnVolumeEventListener) it.next()).onVolumeEvent(message.what, message.arg1, message.arg2, message.obj);
                        }
                    } finally {
                    }
                }
            } else if (i2 > 1000 && i2 < 1999) {
                synchronized (TvAudioManager.this.mDolbyEventListeners) {
                    try {
                        Iterator it2 = TvAudioManager.this.mDolbyEventListeners.iterator();
                        while (it2.hasNext()) {
                            ((OnDolbyEventListener) it2.next()).onDolbyEvent(message.what, message.arg1, message.arg2, message.obj);
                        }
                    } finally {
                    }
                }
            }
            if (message.what != 1) {
                return;
            }
            synchronized (TvAudioManager.this.mAudioListeners) {
                try {
                    Iterator it3 = TvAudioManager.this.mAudioListeners.iterator();
                    while (it3.hasNext()) {
                        ((OnAudioEventListener) it3.next()).onApSetVolumeEvent(message.what);
                    }
                } finally {
                }
            }
        }
    }

    public interface OnDolbyEventListener {
        boolean onDolbyEvent(int i2, int i3, int i4, Object obj);
    }

    public interface OnVolumeEventListener {
        boolean onVolumeEvent(int i2, int i3, int i4, Object obj);
    }

    private TvAudioManager() throws TvCommonException {
        this.mHandler = null;
        if (true == TvServiceBinder.isNeedBindService()) {
            ITvService tvService = TvServiceBinder.getTvService();
            if (tvService == null) {
                Log.e(TAG, "TvService doesn't exist!!");
                throw new TvCommonException("TvService doesn't exist.");
            }
            try {
                mService = tvService.getTvAudio();
            } catch (RemoteException e2) {
                e2.printStackTrace();
            }
        } else {
            IBinder service = ServiceManager.getService("tv");
            if (service == null) {
                Log.e(TAG, "TvService doesn't exist!!");
                throw new TvCommonException("TvService doesn't exist.");
            }
            try {
                mService = ITvService.Stub.asInterface(service).getTvAudio();
            } catch (RemoteException e3) {
                e3.printStackTrace();
            }
        }
        Looper looperMyLooper = Looper.myLooper();
        if (looperMyLooper != null) {
            this.mHandler = new EventHandler(looperMyLooper);
        } else {
            Looper mainLooper = Looper.getMainLooper();
            if (mainLooper != null) {
                this.mHandler = new EventHandler(mainLooper);
            } else {
                this.mHandler = null;
            }
        }
        try {
            mService.addClient(this);
        } catch (RemoteException e4) {
            e4.printStackTrace();
        }
    }

    public static TvAudioManager getInstance() {
        if (mInstance == null) {
            synchronized (TvAudioManager.class) {
                if (mInstance == null) {
                    try {
                        mInstance = new TvAudioManager();
                    } catch (TvCommonException e2) {
                        e2.printStackTrace();
                        return null;
                    }
                }
            }
        }
        return mInstance;
    }

    public int disableAudioMute(int i2) {
        try {
            return mService.disableMute(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    @Deprecated
    public EnumAudioReturn disableMute(MuteType.EnumMuteType enumMuteType) {
        return EnumAudioReturn.values()[disableAudioMute(enumMuteType.ordinal())];
    }

    public int enableAudioMute(int i2) {
        try {
            return mService.enableMute(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public void enableDap(boolean z2) {
        Log.d(TAG, "enableDap() isEnable = " + z2);
        try {
            mService.enableDap(z2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    public void enableDbx(boolean z2) {
        Log.d(TAG, "enableDbx() isEnable = " + z2);
        try {
            mService.enableDbx(z2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    @Deprecated
    public EnumAudioReturn enableMute(MuteType.EnumMuteType enumMuteType) {
        return EnumAudioReturn.values()[enableAudioMute(enumMuteType.ordinal())];
    }

    public void enableSRS(boolean z2) {
        Log.d(TAG, "enableSRS(), paras isEnable = " + z2);
        try {
            mService.enableSRS(z2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    protected void finalize() throws Throwable {
        Log.d(TAG, "finalize TvAudioManager ");
        try {
            mService.removeClient(this);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    public int getAC4DialogEnhance() {
        int aC4DialogEnhance = -1;
        try {
            aC4DialogEnhance = mService.getAC4DialogEnhance();
            Log.d(TAG, "getAC4DialogEnhance(), return int " + aC4DialogEnhance);
            return aC4DialogEnhance;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return aC4DialogEnhance;
        }
    }

    public AudioAc4Presentation getAC4Presentation(int i2) {
        Log.d(TAG, "getAC4Presentation(), inputSource = " + i2);
        try {
            return mService.getAC4Presentation(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return null;
        }
    }

    public int getADAbsoluteVolume() {
        int aDAbsoluteVolume;
        try {
            aDAbsoluteVolume = mService.getADAbsoluteVolume();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            aDAbsoluteVolume = 0;
        }
        Log.d(TAG, "getADAbsoluteVolume(), get volume = " + aDAbsoluteVolume);
        return aDAbsoluteVolume;
    }

    public boolean getADEnable() {
        boolean aDEnable;
        try {
            aDEnable = mService.getADEnable();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            aDEnable = false;
        }
        Log.d(TAG, "getADEnable(), return enable = " + aDEnable);
        return aDEnable;
    }

    public int getAdvancedSoundEffect(int i2) {
        Log.d(TAG, "getAdvancedSoundEffect() advancedSoundParamType = " + i2);
        try {
            return mService.getAdvancedSoundEffect(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public int getAudioBassSwitch() {
        try {
            return mService.getBassSwitch();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public int getAudioCapability(int i2) {
        try {
            return mService.getAudioCapability(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public int getAudioDtvOutputMode() {
        try {
            return mService.getDtvOutputMode();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public int getAudioOutmode() {
        Log.d(TAG, "getAudioOutmode()");
        try {
            return mService.getAudioOutmode();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public int getAudioPowerOnOffMusic() {
        try {
            return mService.getPowerOnOffMusic();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public int getAudioSeparateHear() {
        try {
            return mService.getSeparateHear();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public int getAudioSoundMode() {
        try {
            return mService.getSoundMode();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public int getAudioSpdifOutMode() {
        try {
            return mService.getSpdifOutMode();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public int getAudioSurroundMode() {
        try {
            return mService.getSurroundMode();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public int getAudioTrueBass() {
        try {
            return mService.getTrueBass();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public int getAudioWallmusic() {
        try {
            return mService.getWallmusic();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public boolean getAvcMode() {
        try {
            Log.d(TAG, "getAvcMode()");
            return mService.getAvcMode();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public int getBalance() {
        int balance = -1;
        try {
            balance = mService.getBalance();
            Log.d(TAG, "getBalance(), return int " + balance);
            return balance;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return balance;
        }
    }

    public int getBass() {
        int bass = -1;
        try {
            bass = mService.getBass();
            Log.d(TAG, "getBass(), return int " + bass);
            return bass;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return bass;
        }
    }

    @Deprecated
    public EnumOnOffType getBassSwitch() {
        return EnumOnOffType.values()[getAudioBassSwitch()];
    }

    public int getBassVolume() {
        int bassVolume = -1;
        try {
            bassVolume = mService.getBassVolume();
            Log.d(TAG, "getBassVolume(), return int " + bassVolume);
            return bassVolume;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return bassVolume;
        }
    }

    public AudioSrsTableEntry[] getDTSSRSTable() {
        try {
            return mService.getDTSSRSTable();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return null;
        }
    }

    public int getDolbyDapMode() {
        Log.d(TAG, "getDolbyDapMode()");
        try {
            return mService.getDolbyDapMode();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public DolbyDapParamter getDolbyDapParam(int i2) {
        Log.d(TAG, "getDolbyDapParam()");
        try {
            return mService.getDolbyDapParam(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return null;
        }
    }

    public int getDolbyDapUserParam(int i2) {
        Log.d(TAG, "getDolbyDapUserParam() dapPersonalParam = " + i2);
        try {
            return mService.getDolbyDapUserParam(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    @Deprecated
    public EnumDtvSoundMode getDtvOutputMode() {
        return EnumDtvSoundMode.values()[getAudioDtvOutputMode()];
    }

    public int getEarPhoneVolume() {
        int earPhoneVolume = -1;
        try {
            earPhoneVolume = mService.getEarPhoneVolume();
            Log.d(TAG, "getEarPhoneVolume(), return int " + earPhoneVolume);
            return earPhoneVolume;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return earPhoneVolume;
        }
    }

    public int getEqBand10k() {
        int eqBand10k = -1;
        try {
            eqBand10k = mService.getEqBand10k();
            Log.d(TAG, "getEqBand10k(), return int " + eqBand10k);
            return eqBand10k;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return eqBand10k;
        }
    }

    public int getEqBand120() {
        int eqBand120 = -1;
        try {
            eqBand120 = mService.getEqBand120();
            Log.d(TAG, "getEqBand120(), return int " + eqBand120);
            return eqBand120;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return eqBand120;
        }
    }

    public int getEqBand1500() {
        int eqBand1500 = -1;
        try {
            eqBand1500 = mService.getEqBand1500();
            Log.d(TAG, "getEqBand1500(), return int " + eqBand1500);
            return eqBand1500;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return eqBand1500;
        }
    }

    public int getEqBand500() {
        int eqBand500 = -1;
        try {
            eqBand500 = mService.getEqBand500();
            Log.d(TAG, "getEqBand500(), return int " + eqBand500);
            return eqBand500;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return eqBand500;
        }
    }

    public int getEqBand5k() {
        int eqBand5k = -1;
        try {
            eqBand5k = mService.getEqBand5k();
            Log.d(TAG, "getEqBand5k(), return int " + eqBand5k);
            return eqBand5k;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return eqBand5k;
        }
    }

    public boolean getHDMITx_HDByPass() {
        Log.d(TAG, "getHDMITx_HDByPass()");
        try {
            return mService.getHDMITx_HDByPass();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean getHOHStatus() {
        boolean hOHStatus;
        try {
            hOHStatus = mService.getHOHStatus();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            hOHStatus = false;
        }
        Log.d(TAG, "getHOHStatus(), return state = " + hOHStatus);
        return hOHStatus;
    }

    @Deprecated
    public EnumOnOffType getPowerOnOffMusic() {
        return EnumOnOffType.values()[getAudioPowerOnOffMusic()];
    }

    public int getSNDAC3PInfo(int i2) {
        int sNDAC3PInfo;
        try {
            sNDAC3PInfo = mService.getSNDAC3PInfo(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            sNDAC3PInfo = 0;
        }
        Log.d(TAG, "getSNDAC3PInfo(), get MixerBalance = " + sNDAC3PInfo);
        return sNDAC3PInfo;
    }

    @Deprecated
    public EnumOnOffType getSeparateHear() {
        return EnumOnOffType.values()[getAudioSeparateHear()];
    }

    @Deprecated
    public EnumSoundMode getSoundMode() {
        return EnumSoundMode.values()[getAudioSoundMode()];
    }

    public int getSoundSpdifDelay() {
        int soundSpdifDelay = -1;
        try {
            soundSpdifDelay = mService.getSoundSpdifDelay();
            Log.d(TAG, "getSoundSpdifDelay(), return int " + soundSpdifDelay);
            return soundSpdifDelay;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return soundSpdifDelay;
        }
    }

    public int getSoundSpeakerDelay() {
        int soundSpeakerDelay = -1;
        try {
            soundSpeakerDelay = mService.getSoundSpeakerDelay();
            Log.d(TAG, "getSoundSpeakerDelay(), return int " + soundSpeakerDelay);
            return soundSpeakerDelay;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return soundSpeakerDelay;
        }
    }

    @Deprecated
    public EnumSpdifType getSpdifOutMode() {
        return EnumSpdifType.values()[getAudioSpdifOutMode()];
    }

    public int getSpeakerVolume() {
        int speakerVolume = -1;
        try {
            speakerVolume = mService.getSpeakerVolume();
            Log.d(TAG, "getSpeakerVolume(), return int " + speakerVolume);
            return speakerVolume;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return speakerVolume;
        }
    }

    @Deprecated
    public EnumSurroundMode getSurroundMode() {
        return EnumSurroundMode.values()[getAudioSurroundMode()];
    }

    public int getTreble() {
        int treble = -1;
        try {
            treble = mService.getTreble();
            Log.d(TAG, "getTreble(), return int " + treble);
            return treble;
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return treble;
        }
    }

    @Deprecated
    public EnumOnOffType getTrueBass() {
        return EnumOnOffType.values()[getAudioTrueBass()];
    }

    public boolean getVDEnable() {
        boolean vDEnable;
        try {
            vDEnable = mService.getVDEnable();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            vDEnable = false;
        }
        Log.d(TAG, "getVDEnable(), return enable = " + vDEnable);
        return vDEnable;
    }

    @Deprecated
    public EnumOnOffType getWallmusic() {
        return EnumOnOffType.values()[getAudioWallmusic()];
    }

    public boolean isDapEnable() {
        Log.d(TAG, "isDapEnable()");
        try {
            return mService.isDapEnable();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean isDbxEnable() {
        Log.d(TAG, "isDbxEnable()");
        try {
            return mService.isDbxEnable();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean isSRSEnable() {
        boolean zIsSRSEnable;
        try {
            zIsSRSEnable = mService.isSRSEnable();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            zIsSRSEnable = false;
        }
        Log.d(TAG, "isSRSEnable(), return = " + zIsSRSEnable);
        return zIsSRSEnable;
    }

    public boolean isSupportHDMITx_HDByPassMode() {
        Log.d(TAG, "isSupportHDMITx_HDByPassMode()");
        try {
            return mService.isSupportHDMITx_HDByPassMode();
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    @Override // com.mstar.android.tv.IEventClient
    public boolean onEvent(Message message) throws RemoteException {
        EventHandler eventHandler = this.mHandler;
        if (eventHandler == null) {
            return true;
        }
        Message messageObtainMessage = eventHandler.obtainMessage();
        messageObtainMessage.copyFrom(message);
        this.mHandler.sendMessage(messageObtainMessage);
        return true;
    }

    @Deprecated
    public void registerOnAudioEventListener(OnAudioEventListener onAudioEventListener) {
        Log.d(TAG, "registerOnAudioEventListener");
        synchronized (this.mAudioListeners) {
            this.mAudioListeners.add(onAudioEventListener);
        }
    }

    public boolean registerOnDolbyEventListener(OnDolbyEventListener onDolbyEventListener) {
        Log.d(TAG, "registerOnDolbyEventListener");
        synchronized (this.mDolbyEventListeners) {
            this.mDolbyEventListeners.add(onDolbyEventListener);
        }
        return true;
    }

    public boolean registerOnVolumeEventListener(OnVolumeEventListener onVolumeEventListener) {
        Log.d(TAG, "registerOnVolumeEventListener");
        synchronized (this.mVolumeEventListeners) {
            this.mVolumeEventListeners.add(onVolumeEventListener);
        }
        return true;
    }

    public int setAC4DialogEnhance(int i2, int i3) {
        Log.d(TAG, "setAC4DialogEnhance(), value = " + i2 + ", inputSource = " + i3);
        try {
            return mService.setAC4DialogEnhance(i2, i3);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public int setAC4Presentation(int i2, int i3) {
        Log.d(TAG, "setAC4Presentation(), index = " + i2 + ", inputSource = " + i3);
        try {
            return mService.setAC4Presentation(i2, i3);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    public void setADAbsoluteVolume(int i2) {
        Log.d(TAG, "setADAbsoluteVolume(), paras volume = " + i2);
        try {
            mService.setADAbsoluteVolume(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    public void setADEnable(boolean z2) {
        Log.d(TAG, "setADEnable(), paras enable = " + z2);
        try {
            TvChannelManager.getInstance().sendMheg5IcsCommand(!z2 ? 2 : 1, TvLanguage.ESPERANTO);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
        try {
            mService.setADEnable(z2);
        } catch (RemoteException e3) {
            e3.printStackTrace();
        }
    }

    public void setAdvancedSoundEffect(int i2, int i3) {
        Log.d(TAG, "setAdvancedSoundEffect() advancedSoundParamType = " + i2 + ", advancedSoundParameterVo = " + i3);
        try {
            mService.setAdvancedSoundEffect(i2, i3);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    public boolean setAudioBassSwitch(int i2) {
        Log.d(TAG, "setBassSwitch(), paras onOffType = " + i2);
        try {
            return mService.setBassSwitch(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    @Deprecated
    public EnumAudioReturn setAudioCaptureSource(EnumAuidoCaptureDeviceType enumAuidoCaptureDeviceType, EnumAuidoCaptureSource enumAuidoCaptureSource) {
        return EnumAudioReturn.values()[setAudioCaptureSource(enumAuidoCaptureDeviceType.ordinal(), enumAuidoCaptureSource.ordinal())];
    }

    public void setAudioDtvOutputMode(int i2) {
        Log.d(TAG, "setDtvOutputMode(), paras dtvSoundMode = " + i2);
        try {
            mService.setDtvOutputMode(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    public boolean setAudioMode(int i2) {
        Log.d(TAG, "setAudioMode(), mode = " + i2);
        try {
            return mService.setAudioMode(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setAudioOutmode(int i2) {
        Log.d(TAG, "setAudioOutmode() ,AudioOutmode =" + i2);
        try {
            return mService.setAudioOutmode(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setAudioPowerOnOffMusic(int i2) {
        Log.d(TAG, "setPowerOnOffMusic(), paras onOffType = " + i2);
        try {
            return mService.setPowerOnOffMusic(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setAudioSeparateHear(int i2) {
        Log.d(TAG, "setSeparateHear(), paras onOffType = " + i2);
        try {
            return mService.setSeparateHear(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setAudioSoundMode(int i2) {
        Log.d(TAG, "setSoundMode(), paras SoundMode = " + i2);
        try {
            return mService.setSoundMode(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return true;
        }
    }

    public boolean setAudioSpdifOutMode(int i2) {
        Log.d(TAG, "setSpdifOutMode(), paras SpdifMode = " + i2);
        try {
            return mService.setSpdifOutMode(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setAudioSurroundMode(int i2) {
        Log.d(TAG, "setSurroundMode(), paras surroundMode = " + i2);
        try {
            return mService.setSurroundMode(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setAudioTrueBass(int i2) {
        Log.d(TAG, "setTrueBass(), paras onOffType = " + i2);
        try {
            return mService.setTrueBass(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setAudioWallmusic(int i2) {
        Log.d(TAG, "setWallmusic(), paras onOffType = " + i2);
        try {
            return mService.setWallmusic(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setAvcMode(boolean z2) {
        Log.d(TAG, "setAvcMode(), paras isAvcEnable = " + z2);
        try {
            return mService.setAvcMode(z2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setBalance(int i2) {
        Log.d(TAG, "setBalance(), paras balanceValue = " + i2);
        try {
            return mService.setBalance(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setBass(int i2) {
        Log.d(TAG, "setBass(), paras bassValue = " + i2);
        try {
            return mService.setBass(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    @Deprecated
    public boolean setBassSwitch(EnumOnOffType enumOnOffType) {
        Log.d(TAG, "setBassSwitch(), paras en = " + enumOnOffType);
        return setAudioBassSwitch(enumOnOffType.ordinal());
    }

    public boolean setBassVolume(int i2) {
        Log.d(TAG, "setBassVolume(), paras volume = " + i2);
        try {
            return mService.setBassVolume(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setDTSSRSTable(AudioSrsTableEntry[] audioSrsTableEntryArr) {
        try {
            return mService.setDTSSRSTable(audioSrsTableEntryArr);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public void setDolbyDapMode(int i2) {
        Log.d(TAG, "setDolbyDapMode() dapMode = " + i2);
        try {
            mService.setDolbyDapMode(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    public void setDolbyDapParam(int i2, DolbyDapParamter dolbyDapParamter) {
        Log.d(TAG, "setDolbyDapParam()");
        try {
            mService.setDolbyDapParam(i2, dolbyDapParamter);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    public void setDolbyDapUserParam(int i2, int i3) {
        Log.d(TAG, "setDolbyDapUserParam() dapPersonalParam = " + i2 + ", dapPersonalSetting = " + i3);
        try {
            mService.setDolbyDapUserParam(i2, i3);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    @Deprecated
    public void setDtvOutputMode(EnumDtvSoundMode enumDtvSoundMode) {
        Log.d(TAG, "setDtvOutputMode(), paras enDtvSoundMode = " + enumDtvSoundMode);
        setAudioDtvOutputMode(enumDtvSoundMode.ordinal());
    }

    public boolean setEarPhoneVolume(int i2) {
        Log.d(TAG, "setEarPhoneVolume(), paras volume = " + i2);
        return setEarPhoneVolume(i2, true);
    }

    public boolean setEqBand10k(int i2) {
        Log.d(TAG, "setEqBand10k(), paras eqValue = " + i2);
        try {
            return mService.setEqBand10k(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setEqBand120(int i2) {
        Log.d(TAG, "setEqBand120(), paras eqValue = " + i2);
        try {
            return mService.setEqBand120(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setEqBand1500(int i2) {
        Log.d(TAG, "setEqBand1500(, paras eqValue = " + i2);
        try {
            return mService.setEqBand1500(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setEqBand500(int i2) {
        Log.d(TAG, "setEqBand500(), paras eqValue = " + i2);
        try {
            return mService.setEqBand500(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean setEqBand5k(int i2) {
        Log.d(TAG, "setEqBand5k(), paras eqValue = " + i2);
        try {
            return mService.setEqBand5k(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public void setHDMITx_HDByPass(boolean z2) {
        Log.d(TAG, "setHDMITx_HDByPass(), paras enable = " + z2);
        try {
            mService.setHDMITx_HDByPass(z2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    public void setHOHStatus(boolean z2) {
        Log.d(TAG, "setHOHStatus(), paras state = " + z2);
        try {
            mService.setHOHStatus(z2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    public int setOutputSourceInfo(int i2, int i3) {
        Log.d(TAG, "setOutputSourceInfo()");
        try {
            return mService.setOutputSourceInfo(i2, i3);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }

    @Deprecated
    public boolean setPowerOnOffMusic(EnumOnOffType enumOnOffType) {
        Log.d(TAG, "setPowerOnOffMusic(), paras en = " + enumOnOffType);
        return setAudioPowerOnOffMusic(enumOnOffType.ordinal());
    }

    public void setSNDAC3PInfo(int i2, int i3, int i4) {
        Log.d(TAG, "setSNDAC3PInfo(), paras infoType = " + i2 + ", param1 = " + i3 + ", param2 = " + i4);
        try {
            mService.setSNDAC3PInfo(i2, i3, i4);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    @Deprecated
    public boolean setSeparateHear(EnumOnOffType enumOnOffType) {
        Log.d(TAG, "setSeparateHear(), paras en = " + enumOnOffType);
        return setAudioSeparateHear(enumOnOffType.ordinal());
    }

    @Deprecated
    public boolean setSoundMode(EnumSoundMode enumSoundMode) {
        Log.d(TAG, "setSoundMode(), paras SoundMode = " + enumSoundMode);
        return setAudioSoundMode(enumSoundMode.ordinal());
    }

    public void setSoundSpdifDelay(int i2) {
        Log.d(TAG, "setSoundSpdifDelay(), paras delay = " + i2);
        try {
            mService.setSoundSpdifDelay(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    public void setSoundSpeakerDelay(int i2) {
        Log.d(TAG, "setSoundSpeakerDelay(), paras delay = " + i2);
        try {
            mService.setSoundSpeakerDelay(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    @Deprecated
    public boolean setSpdifOutMode(EnumSpdifType enumSpdifType) {
        Log.d(TAG, "setSpdifOutMode(), paras SpdifMode = " + enumSpdifType);
        return setAudioSpdifOutMode(enumSpdifType.ordinal());
    }

    public void setSpeakerVolume(int i2) {
        Log.d(TAG, "setSpeakerVolume(), paras volume = " + i2);
        try {
            mService.setSpeakerVolume(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    @Deprecated
    public boolean setSurroundMode(EnumSurroundMode enumSurroundMode) {
        Log.d(TAG, "setSurroundMode(), paras surroundMode = " + enumSurroundMode);
        return setAudioSurroundMode(enumSurroundMode.ordinal());
    }

    public boolean setTreble(int i2) {
        Log.d(TAG, "setTreble(), paras bassValue = " + i2);
        try {
            return mService.setTreble(i2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    @Deprecated
    public boolean setTrueBass(EnumOnOffType enumOnOffType) {
        Log.d(TAG, "setTrueBass(), paras en = " + enumOnOffType);
        return setAudioTrueBass(enumOnOffType.ordinal());
    }

    public void setVDEnable(boolean z2) {
        Log.d(TAG, "setVDEnable(), paras enable = " + z2);
        try {
            mService.setVDEnable(z2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
        }
    }

    @Deprecated
    public boolean setWallmusic(EnumOnOffType enumOnOffType) {
        Log.d(TAG, "setWallmusic(), paras en = " + enumOnOffType);
        return setAudioWallmusic(enumOnOffType.ordinal());
    }

    @Deprecated
    public synchronized boolean unregisterOnAudioEventListener(OnAudioEventListener onAudioEventListener) {
        synchronized (this.mAudioListeners) {
            this.mAudioListeners.remove(onAudioEventListener);
            Log.d(TAG, "unregisterOnAudioEventListener  size: " + this.mAudioListeners.size());
        }
        return true;
    }

    public boolean unregisterOnDolbyEventListener(OnDolbyEventListener onDolbyEventListener) {
        synchronized (this.mDolbyEventListeners) {
            this.mDolbyEventListeners.remove(onDolbyEventListener);
            Log.d(TAG, "unregisterOnDolbyEventListener  size: " + this.mDolbyEventListeners.size());
        }
        return true;
    }

    public boolean unregisterOnVolumeEventListener(OnVolumeEventListener onVolumeEventListener) {
        synchronized (this.mVolumeEventListeners) {
            this.mVolumeEventListeners.remove(onVolumeEventListener);
            Log.d(TAG, "unregisterOnVolumeEventListener  size: " + this.mVolumeEventListeners.size());
        }
        return true;
    }

    public boolean setEarPhoneVolume(int i2, boolean z2) {
        Log.d(TAG, "setEarPhoneVolume(volume, saveDb), paras volume = " + i2 + "paras saveDb = " + z2);
        try {
            return mService.setEarPhoneVolume(i2, z2);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public int setAudioCaptureSource(int i2, int i3) {
        try {
            return mService.setAudioCaptureSource(i2, i3);
        } catch (RemoteException e2) {
            e2.printStackTrace();
            return 0;
        }
    }
}
