Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ec16c0ae authored by Zhihai Xu's avatar Zhihai Xu
Browse files

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
parent 35bbbc6c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment