Add device name preference in pairing page

Also refactor the preference controller
1. Extend from BasePreferenceController.
2. pass in the preference key. Then it could be reused in different
places with different key.

Bug: 69333961
Test: Screenshot | RunSettingsRoboTests
Change-Id: I773ca022baa326481045c1659565c9a21111200a
This commit is contained in:
jackqdyulei
2017-12-08 12:55:26 -08:00
parent ae1011ee5d
commit be555e2dad
6 changed files with 50 additions and 25 deletions

View File

@@ -73,6 +73,7 @@ public class BluetoothSettings extends DeviceListPreferenceFragment implements I
static final String KEY_PAIRED_DEVICES = "paired_devices";
@VisibleForTesting
static final String KEY_FOOTER_PREF = "footer_preference";
private static final String KEY_RENAME_DEVICES = "bt_rename_device";
@VisibleForTesting
PreferenceGroup mPairedDevicesCategory;
@@ -369,7 +370,9 @@ public class BluetoothSettings extends DeviceListPreferenceFragment implements I
controllers.add(mDeviceNamePrefController);
controllers.add(mPairingPrefController);
controllers.add(new BluetoothFilesPreferenceController(context));
controllers.add(new BluetoothDeviceRenamePreferenceController(context, this, lifecycle));
controllers.add(
new BluetoothDeviceRenamePreferenceController(context, KEY_RENAME_DEVICES, this,
lifecycle));
return controllers;
}