void check_jack_port(void *data)
{
bool is_jack_connected;
- bool is_tv_out_connected;
int ret;
retm_if(data == NULL, "Invalid parameter!");
ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_AUDIO_JACK_CONNECTED, &is_jack_connected);
retm_if(ret != RUNTIME_INFO_ERROR_NONE, "runtime_info_get_value_bool failed[%s]", get_error_message(ret));
- ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_TV_OUT_CONNECTED, &is_tv_out_connected);
- retm_if(ret != RUNTIME_INFO_ERROR_NONE, "runtime_info_get_value_bool failed[%s]", get_error_message(ret));
-
- if (is_jack_connected || is_tv_out_connected) {
+ if (is_jack_connected) {
_D("Earphone connected");
show_image_icon();
- } else
+ } else {
+ _D("Earphone disonnected");
hide_image_icon();
+ }
}
void indicator_earphone_change_cb(runtime_info_key_e key, void *data)
ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_AUDIO_JACK_CONNECTED, indicator_earphone_change_cb, data);
retvm_if(ret != RUNTIME_INFO_ERROR_NONE, FAIL, "runtime_info_set_changed_cb failed[%s]", get_error_message(ret));
- ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_TV_OUT_CONNECTED, indicator_earphone_change_cb, data);
- retvm_if(ret != RUNTIME_INFO_ERROR_NONE, FAIL, "runtime_info_set_changed_cb failed[%s]", get_error_message(ret));
-
check_jack_port(data);
return ret;
ret = runtime_info_unset_changed_cb(RUNTIME_INFO_KEY_AUDIO_JACK_CONNECTED);
retvm_if(ret != RUNTIME_INFO_ERROR_NONE, FAIL, "runtime_info_unset_changed_cb failed[%s]", get_error_message(ret));
- ret = runtime_info_unset_changed_cb(RUNTIME_INFO_KEY_TV_OUT_CONNECTED);
- retvm_if(ret != RUNTIME_INFO_ERROR_NONE, FAIL, "runtime_info_unset_changed_cb failed[%s]", get_error_message(ret));
-
return ret;
}