Remove unnecessary notify in BT preference

notifyHierarchyChanged() is used before when we have
connected/disconnect deivce in same list. So only use it in
DevicePickerFragment.java, not other normal fragments.

Also that call will rebuild whole preference list, which is heavy.

Bug: 119479725
Test: Manual
Change-Id: I06cf221588001b38634fec9f02dee8bc1e561ea8
This commit is contained in:
jackqdyulei
2019-03-29 15:00:07 -07:00
parent d94d72a16c
commit 36948cefe9
4 changed files with 27 additions and 12 deletions

View File

@@ -151,6 +151,12 @@ public final class DevicePickerFragment extends DeviceListPreferenceFragment {
}
}
@Override
protected void initDevicePreference(BluetoothDevicePreference preference) {
super.initDevicePreference(preference);
preference.setNeedNotifyHierarchyChanged(true);
}
@Override
public void onBluetoothStateChanged(int bluetoothState) {
super.onBluetoothStateChanged(bluetoothState);