Commit Graph

15 Commits

Author SHA1 Message Date
Hugh Chen
bbbae9af8a Fix battery level of earbuds bt devices is inconsistent
Before this CL, bluetooth settings update the battery level of earbuds
when receiving first pair status callback. But sometimes the callback
will not send immediately cause the battery level is inconsistent.

This CL will update the earbuds battery level when onResum() to refresh
battery level immediately.

Bug: 174929347
Bug: 159544311
Test: make -j42 RunSettingsRoboTests
Change-Id: I8505f8fed4ec821b9fa2d88bc437bddd7a30f0e2
2021-03-08 16:38:31 +08:00
hughchen
ef2c1a1526 Fix crash when no Bluetooth feature in Settings
- Move PreferenceGroup init method out of isAvailable() condition,
  then PreferenceGroup will not be null.
- Update getAvailabilityStatus(), since the controller now may have usb
  and dock.

Bug: 110712414
Test: make -j42 RunSettingsRoboTests
Change-Id: I4d85a42c26fb20d319e7321177b271933be3fdb0
2019-04-19 14:09:40 +08:00
Fan Zhang
7db118e367 Mass clean up: don't cast class when not needed.
Bug: none
Test: rebuild
Change-Id: Ie3f58a3d5ae99ade28a33dcac80c18de90d4d5b2
2019-02-14 12:26:09 -08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Ivan Chiang
71ae12a1de Apply the correct theme to DockPreference
Set the preference context to apply correct theme to preference.

Bug: 110016611
Test: m -j SettingsRoboTests RunSettingsRoboTests
Change-Id: Ifb680fdc0ff40f86886f91320b4187e9873efbf4
2018-06-13 11:30:33 +08:00
Matthew Fritze
f87a1f3f41 Establish permanently unavailable settings
Distinguish between settings which are permanently unavailable on
the device, and temporarily unavailable. This enables us to restrict
which setting slices are exposed in onSliceGetDescendants.

The primary changes in this CL are renaming:
"DISABLED_UNSUPPORTED" -> "UNSUPPORTED_ON_DEVICE"
to be more clear the the setting will cannot be accessed on the device, and,
adding a new enum to encapsulate settings which are currently unavailable, but
could be enabled in the future.

Also remove UNAVAILABLE_UNKNOWN. Devs should never need this enum.

Bug: 78910582
Bug: 79245656
Test: robotests
Change-Id: I58821a6cfd6134b3b351657b6edf5f74ead00643
2018-05-09 08:36:59 -07:00
Ivan Chiang
121d53072e Merge changes I3dd31855,Id5a75217 into pi-dev am: 720a224e00
am: e598b1ae03

Change-Id: I715f7dba77f7ba10314ed4114b9eda1019171253
2018-04-26 19:13:07 -07:00
Ivan Chiang
6b76e34768 Show docks on previously connected devices page
Implement previously connected Dock Devices part into
SavedDeviceGroupController.

Bug: 78095209
Test: m -j SettingsRoboTests RunSettingsRoboTests
Change-Id: I3dd318556167c98bc90c0c1c7281804177b9ff74
2018-04-26 16:45:16 +08:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07: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
hughchen
aa31bd43a3 Implement previously connected device UI
* Move save device group to "Previously connected devices"

Bug: 74134939
Test: make -j60 RunSettingsRoboTests
Change-Id: Iff7894033df402d42dcc0ccaea6db3106edb7013
Merged-In: Iff7894033df402d42dcc0ccaea6db3106edb7013
2018-04-12 17:10:40 +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
Weilun Du
d4e1b94b58 Disable bluetooth controller if unsupported
Only disable the controllers not the whole fragment because
user might need to have entry for other features.

Fixes: 73664409
Merged-In: I98ed248cf33d11715dd523e711cbc68ebf128ef8
Change-Id: I98ed248cf33d11715dd523e711cbc68ebf128ef8
Signed-off-by: Weilun Du <wdu@google.com>
(cherry picked from commit 68a195ae93)
2018-03-09 23:40:40 +00: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