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

@@ -47,6 +47,7 @@ import org.robolectric.annotation.Config;
public class BluetoothDeviceRenamePreferenceControllerTest {
private static final String DEVICE_NAME = "Nightshade";
private static final String PREF_KEY = "bt_rename_devices";
@Mock
private LocalBluetoothAdapter mLocalAdapter;
@@ -66,10 +67,10 @@ public class BluetoothDeviceRenamePreferenceControllerTest {
mContext = spy(RuntimeEnvironment.application);
mPreference = new Preference(mContext);
mPreference.setKey(BluetoothDeviceRenamePreferenceController.PREF_KEY);
mPreference.setKey(PREF_KEY);
mController = new BluetoothDeviceRenamePreferenceController(
mContext, mFragment, mLocalAdapter);
mContext, PREF_KEY, mFragment, mLocalAdapter);
}
@Test