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

Commit 3988d11d authored by Chaohui Wang's avatar Chaohui Wang
Browse files

Fix Bluetooth tethering toggle status

The mBluetoothPan is updated async, toggle status is set before data
loaded.

Refresh the status after load to fix this issue.

Fix: 272525310
Test: Manually when Bluetooth tethering is on
Change-Id: Ia306f3648ba8d32a63a8ec6c72260f7f43b830bc
parent 0af8c603
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -171,6 +171,8 @@ public class TetherSettings extends RestrictedSettingsFragment
            return;
        }

        setupTetherPreference();

        final Activity activity = getActivity();
        BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
        if (adapter != null) {
@@ -184,7 +186,6 @@ public class TetherSettings extends RestrictedSettingsFragment
                    new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED));
        }

        setupTetherPreference();
        setTopIntroPreferenceTitle();

        mDataSaverBackend.addListener(this);
@@ -605,6 +606,7 @@ public class TetherSettings extends RestrictedSettingsFragment
                public void onServiceConnected(int profile, BluetoothProfile proxy) {
                    if (mBluetoothPan.get() == null) {
                        mBluetoothPan.set((BluetoothPan) proxy);
                        updateBluetoothState();
                    }
                }