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:
@@ -166,7 +166,7 @@ public class BluetoothDevicePreferenceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVisible_showDeviceWithoutNames_visible() {
|
||||
public void isVisible_showDeviceWithoutNames_visible() {
|
||||
doReturn(false).when(mCachedBluetoothDevice).hasHumanReadableName();
|
||||
BluetoothDevicePreference preference =
|
||||
new BluetoothDevicePreference(mContext, mCachedBluetoothDevice,
|
||||
@@ -176,11 +176,18 @@ public class BluetoothDevicePreferenceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVisible_hideDeviceWithoutNames_invisible() {
|
||||
public void isVisible_hideDeviceWithoutNames_invisible() {
|
||||
doReturn(false).when(mCachedBluetoothDevice).hasHumanReadableName();
|
||||
BluetoothDevicePreference preference =
|
||||
new BluetoothDevicePreference(mContext, mCachedBluetoothDevice, false);
|
||||
|
||||
assertThat(preference.isVisible()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setNeedNotifyHierarchyChanged_updateValue() {
|
||||
mPreference.setNeedNotifyHierarchyChanged(true);
|
||||
|
||||
assertThat(mPreference.mNeedNotifyHierarchyChanged).isTrue();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user