+EXPORT_API
+int mm_sound_is_stream_on_device(int stream_id, MMSoundDevice_t device_h, bool *is_on)
+{
+ int ret = MM_ERROR_NONE;
+ int i;
+ mm_sound_device_t *device = (mm_sound_device_t*)device_h;
+ bool _is_on = false;
+
+ if(!device || !is_on) {
+ debug_error("invalid argument\n");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+
+ if (device->stream_num >= 0) {
+ debug_log("device_handle has stream id");
+ for (i = 0; i < device->stream_num; i++) {
+ if (device->stream_id[i] == stream_id) {
+ _is_on = true;
+ break;
+ }
+ }
+ } else {
+ debug_log("device_handle dosn't have stream id");
+ /* No information about stream in client-side, should ask to server-side */
+ if ((ret = mm_sound_client_is_stream_on_device(stream_id, device->id, &_is_on)) < 0) {
+ debug_error("Failed to query is stream on");
+ return MM_ERROR_SOUND_INTERNAL;
+ }
+ }
+
+ debug_log("device(%d) %s stream(%d)\n", device->id, _is_on ? "has" : "doesn't have", stream_id);
+ *is_on = _is_on;
+
+ return ret;
+}