SystemUI: implement bluetooth scan timeout

When we dock with Pixel C keyboard we normally expect to find it, and so
we perform a low latency scan (which uses highest duty cycle). But if
keyboard is not charged or if tablet mode trigger misfires (because
there was a magnetic object in proximity?) we may not find the keyboard
and will continue scanning indefinitely, impacting WiFi performance and
draining battery. To avoid this scenario let's stop scan if we do not
find "our" device in 30 seconds.

Also remove STATE_WAITING_FOR_STATE_PAIRED as it was unused.

Change-Id: I4bf1a9a163d3165eaa5e8f1cc2d2938465d454af
(cherry picked from commit 6c12c3a6538591b5fa6e11cb4f583aa494e0ce5c)
Signed-off-by: David Riley <davidriley@google.com>
1 file changed