CRAS: bt - Extract open dev logic to its own function
The BT profile switching returns -EAGAIN and re-opens dev again.
Move the logic to open_dev so it does not make update_supported_formats
fail. This fixes switching BT profile from A2DP to HFP because the BT
close_dev switches profile back to A2DP if update_supported_formats
returns an error.
BUG=b:65299903
TEST=Tested on Eve.
Change-Id: I42259c0860b8cf7db110ebd3a2667279ef729d90
Reviewed-on: https://chromium-review.googlesource.com/724999
Commit-Ready: Chinyue Chen <chinyue@chromium.org>
Tested-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Wu-Cheng Li <wuchengli@chromium.org>
2 files changed