From 3988d11dddec8126c60b4e5a12950915bdc83647 Mon Sep 17 00:00:00 2001 From: Chaohui Wang Date: Fri, 12 May 2023 16:25:27 +0800 Subject: [PATCH] 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 --- src/com/android/settings/network/tether/TetherSettings.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/network/tether/TetherSettings.java b/src/com/android/settings/network/tether/TetherSettings.java index ba19d1c129b..9fa8730cf10 100644 --- a/src/com/android/settings/network/tether/TetherSettings.java +++ b/src/com/android/settings/network/tether/TetherSettings.java @@ -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(); } }