bluetooth won't turn on after turn Airplane mode off on setting screen on manta(tablet)
The root cause is normally when change the airplane mode, the bluetooth setting UI will not be foreground. No listener is setup for bluetooth setting UI when it is in background. So the onCheckedChanged won't be called and mLocalAdapter.setBluetoothEnabled won't be called. But for manta, airplane mode setting and bluetooth setting UI both will show on the foreground due to bigger screen size. When we turn ariplane mode on, bluetooth manager service will disable bluetooth without changing the persist bluetooth setting. But bluetooth setting UI will listen to the bluetooth state change intent, it will receive bluetooth state turn-off intent then it will call mSwitch.setChecked(false) in handleStateChanged, which cause checked status changed from true to false to trigger the listener (onCheckedChanged) being called. The listener will call mAdapter.disable() which will call mManagerService.disable(true) to change bluetooth persist state to OFF. So when we turn back airplane more to OFF, due to the bluetooth persist state is OFF, we won't turn back bluetooth to ON. Don't need to consider thread synchronization, because everything is running on the main thread. bug 7366814 Change-Id: I138d1904df6cb17c7828295caa51a7d80abf99f2
Loading
Please register or sign in to comment