+ return;
+ }
+
+ switch (type) {
+ case MM_SOUND_DEVICE_TYPE_AUDIOJACK:
+ case MM_SOUND_DEVICE_TYPE_BLUETOOTH:
+ case MM_SOUND_DEVICE_TYPE_HDMI:
+ case MM_SOUND_DEVICE_TYPE_MIRRORING:
+ case MM_SOUND_DEVICE_TYPE_USB_AUDIO:
+ if (!is_connected) {
+ debug_warning("sound device unplugged");
+ result = MMSoundMgrCodecStop(slotid);
+ if (result != MM_ERROR_NONE)
+ debug_error("MMSoundMgrCodecStop error %d\n", result);
+
+ result = mm_sound_remove_device_connected_callback(g_slots[slotid].subs_id);
+ if (result != MM_ERROR_NONE)
+ debug_error("mm_sound_remove_device_connected_callback error %d\n", result);
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+#endif
+
+/* FIXME : critical section for g_timer_id? */
+static void _mm_sound_mgr_codec_shutdown_timer_start()
+{
+ if (g_timer_id > 0) {
+ debug_error("Already active timer [%d] exists", g_timer_id);
+ return;
+ }
+
+ if (g_shutdown_cb) {
+ g_timer_id = g_timeout_add_seconds(SHUTDOWN_TIMEOUT_SEC, g_shutdown_cb, NULL);
+ debug_error("TIMER : new timer [%d]", g_timer_id);