CRAS: iodev_list - Fix pinned stream on already enabled dev

An earlier commit 5e1e698 checks iodev's enable state to
avoid multiple threads accessing the same iodev.
This check breaks pinned stream usage, because when a pinned
stream is connected, the pinned device doesn't have to be
added to the enabled dev list.

In other words, 'pinned' state and 'enabled' state of iodev
are independent. Fix the problem by removing the check.
The potential issue of multiple threads accessing pinned device
will be addressed in future commits.

Updated unittest AddRemovePinnedStream to cover this regression
case.

BUG=chromium:870648
TEST=unittest
cras_test_client --capture_file /tmp/1 --pin_device <id>
where <id> is an enabled iodev. Then use
cras_test_client --dump_a to verify stream is added.

Change-Id: Ie2b32b3478e92ac737a5d283c50f0bfbbd4e89fa
Reviewed-on: https://chromium-review.googlesource.com/1161860
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2 files changed