As the caller of adding or removing devices may not be performing on background thread, sync problem could occur. So here we make sure all updates to UI happens on the main thread.
Test: atest: com.android.settings.connecteddevice.PreviouslyConnectedDevicePreferenceControllerTest
Bug: 365044575
Flag: EXEMPT bugfix
Change-Id: I5b697acb7cf7469fe3bbff33b820b4e9f4c5104f
Order the saved bluetooth devices by most recently connected in connected devices settings page.
Test: atest: com.android.settings.connecteddevice.SavedDeviceGroupControllerTest, com.android.settings.connecteddevice.PreviouslyConnectedDevicePreferenceControllerTest
Bug: 306160434
Change-Id: Id5ad8555a026d775d96ada37f989b4346336af93
* BaseHearingDevicePreferenceController will also be used in "Hearing devices", so extract to parent class first.
Bug: 237625815
Test: make RunSettingsRoboTests ROBOTEST_FILTER="(SavedHearingDeviceUpdaterTest|BaseBluetoothDevicePreferenceControllerTest|BluetoothDeviceUpdaterTest|AvailableMediaBluetoothDeviceUpdaterTest|ConnectedBluetoothDeviceUpdaterTest|SavedBluetoothDeviceUpdaterTest)"
Change-Id: I8a492866f48e3a664b9ff78bce5a4f082c0dc465
Android T allows apps to declare a runtime receiver as not exported
by invoking registerReceiver with a new RECEIVER_NOT_EXPORTED flag;
receivers registered with this flag will only receive broadcasts from
the platform and the app itself. However to ensure developers can
properly protect their receivers, all apps targeting T or later
registering a receiver for non-system broadcasts must specify either
the exported or not exported flag when invoking #registerReceiver;
if one of these flags is not provided, the platform will throw a
SecurityException. This commit updates all the exposed receivers
with a new RECEIVER_EXPORTED_UNAUDITED flag to maintain the existing
behavior of exporting the receiver while also flagging the receiver
for audit before the T release.
Bug: 161145287
Test: Build
Change-Id: Ie97372efebd8258d9a4c503771d55109a85e6ae9
Completed the UI in displayPreference() to fix jank issue.
Bug: 188752628
Test: make RunSettingsRoboTests
Change-Id: Ib97b76e1b8622424ad481597f63d3540fb0bfc5b
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
If disconnected bluetooth devices didn't exist in
recent devices, the index will return -1. Our condition
didn't check this situation, the IndexOutOfBoundsException
will throw when this case happens.
This CL adds the condition to check whether index is over
than or equal 0 to fix IndexOutOfBoundsException.
Bug: 173059077
Test: make -j42 RunSettingsRoboTests
Change-Id: Id93f4cb6bded83540045c5e8c21c6f6122a39fed
- This CL before, "Previously connected device" didn't
handle dock device. If user have disconnected dock
device will cause Settings crash.
This CL add condition to handle dock device to avoid crash.
- Update test case.
Bug: 167054620
Test: make -j42 RunSettingsRoboTests
Change-Id: I769cee3f589e14a993b00a0ae6ec3ddfba8ef281
- This CL before, previously connected devices will show most
recently connected devices and the maximum is 3.
In this time, if next most recently connected device is disconnected.
It's will not show on "previously connected devices", user needs go to
"see all" page to found that device.
This CL add rule to compare the priority of most recently connected
device. If priority of next disconnected device is higher than
currnect devices that on "previously connected devices".
Let next disconnected device show on "previously connected devices".
- Update test case.
Bug: 157653997
Test: make -j42 RunSettingsRoboTests
Change-Id: I684501a20a67755b2196ba9d4b5565add01a5d01
- This CL before, Bluetooth settings will hide the "see all"
option when bluetooth is off. For the UX improvement, this
CL will show the "see all" button when bluetooth is off. And
turn on the BT when user press "see all" button to let user to
quick pair their disconnected devices.
- Update and add test case
Bug: 147150367
Test: make -j42 RunSettingsRoboTests
Change-Id: I7a1451a36a31253b6be2203341bea4e59fed7c2b
- 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
1. Show up to 3 devices in main page
2. Add "See all" preference to go ot detail page
Bug: 116350449
Test: Screenshot && RunSettingsRoboTests
Change-Id: Iee0de8a2b7f2543e946a117ba2d9ca9dde6c8678
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
Doesn't set the preference context for savedDockUpdater.
We will throw IllegalStateException now.
Change-Id: I684cd2a917ce94e033be578349c3cc1d8650ccea
Fix: 110609074
Test: m -j SettingsRoboTests RunSettingsRoboTests
Count the dock devices in previously connected device controller.
Change-Id: I08d82ec715698ecf894a4a7cd0631c5f1de0f591
Fix: 80227045
Test: m -j SettingsRoboTests RunSettingsRoboTests
* For fix the TreeHugger error in pi-dev, cherry pick the ag/3935357 in
master and fix TreeHugger error.
* Add PreviouslyConnectedDevicePreferenceController to handle the preference should be
enable or disable.
Example: If there are no previously connected devices disable the preference otherwise
enable it.
* Add PreviouslyConnectedDevicePreferenceControllerTest
1. Verify the callback can be registered and unregistered
2. Verify the preference is enable when there
have more than 1 previously connected device
3. Verify the preference is disable when there
have no previously connected device
Bug: 78250052
Test: make -j50 RunSettingsRoboTests
Change-Id: I31b5d416aaf907c3bbf1cb61de6e7401463e3df7