OSDN Git Service

Fix for Bluetooth not restarting on User Switch
authorRam Periathiruvadi <ramperry@google.com>
Thu, 4 May 2017 02:11:20 +0000 (19:11 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Tue, 16 May 2017 00:22:55 +0000 (00:22 +0000)
commit7d1203a2f4fdbafe26d33421c3cdd83f07a5fba8
treefc93e7721f2730db27ffbffdeaa8c82003f900e5
parent73818566d6cdab38b96a9a6dbf773f11b166526c
Fix for Bluetooth not restarting on User Switch

The flag that keeps track of the Bluetooth adapter status(mEnable) is
not guarded correctly and could go out of sync with the adapter status.
This causes User Switch handling to not function correctly since it
checks for the status of the mEnable flag before restarting Bluetooth.
This fix queries the Bluetooth Adapter for the status instead of using
the mEnable flag.

Bug: b/37648701
Test: Tested switching users multiple times in both phone and carkit.
Also tested pairing and connection for sanity.

Change-Id: I17facecf8e1de90df11c11d5b0a184f48a0356e4
services/core/java/com/android/server/BluetoothManagerService.java