When BT is off hide rename preference

* Hide the preference when BT is off, shown preference when BT is on.

Bug: 78247352
Test: make -j40 RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDeviceNamePreferenceControllerTest
Change-Id: Id1e11c7b546d7ac5bc8606e8645d07d77f2b522f
This commit is contained in:
hughchen
2018-05-21 20:46:57 +08:00
committed by Lei Yu
parent cd28a977ca
commit 4e2160904d
4 changed files with 34 additions and 13 deletions

View File

@@ -67,8 +67,9 @@ public class BluetoothDeviceRenamePreferenceController extends
}
@Override
protected void updateDeviceName(final Preference preference) {
protected void updatePreferenceState(final Preference preference) {
preference.setSummary(getSummary());
preference.setVisible(mLocalAdapter != null && mLocalAdapter.isEnabled());
}
@Override