Commit Graph

1509 Commits

Author SHA1 Message Date
Chaohui Wang
8429e8cc79 Merge "Update the OWNERS for bluetooth & connecteddevice" am: 6b2f2ab205 am: 7fdf1c4b17 am: b1231c5f15 am: 6bceb29408 am: c1f06b5e28
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2629910

Change-Id: Ie6831edecd10cceb2cdf3e3d9ac242cdbd462dd6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-19 12:05:27 +00:00
Chaohui Wang
c1f06b5e28 Merge "Update the OWNERS for bluetooth & connecteddevice" am: 6b2f2ab205 am: 7fdf1c4b17 am: b1231c5f15 am: 6bceb29408
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2629910

Change-Id: I95132b6df6fe214a0bae54b9c7be69efa77292b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-19 11:28:16 +00:00
Chaohui Wang
6bceb29408 Merge "Update the OWNERS for bluetooth & connecteddevice" am: 6b2f2ab205 am: 7fdf1c4b17 am: b1231c5f15
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2629910

Change-Id: I936a6e4a4f24a7f8c238662ec09a02f7a3e985e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-19 10:45:36 +00:00
Chaohui Wang
b1231c5f15 Merge "Update the OWNERS for bluetooth & connecteddevice" am: 6b2f2ab205 am: 7fdf1c4b17
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2629910

Change-Id: I9e87eec0995e9dde010a51e3a7ccbaf68839a696
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-19 09:56:38 +00:00
Chaohui Wang
d7147fd952 [LE Broadcast] Fix crash when scan QR code am: c91d017080 am: fd264a7696
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23729065

Change-Id: Ica82921f80d6c5d796974d34d9a0e710e38eddf8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-19 07:44:49 +00:00
Chaohui Wang
85c1dea20a Update the OWNERS for bluetooth & connecteddevice
Bug: N/A
Test: N/A
Change-Id: I72b4b6f47586b2dd13cfcc4a642c817c93e4ded0
2023-06-19 07:35:20 +00:00
Chaohui Wang
c91d017080 [LE Broadcast] Fix crash when scan QR code
Crash happens when rotated screen.

QrCodeScanModeFragment should only have default constructor.

Remove unused params to fix.

To start this page,
adb shell am start \
    -a android.settings.BLUETOOTH_LE_AUDIO_QR_CODE_SCANNER

Fix: 287363885
Test: Manually
Change-Id: I3c4bcfdb8ae6ddf750e16d8e7565cb9d45d11788
2023-06-16 16:10:53 +00:00
Chaohui Wang
bb47f32011 Fix bluetooth settings pairing page stuck
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
2023-06-15 08:43:17 +00:00
SongFerng Wang
afc0ea3952 Merge "When config is changed, update the profile's visibility" into udc-d1-dev am: a210c84eb8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23599970

Change-Id: I4969b792e002832c372f30e0f5e7694463b569cd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-09 03:08:44 +00:00
SongFerngWang
7dc3cf0b32 When config is changed, update the profile's visibility
Bug: 286328464
Test: build pass
Change-Id: I2beef587a71f9fdc1b1e8a97b9b5656dbb52a9f3
2023-06-08 10:40:54 +00:00
TreeHugger Robot
060250ded2 Merge "[Settings] Fix crash when user enter bluetooth page quickly." into udc-dev am: 3e374cc7a7 am: 9b68c3c9c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23601556

Change-Id: Ie63476cbbc3efc7d3d00a7b9bcc0c1772d33e327
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-07 13:44:52 +00:00
TreeHugger Robot
9b68c3c9c1 Merge "[Settings] Fix crash when user enter bluetooth page quickly." into udc-dev am: 3e374cc7a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23601556

Change-Id: I5f9975f49ec0793eabf171c5dba0791683ab0d15
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-07 13:03:22 +00:00
tom hsu
bf7865b27e [Settings] Fix crash when user enter bluetooth page quickly.
- When SliceManager try to pinSlice, process may not have the permssion
   yet, so in Androix lib it use try/catch to avoid Security exception.
   However, if SliceManger quickly unpinSlice after pinSlice, process
   may still not get the permission yet, then due to no security
   exception, it cause the settings crash.

Bug: 283065718
Test: atest passed
Test: Manual test passed
Change-Id: I2293fca73e65dfaa34237abe57e0c6a3fe0f62bb
2023-06-07 09:37:21 +00:00
SongFerng Wang
fb0186c690 Merge "Add the log and moving it into onResume" into udc-d1-dev am: add7deceb2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23579644

Change-Id: I991eb37e42817dba11b4b0404fa5915e6a35ab36
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-07 03:36:07 +00:00
SongFerng Wang
add7deceb2 Merge "Add the log and moving it into onResume" into udc-d1-dev 2023-06-07 02:45:20 +00:00
SongFerng Wang
8b1bfeef73 Merge "ForgetDeviceDialogFragment check whether device is null or not" into udc-d1-dev am: 4929da451c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23578859

Change-Id: Ibff4ceef103e798e1e27ee413009ccac92a79cfe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-07 02:09:50 +00:00
SongFerngWang
ea85e3b2fa Add the log and moving it into onResume
Since user can open two settings app(one is via settings app button and other one is via quick settings) and user can switch them to foreground by the recent page. If user can goto the deviceDetails at Settings_A and then changes the config value at settings_B, then the user goes back Settings_A to check the UI. If config is in the init, the UI can't refresh the UI.
Bug: 285086232
Test: build pass.
Change-Id: I2284940eddcd02c543522b60f951c0d8d25775fd
2023-06-07 01:45:31 +00:00
SongFerngWang
13cd052693 ForgetDeviceDialogFragment check whether device is null or not
Bug: 280687867
Test: build pass
Change-Id: I4134569854165f20f6287406d9ed627b2c15c05b
2023-06-06 09:53:36 +00:00
TreeHugger Robot
aac695129e Merge "Default show LE audio toggle in Device Detail" into udc-d1-dev am: df23aab9bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23486040

Change-Id: I5202aa1f9202a906ef197a0f60209edf73df7ab5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-02 15:56:27 +00:00
Patty Huang
3e980c7c8f Default show LE audio toggle in Device Detail
Bug: 284790607
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothLeAudioDeviceDetailsPreferenceControllerTest
Test: Checks the LE Audio toggle is shown in Device Detail by default
Change-Id: Id301815513e8066941d3e4c44ab2e7b4d5ed011b
2023-06-01 20:36:34 +08:00
SongFerng Wang
40a0d96640 Merge "The BluetoothDevicePreference register the MetadataChanged" into udc-dev am: 71a5715e3e am: 535a91afff
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23405361

Change-Id: I4a30565d621e5e4535da4c7e0ac5dd22bee5da42
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-24 10:56:58 +00:00
SongFerngWang
1872151b4f The BluetoothDevicePreference register the MetadataChanged
The bluetooth device preference needs to refresh UI after MetadataChanged
Fix: 282877247
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDevicePreferenceTest

Change-Id: I02cb07a6b255242e4877089ce2f3b7559ce02362
2023-05-24 04:49:41 +00:00
Lex Huang
b9c0368d7a Fix ActivityNotFoundException
Set intent to preference if intent.resolveActivity is non-null
Set preference selectable to false if no intent set to preference

Fix: 283107867
Test: manual, atest BlockingPrefWithSliceControllerTest
Change-Id: Ib5e8705debb5eb5224d8566215cb65f36613d8f9
2023-05-19 15:57:18 +00:00
Michał Narajowski
a0c24932ee Merge changes from topic "late-bonding" into udc-dev
* changes:
  bt: Show additional message when is late bond
  bt: Add late bonding confirmation mechanism
2023-05-19 07:34:50 +00:00
David Duarte
2920cad66f Merge "Revert "Revert "Remove CSIP/VCP enable/disable from Setting""" into udc-dev 2023-05-18 21:58:59 +00:00
Michał Narajowski
01164fd414 bt: Show additional message when is late bond
Sometimes the cached bluetooth device is not found and we the
BluetoothPairingController does not know if this device is a member of a
set. But if this is a late bond then it is a set member so we still want
to display that additional message.

Bug: 282193044
Test: manual
Tag: #feature
Change-Id: I9e7da093b118a81097dc83460e9b93ce2e477482
2023-05-18 15:50:10 +00:00
Michał Narajowski
63d37a3d78 bt: Add late bonding confirmation mechanism
If a coordinated set member is bonding late the user will be notified and
asked for confirmation on pairing with this device. The dialog box will
display specific message for this case.

Bug: 282193044
Test: manual
Tag: #feature
Change-Id: Ie9d79282dd432a542ea02ef477019be6dfbce997
2023-05-18 10:47:12 +00:00
SongFerngWang
ef7a75c394 To refresh/register/unregister all of the devices with same groupId
Since the LE audio have two or more devices in the same group and
the UI show their status at one preference, the UI need to register
callback for each of the devices, and also refresh the deviceList.

Bug: 278155752
Test: local test to pairing the device and check the battery part
Change-Id: I2fcde92a1f68b8437465b234820f7bad13dfc444
2023-05-18 16:28:52 +08:00
Rahul Sabnis
7840717139 LEA developer option is enabled if the BT LEA flag is enabled
Bug: 281568856
Test: Manual
Change-Id: If59afff53c304e38074d7a9999329dc039d4cffb
2023-05-15 17:53:26 -07:00
Jason Hsu
181cfa3aa5 Merge "Move 'Audio Output' to Accessibility hearing device page" into udc-dev 2023-05-12 14:20:23 +00:00
SongFerng Wang
2821342259 Merge "The UI does not remove the preference" into udc-dev 2023-05-12 13:39:40 +00:00
SongFerngWang
0faf38eadd The UI does not remove the preference
The LE audio structure have two or more devices, it use CSIP to combine
them with the groupId. It breaks the UI structure, since the UI use the
map to save relationship between the bluetoothDevice and preference.
There are two or more devices using the same UI, it causes UI show the
wrong preference when CSIP do switching of device.
Remove the unuse device when UI refreshing.

Bug: 281697186
Test: Build pass
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AvailableMediaDeviceGroupControllerTest
Change-Id: I798cf9edb590c4a25273913d2f2faf0ed4364ba9
2023-05-12 17:18:37 +08:00
jasonwshsu
212470d0a6 Move 'Audio Output' to Accessibility hearing device page
* Extract the common part into HearingAidHelper.
* Remove abstract getHearingDevice(). Change to get the hearing device when needed.
* Move several classes from Bluetooth into Accessibility

Bug: 281783079
Test: make RunSettingsRoboTests ROBOTEST_FILTER="(HearingDeviceAudioRoutingBasePreferenceControllerTest|AccessibilityHearingAidPreferenceControllerTest|HearingAidHelperTest|HearingAidAudioRoutingPreferenceControllerTest|HearingDeviceCallRoutingPreferenceControllerTest)"
Change-Id: I79049107409b7086c6dcc8d48a6323e171ed1535
2023-05-12 13:46:53 +08:00
tom hsu
75b24e421e [Settings] Remove redundant code.
Bug: 280236099
Test: make passed
Change-Id: I34e0632887ac38658761abd7d6a7e9f1e0f84bf1
2023-05-11 21:12:29 +08:00
Treehugger Robot
59fa9de0cf Merge "Fix non-hearing devices show in pair new hearing devices page" into udc-dev 2023-05-11 09:42:23 +00:00
Angela Wang
fb0d23955d Fix non-hearing devices show in pair new hearing devices page
Non-hearing devices are listed in "pair new hearing devices page" if we click the "See more devices" button and go back from "general pair new devices page".

Root cause:
Two types of Bluetooth scanning happen simultaneously and the scanning results of different scanning methods are handled in the same place. Currently the BLE scanning callback “onScanResult()” directly calls “onDeviceAdded()” method to handle the new scanned devices. This method is mainly called when receiving a broadcast of a new device found in Bluetooth classic scanning. The general pair new devices page uses Bluetooth classic scanning and the pair new hearing devices page uses Bluetooth LE scanning. The life cycle ordering when going back from general pair new devices page to pair new hearing devices page will be "pair new hearing devices page".onStart() -> "general pair new devices page".onStop(). It means the classic scanning is not stopped while the BLE scanning starts and this causes the scanning results from classic scanning unexpectedly added to the list which should only show the scanning results from BLE scanning.

Solution:
Separates the handling part of two scanning methods. Leaves "onDeviceAdded" handling Bluetooth classic scanning results only, and handles BLE scanning results in the “onScanResult” callback directly.

Bug: 279374435
Test: checks the result by switching back from "general pair new devices page" to "pair new hearing devices page"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DeviceListPreferenceFragmentTest
Change-Id: Iebdde401ffb3dc0569478730a140a5dd7add115b
2023-05-11 08:28:12 +00:00
SongFerng Wang
c487d5a10c Merge "Update the wording for LE Audio" into udc-dev 2023-05-11 07:11:11 +00:00
SongFerngWang
f4c5c8ef5e Update the wording for LE Audio
Add the summary for LE Audio toggle
Bug: 280000165
Test: build pass

Change-Id: Ic1eee71d6ff70d01e9a37ab0ec06cfaf639fe963
2023-05-11 12:30:59 +08:00
Tom Hsu
5576947555 Merge "[Settings] Avoid NPE if BT device is changed by framework." into udc-dev 2023-05-11 04:30:19 +00:00
tom hsu
0617631408 [Settings] Avoid NPE if BT device is changed by framework.
- Do not register only one BT device for primary to avoid primary
   BT devcie change to another.
 - Register and unregister all BT devices

Bug: 280236099
Test: atest passed
Change-Id: I610144c7f8f649e40d99cf1dc7f50d1f3b80f109
2023-05-11 02:53:19 +08:00
Alice Kuo
560abbcc49 Revert "Revert "Remove CSIP/VCP enable/disable from Setting""
This reverts commit 6edb515a9f.

Reason for revert: we need this change and need to merge together with prebuilt

Bug: 280626194
Change-Id: Id883c6c7c778154038c249f7be8e9fabf52299c3
2023-05-09 08:01:50 +00:00
Treehugger Robot
83cc6a64c6 Merge "Revert "Remove CSIP/VCP enable/disable from Setting"" into udc-dev 2023-05-09 05:33:40 +00:00
Jack He
6edb515a9f Revert "Remove CSIP/VCP enable/disable from Setting"
This reverts commit 345889b5e2.

Reason for revert: Accidental merge, should merge together with prebuilt

Bug: 280626194
Change-Id: I93f66f22b55eb906f8e079de35f2db00b102c788
2023-05-09 02:44:45 +00:00
Jack He
d55e645795 Merge "Remove CSIP/VCP enable/disable from Setting" into udc-dev 2023-05-09 02:43:13 +00:00
Jack He
2605ccbcfa Merge changes from topic "LeAudioBeta" into udc-dev
* changes:
  Hide the LE audio toggle by flag
  Add toggle to show/hide the Per Device Enable LE Audio Toggle in Device details
2023-05-06 00:42:40 +00:00
Alice Kuo
345889b5e2 Remove CSIP/VCP enable/disable from Setting
We moved this part to Bluetooth Framework, so remove these from Setting

Bug: 280626194
Test: NA
Change-Id: Ia84d0d68d8d77fde7479b6d4e49743dfeb821eae
2023-05-06 05:31:34 +08:00
Chaohui Wang
39bf7dd530 Fix dialog leak in RequestPermissionActivity
Dialog still show when activity destroyed will cause leak.

Dismiss dialog when activity onDestroy to fix this issue.

Fix: 279522922
Test: Manually with "Don't keep activities"
Test: Robolectric Test
Change-Id: I445f4b160020823a6f6e2883055218c1224e2c48
2023-05-05 17:30:02 +08:00
SongFerng Wang
197eb39cde Merge "Shows main_battery information for not untethered device" into udc-dev 2023-05-04 05:47:59 +00:00
SongFerngWang
706257c57a Hide the LE audio toggle by flag
Bug: 280021500
Test: build pass.
Change-Id: I3f4a821c50dfb9d2de73919945334b42c59b3309
2023-05-04 03:43:28 +08:00
SongFerngWang
0d36d37590 Shows main_battery information for not untethered device
The metadata have main_battery and device is not untethered device,
then UI show battery by metadata.

Bug: 273907230
Test: atest AdvancedBluetoothDetailsHeaderControllerTest
Change-Id: I73d8a69c81fe234a5c576ca3769c1b079ac0ceb4
2023-05-03 04:23:50 +00:00