Root Cause: CsipDeviceManager only refreshes UI when switching member device content.
Solution:
* CsipDeviceManager needs to call refresh() on main device when it's new
member device added.
* UI widget Settings/BluetoothDevice also need to monitor it's member device status to refresh UI.
Bug: 344947362
Test: atest BluetoothDevicePreferenceTest
Flag: EXEMPT bugfix
Change-Id: I58f9e2fc209d4e87631784d0538b1647228f4c1a
Rewrite a new hearing device pairing page with update UI for "See more
devices".
Bug: 307473972
Test: atest HearingDevicePairingFragmentTest
Test: flip the flag com.android.settings.flags.new_hearing_device_pairing_page && atest HearingAidPairingDialogFragmentTest AddDevicePreferenceControllerTest
Change-Id: Ic60601905e3d0d7d7c5b1ef9733652118a211f1d
Since the BT is not enabled, the BluetoothAdapter can't register
the device into Metadata List. Then, the BluetoothAdapter throws the
execption while the UI did the unregister.
Bug: 291207069
Test: build pass
Change-Id: I86e0a3369d7371747a249b34f949d59929afb1c7
There is heavy work to do when add device to list in the
DeviceListPreferenceFragment, off load these work from main thread
to solve the issue.
Make devicePreferenceMap a ConcurrentHashMap to avoid potential race
condition.
Also no longer use getCachedPreference(key) since we not put anything
into the cache, the fallback flow is always used.
Also in BluetoothDevicePreference.onPreferenceAttributesChanged(), move
more heavy work to background thread.
Using System.currentTimeMillis() to sort devices could cause flaky
because System.currentTimeMillis() could be same for different device,
use AtomicInteger instead.
Fix: 286628533
Test: Following the step in bug
Change-Id: Ia9750adb6b4c1424d084381e9d7c2ca8e7912391
The bluetooth device preference needs to refresh UI after MetadataChanged
Fix: 282877247
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDevicePreferenceTest
Change-Id: I02cb07a6b255242e4877089ce2f3b7559ce02362
This CL use CachedBluetoothDevice#getDrawableWithDescription()
to get bluetooth device icon.
Bug: 178255374
Test: make RunSettingsRoboTests -j56
Change-Id: I45c273e2dd782029da7a3a2724cbca3762cc2d9c
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
Before this CL, connected devices settings will use ContentResolver
to get advanced device bitmaps on the UI thread. It will have a little
chance to cause ANR.
This CL uses background thread to get a bitmap to fix ANR issue.
Bug: 173283590
Test: Test: make -j42 RunSettingsRoboTests
Change-Id: I987759a775d507003fd4ef54f5376bd24e660b3b
- This CL use new CachedBluetoothDevice callback instance
in construct to avoid unregister wrong callback.
- This CL use flag to make sure preference will register
callback on onAttached() when preference remove callback
on onPrepareForRemoval() or onDetached().
- Update test case
Bug: 168682778
Bug: 157653997
Test: make -j42 RunSettingsRoboTests
Change-Id: I7a0d9f5332153ee80634e191847b84cd7c380b7d
- 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 use Bluetooth api "getMostRecentlyConnectedDevices()" to get
recently connected devices list. Let "previously connected" will list
most recently connected device on the top.
Bug: 130984590
Test: make -j42 RunSettingsRoboTests
Change-Id: I8d425b6da6cb9fe9fd1417937b4cb9a052cd1660
Use CachedBluetoothDevice.connect() instead of
CachedBluetoothDevice.connect(boolean) to connect
Bluetooth device.
Fixes: 141582844
Test: manually
Change-Id: I8c50678bdfd6de89fb8d56122bfa38bdd5ac5c9d
Before this CL, we didn't consider the case of two
preferences timestamp are the same.
If 2 preferences timestamp are the same, the second preference
will first out. it will cause test case will fail some times.
In this CL, if two BluetoothDevicePreference's timestamp are the same,
The first BluetoothDevicePreference is first out.
Bug: 138547532
Test: make -j42 RunSettingsRoboTests
Change-Id: I7366275e8edf615c582481a570ea0c25b8d37a66
Add two type SortType.TYPE_DEFAULT and SortType.TYPE_FIFO in BluetoothDevicePreference.
It needs to decide the sort type when you create the BluetoothDevicePreference.
TYPE_DEFAULT - According to the CacheBluetoothDevice state to sort
TYPE_FIFO - According to the timestamp to sort
Bug: 112546918
Test: make -j42 RunSettingsRoboTests
Change-Id: Icd25d9b76a44d5a105f8daf64e5bc1f9ead8cd92
notifyHierarchyChanged() is used before when we have
connected/disconnect deivce in same list. So only use it in
DevicePickerFragment.java, not other normal fragments.
Also that call will rebuild whole preference list, which is heavy.
Bug: 119479725
Test: Manual
Change-Id: I06cf221588001b38634fec9f02dee8bc1e561ea8
Add new method to get rainbow bt icon and also refactor
AdaptiveHomepageIcon:
1. Rename
2. Add ConstantState
Bug: 126425211
Test: RunSettingsRoboTests
Change-Id: Idb8aaf253d0d9e2ab33d8852f093e6689ebadde4
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
This CL only changed AlertDialog imports.
So, reviewer can review it easily.
Change-Id: I097bc44394195b14287f4f920c570ac8653f356a
Fixes: 111413092
Test: This CL can't pass Robo test.
Make it more unique to speficy related bluetooth, so change class name from Utils to BluetoothUtils.
Bug: 78676509
Test: atest RunSettingsRoboTests
Change-Id: Ic3627ce44627be39fbc010ad5ef630ad3c429836
* For fix the conflicts in pi-dev, cherry pick the ag/3944480 in
master and merge the conflict.
* Remove the gear icon in "currently connected" section.
* Change the tapping event in "currently connected" section.
When tapping device in this section, take user to device detail page.
* Add test to verify when ConnectedBluetoothDeviceUpdater add preference
the shouldHideSecondTarget() is return true.
Bug: 78490845
Test: make -j40 RunSettingsRoboTests
Change-Id: I25f8455def3c38e24dea9af9e9e29ba37c250f67
The BluetoothDevicePreference need to know whether to display with an
invalid name. However pass in the whole fragment is over-killing.
This cl decouple it for several reasons:
1. In P, BluetoothDevicePreference will be used in other fragment.
2. In preference lifecycle from end user side, this flag is constant.
Bug: 69333961
Test: RunSettingsRoboTests
Change-Id: I3dbcd2a4aafa3ead74371534250e5e7c3ee221f7
This cl contains the moving about:
1. Several methods in Bluetooth/Utils.java
2. Bluetooth icon drawables
3. Bluetooth strings
4. Tests
Bug: 65488978
Test: RunSettingslibRoboTests
Change-Id: I682daa3eeb5022beb90a95763c70d19d32d54915
* Add a developer menu option to allow name-less devices to be shown
when a Bluetooth developer needs it, but hide it for non-developer
users.
* Set BluetoothDevicePreference to invisible when CachedBluetoothDevice
does not have a name besides MAC address and the above developer option
is false.
* This affects BluetoothPairingDetail and DevicePickerFragment, but does
not affect BluetoothSettings. BluetoothSettings will show all paired
devices regardless whether an user friendly name exists.
Bug: 34685932
Test: pair Bluetooth device, send file over Bluetooth, unit tests
Change-Id: Idd7ad4b1671dfdcf3204efb50eddb6dae1065aa5
This cl change util method in bluetooth package to return
drawable instead of resId.
If the bt device has battery level, then method return customized
layerDrawable, otherwise return a simple drawable created from
resId.
Bug: 63393322
Test: RunSettingsRoboTests
Change-Id: Ib21822eafda0e8570212ce5cb070478e4f4876a2
Merged-In: Ib21822eafda0e8570212ce5cb070478e4f4876a2
* Use String in connected device summary instead of resource id
* This allows dynamic strings to be built by CachedBluetoothDevice
such as ones involve battery level percentages
Bug: 35874078
Test: make, unit test, test with Bluetooth devices
Change-Id: I583eac73280ca17387b215a4e7095e27de399998
Bug: 35877479
Test: make RunSettingsRoboTests
The existing behavior is to bring up a dialog with Bluetooth device
details with checkboxes for each supported profile. This adds a new page
that serves the same purpose with a switch for each profile and a footer
containing the MAC address.
Whether to use the new page or old dialog is controlled by a flag
accessible via BluetoothFeatureProvider.
Change-Id: I026c363d4cd33932a84017a67cbef51c258bad10
This reverts commit 457c3cbec2.
Revert with fix/test.
The fix is that we removed DevicePickerFragment#initDevicePreference(),
which incorrectly set a useless widget on preference, and removes the
gear icon from preference, preventing bind() call to go through
Change-Id: Ia70cdb51d13cca6035a4e7fe8008d195f7f00c6e
Fix: 36511169
Test: runtest --path tests/app/src/com/android/settings/bluetooth/DevicePickerActivityTest.java
- Add logging when users selects the listed devices to connect or
disconnect, and when connection error is shown
- Update the event for the top level bluetooth master switch toggle to
have its own event.
Change-Id: I58f21256fdd07fad9d733ff987ff38df1148f4f8
Fix: 35065258
Test: make RunSettingsRoboTests
not accessible to TalkBack users.
b/28199679 Changed method to for setting the talk-back
attribute on "device type".
Change-Id: I63820d861ea1075195b98c82004ba95470448a53