Update DialogFragment UI when BT device is add/remove/rename

* For fix the "Automatic merge failed" in pi-dev, cherry pick the ag/3937781 in
  master. Change android.support.* to androidx.*
* Add AudioSwitchCallback() in AudioSwitchPreferenceController.
  This callback is used to notify SoudSettings to update the dialogFragment UI.
* Add UpdatableListPreferenceDialogFragment that updates the available
  options when dialog is shown
* Add test to verify the adapter count when
  onListPreferenceUpdated() is called.

Bug: 77783217
Test: make -j50 RunSettingsRoboTests
Change-Id: I8cac1b30ec50df026f4b7722dd1cd2f69e77a4cb
This commit is contained in:
hughchen
2018-04-23 20:13:14 +08:00
parent 82e7aa8975
commit acb6e89c52
6 changed files with 319 additions and 4 deletions

View File

@@ -94,6 +94,8 @@ public class MediaOutputPreferenceControllerTest {
private A2dpProfile mA2dpProfile;
@Mock
private HearingAidProfile mHearingAidProfile;
@Mock
private AudioSwitchPreferenceController.AudioSwitchCallback mAudioSwitchPreferenceCallback;
private Context mContext;
private PreferenceScreen mScreen;
@@ -157,6 +159,7 @@ public class MediaOutputPreferenceControllerTest {
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
mScreen.addPreference(mPreference);
mController.displayPreference(mScreen);
mController.setCallback(mAudioSwitchPreferenceCallback);
}
@After