Commit Graph

14 Commits

Author SHA1 Message Date
TreeHugger Robot
5a2f73151e Merge "Implement audio switch UI" into pi-dev 2018-04-16 18:34:37 +00:00
hughchen
bd3e5de207 Implement audio switch UI
* Implement available media devices group
* Add AvailableMediaDeviceGroupController to realize UI, the user can see the all device that can be activated in this group.
* ConnectedDeviceGroupController change to show the device that cannot be activated but is connected.
* Refactoring the below class, implement the controller in connected_devices.xml.
  ConnectedDeviceGroupController.java
  SavedDeviceGroupController.java
  ConnectedDeviceDashboardFragment.java
  connected_devices.xml
* Add AvailableMediaBluetoothDeviceUpdaterTest to verify the add/remove preference behavior when connectedStateChanged or profileAudioStateChanged
* Add test that used to verify device is connected or not in BluetoothDeviceUpdaterTest.
* Add test that used to verify the add/remove preference behavior when connectedStateChanged or profileAudioStateChanged in ConnectedBluetoothDeviceUpdaterTest.
* Add AvailableMediaDeviceGroupControllerTest to verify bluetooth feature is supported or not and test register callback.
* Add test that used to verify bluetooth feature is supported or not and test register callback in ConnectedDeviceGroupControllerTest.
* Add test that used to verify bluetooth feature is supported or not and test register callback in SavedDeviceGroupControllerTest

Bug: 74134939
Test: make -j40 RunSettingsRoboTests
Change-Id: I54d03c2ddadc6a4be7519dd74cdbcb5055d44083
2018-04-15 04:22:25 +00:00
Isha Bobra
35e217f91f Show only 1 entry for hearing aid devices without killing the activity.
This CL tries to detect Bluetooth hearing aid devices and tries to
combine the entry of the hearing aids with the same HiSyncIds and
show only 1 entry for each pair in the connected devices list.

This CL also shows 2 battery status in the device details page.

This change shows the combined entry after a user returns to the
settings activity after pressing the back button or somehow
without killing it. It also combines the entries just after pairing.

Test: RunSettingsRoboTests
Bug: 74204427

Change-Id: I47fb0bdd96b1cc972d88a4aef85d0113985d63bb
2018-04-13 22:51:58 +00:00
timhypeng
3775f969ba Rename onProfileAudioStateChanged() to onAudioModeChanged()
Bug: 74134939
Test: Build
Change-Id: I85895238b6ee16fec85d0cf3dd0242c9ba17a3bd
2018-04-10 15:16:37 +08:00
ryanywlin
bca6f79026 Add callback onProfileAudioStateChanged()
Bug: 74134939
Test: Build
Change-Id: I2a7e837703b66e1798679c65afab7dc6572c295e
2018-03-30 06:23:28 +00:00
Lei Yu
687964cf28 Add search index provider for bt page
1. Implement the search index provider for
ConnectedDeviceDashboardFragment.
2. Since in SEARCH_INDEX_DATA_PROVIDER fragment is null,
so we need to pass in context to all components
instead of getting it from fragment.
3. Update test for it as well as creating new shadow.

Change-Id: If0aa67d5b6ca207c6b728c8355581bf414577091
Fixes: 69333961
Test: RunSettingsRoboTests
2018-03-21 10:46:02 -07:00
Hansong Zhang
02acba607a Move the setActiveDevice logic from Settings to SettingsLib (2/2)
Currently the Settings app handles the logic of setting active device;
however, this should be handled by SettingsLib so the logic can be shared.

Bug: 75984255
Test: robolectric test

Change-Id: I5742de1463d156ff29708ea2aecfc3fd00795e9e
2018-03-20 10:43:15 -07:00
Pavlin Radoslavov
c7715a5519 Update the Bluetooth Active Device state in the Device Manager
The Bluetooth Active Device state should be updated for all
CachedBluetoothDevice entries.
This should be done inside CachedBluetoothDeviceManager in SettingsLib
instead of BluetoothDeviceUpdater in the Settings app.

Bug: 72316092
Test: Manual - two headsets and switching the active device
Change-Id: If379bb0853dcd78385430cf14192e9adfae4ecd0
2018-02-23 12:32:23 -08:00
Fan Zhang
7cf99f5f12 Migrate more settings to use SubSettingsLauncher
Bug: 73250851
Test: robotests
Change-Id: I08f6f380489646231d6d8ceb1488e2efb036bf69
2018-02-18 21:10:03 -08:00
Pavlin Radoslavov
4b796e5d2e Add Settings support for Bluetooth Multi-A2DP and Multi-HFP
When there are multiple connected A2DP/HFP devices, if a connected
device's name is clicked on, that device will be chosen as
Active - i.e., it will be the device chosen for audio out / phone call.

Test: Manual: multiple connected A2DP devices, and selecting each as
      the Active Device.
Bug: 64767509

Change-Id: Iee76286110ed87703d6a968f50273c22cd7c7086
2018-01-22 13:10:50 -08:00
jackqdyulei
f2ef447e8e Tweak bluetooth text alignment
1. Remove the placeholder summary so it won't show blank summary
2. Update settings_entity_header to make text center_vertical,
so it could align with the icon.

Bug: 71742145
Test: Screenshot
Change-Id: I185114a4e0c8d996f218075a8633e802fabf3c66
2018-01-17 12:26:21 -08:00
jackqdyulei
6c94769e56 Add summary placeholder for bt preference
Then UI won't be janky(as everything slide down a little bit)

Bug: 63910184
Test: RunSettingsRoboTests
Change-Id: Ie4074694f54af92da52f09d2caaab5490fa73647
2017-12-22 10:25:04 -08:00
jackqdyulei
aec5543841 Add preference group for saved devcies.
Currently it only contains bluetooth devices.

Bug: 3240835
Test: RunSettingsRoboTests
Change-Id: Ief102e7174a4c4610dbda6b728419b303ff928f9
2017-11-27 12:56:44 -08:00
jackqdyulei
88579e2558 Add infrastructure for connected device group.
The core thing is to find out a way to update group when devices
(bt device and usb device)are updated.

The infrastructure contains three parts:
1. ConnectedDeviceController
Normal PreferenceController. Get info from sub controller and update
the preferenceGroup.

2. BluetoothDeviceUpdater
Listen to bluetooth callback, decide whether to add/remove devices

3. DevicePreferenceCallback
Interface to add/remove preference. This interface will be used in
ConntectedDeviceController and future SavedDeviceController

Bug: 69333961
Test: RunsettingsRoboTests
Change-Id: I85a9ef216a801d5f0dd1cf0130d53850a68be4bd
2017-11-21 12:46:30 -08:00