From 9b70bd65684c52652da5def01d0d14fe6c32c031 Mon Sep 17 00:00:00 2001 From: Lei Qian Date: Tue, 26 Sep 2017 04:03:01 +0000 Subject: Revert "AVIN: release source at first when plugged in [3/3]" This reverts commit fc96590a622424cce4f2fcfbd60829999b2bea87. Change-Id: I26dd5880160294c884615ef4a4d7f711266bd0a9 --- diff --git a/tv_input.cpp b/tv_input.cpp index ea9f225..e2afe80 100644 --- a/tv_input.cpp +++ b/tv_input.cpp @@ -147,25 +147,15 @@ void TvCallback::onTvEvent (int32_t msgType, const Parcel &p) int connectState = p.readInt32(); LOGD("TvCallback::onTvEvent source = %d, status = %d", source, connectState); - bool isHotplugDetectOn = priv->mpTv->GetHdmiAvHotplugDetectOnoff(); - if (isHotplugDetectOn) { - if (source != SOURCE_HDMI1 && source != SOURCE_HDMI2 && source != SOURCE_HDMI3 - && source != SOURCE_HDMI4 && source != SOURCE_AV1 && source != SOURCE_AV2) - break; - - if (connectState == 1) { - notify_tv_device_status(priv, source, TV_INPUT_EVENT_DEVICE_AVAILABLE); - notify_tv_device_status(priv, source, TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED); - } else { - notify_tv_device_status(priv, source, TV_INPUT_EVENT_DEVICE_UNAVAILABLE); - } + if (source != SOURCE_HDMI1 && source != SOURCE_HDMI2 && source != SOURCE_HDMI3 + && source != SOURCE_HDMI4 && source != SOURCE_AV1 && source != SOURCE_AV2) + break; + + if (connectState == 1) { + notify_tv_device_status(priv, source, TV_INPUT_EVENT_DEVICE_AVAILABLE); + notify_tv_device_status(priv, source, TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED); } else { - if (connectState == 1 && (source == SOURCE_AV1 || source == SOURCE_AV2)) { - // need close afe at first ,it's a workarround way - notify_tv_device_status(priv, source, TV_INPUT_EVENT_DEVICE_UNAVAILABLE); - notify_tv_device_status(priv, source, TV_INPUT_EVENT_DEVICE_AVAILABLE); - notify_tv_device_status(priv, source, TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED); - } + notify_tv_device_status(priv, source, TV_INPUT_EVENT_DEVICE_UNAVAILABLE); } break; } @@ -225,8 +215,8 @@ static void available_all_tv_device(tv_input_private_t *priv) bool isHotplugDetectOn = priv->mpTv->GetHdmiAvHotplugDetectOnoff(); - // if (isHotplugDetectOn) - priv->mpTv->setTvObserver(priv->tvcallback); + if (isHotplugDetectOn) + priv->mpTv->setTvObserver(priv->tvcallback); for (int i=0; i < count; i++) { tv_source_input_t source_input = (tv_source_input_t)tv_devices[i]; -- cgit