Reland "sm: update IO capability based on the presence of passkey request/display observers"

This is a reland of 2495a5a717c306cad1bcaf2ba51e62c229c46b18

Original change's description:
> sm: update IO capability based on the presence of passkey request/display observers
>
> The IO capability should be updated based on whether there are handlers
> for passkey display and passkey request. If there is any ongoing pairing
> when a client register itself as the observer, the IO capability will be
> updated once the current pairing session is done.
>
> BUG=chromium:862849
> TEST=Run the test program on veyron_minnie with "restart bluetoothd &&
>      new_blue_test pair <the target LE keyboard address>" and enter passkey on
>      the target LE keyboard
>
> Change-Id: I0eb38d49d5b317f0ba184910741af93f3c102b1e

BUG=chromium:863613
TEST=See above
CQ-DEPEND=CL:1186082

Change-Id: I3a208a987c003e64a24003c31827805238d70e44
Reviewed-on: https://chromium-review.googlesource.com/1186042
Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
3 files changed