Commit Graph

24 Commits

Author SHA1 Message Date
William Escande
cd231dc047 Update log for BluetoothPairingService
ACTION_PAIRING_CANCEL does not contain an EXTRA_BOND_STATE

Test: Log change is no-op
Bug: 253775131
Change-Id: Ida67374e9369991d7e016b38df9c17a8fa5418cc
2022-12-05 15:30:51 -08:00
Xin Li
da7237b2ed Merge "Merge sc-v2-dev-plus-aosp-without-vendor@8084891" into stage-aosp-master 2022-02-14 17:30:11 +00:00
William Escande
6de80163b1 Resolve bluetooth hidden API usages
Bug: 143245666
Test: build
Change-Id: Idadf84873c88155382c48bb9108cf28d88aaef0a
Merged-In: Idadf84873c88155382c48bb9108cf28d88aaef0a
2022-02-11 14:19:38 +01:00
Hugh Chen
13375e5f44 Fix phone shows incorrect pairing code in pairing dialog
Add PendingIntent.FLAG_UPDATE_CURRENT to let peding intent can
be updated the intent extra.

Bug: 204133175
Test: make -j64 RunSettingsRoboTests
Change-Id: I42966432dacc3727d31231d10aa07b782bb1d92e
2021-11-05 09:22:13 +00:00
TreeHugger Robot
bc587c4d1f Merge "Fix bluetooth pairing notification could not be removed" into sc-dev 2021-05-31 02:07:17 +00:00
Hugh Chen
b2af6ce1bd Fix bluetooth pairing notification could not be removed
Remove the notification when deivce is not bonding.

Bug: 189284833
Test: manually test
Change-Id: Iaa7f04175dac2016777b0de287122108b74b34d8
2021-05-27 10:08:24 +08:00
Patty
c491216243 Fix pairing dialog doesn't show the correct pairing key.
When the pairing dialog doesn't show in the foreground at the first time, the pairing key will display incorrectly.
This is caused by the intent doesn't contain the parameter BluetoothDevice.EXTRA_PAIRING_KEY.

Correct the pairing key by passing the pairing key to intent pairingDialogIntent.

Tag: #stability
Bug: 188614067
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothPairingServiceTest
Change-Id: I3c91bf6ea51fa3fb77b4c4a5c17555606160603e
2021-05-26 15:46:00 +08:00
Hugh Chen
3eb374adb4 Fix foreground Service background launch restriction
Remove setForeground() in BluetoothPairingService. Refactor
the behavior to not holding service in the background.

Bug: 184901840
Test: make RunSettingsRoboTests -j56
Change-Id: Iaeb96943971f55dbeb3dba4b06b28abe770ba3c2
2021-05-14 08:53:14 +00:00
Hugh Chen
40d4e47b05 Add the explicitly mutable flag for creating a PendingIntent
- Android S+ to specify explicitly either FLAG_MUTABLE or FLAG_IMMUTABLE
  when creating a PendingIntent.
- Suggest to use the FLAG_IMMUTABLE as default. Change it to
  FLAG_MUTABLE while errors occur.

Fixes: 172207262
Fixes: 172207195
Fixes: 172205385
Fixes: 172204525
Fixes: 172205897
Test: build pass, manual test to paring blutooth device and doing
seamless transfer

Change-Id: Ic37b37bdbe6de6bdbad741985d3a920334240d80
2020-11-04 10:59:34 +08:00
Myles Watson
0d31c37df9 Bluetooth: Add pairing initiator extra
Bug: 150156492
Test: pair two devices, unpair on one device, try to reconnect
Change-Id: I96379d0afe5b624f09e2825dedaef8f9883a924c
2020-06-13 07:04:14 -07:00
Rahul Sabnis
9348f31126 Remove calls to APIs no longer being supported
Bug: 143245666
Test: Manual
Change-Id: Ibec2c9d60ec5c90e9e4f0a03b75c54164f50f42d
2019-12-09 16:08:29 -08:00
Rahul Sabnis
c96469f2bd Refactor usages of getAliasName to use getAlias in Settings
Bug: 142352567
Test: Manual
Change-Id: I40af1b1e0453900fd888317ae46b20ef359db473
2019-10-22 15:34:40 -07:00
Lei Yu
c513381245 Merge "Settings: [BT] Wrong Pairing Popup is shown on new pairing request." am: 11ce64450c
am: 544f60909b

Change-Id: I105d8d47b22b777eee5b549f7c29b1e252895f39
2019-04-05 17:12:54 -07:00
Sumit Deshmukh
b4bbe9488a Settings: [BT] Wrong Pairing Popup is shown on new pairing request.
Usecase:
1. Start advertising from DUT (using BLE Smartertooth app).
2. Scan and connect from central device.
3. Now initiate bond from central and accept pairing request.
   (Consent Pairing Dialog will be shown on DUT)
4. Notification will be received for PASSKEY CONFIRMATION Dialog.
   Do not open notification and let it timeout.
5. Repeat steps 2 and 3. At step 3, Passkey Confirmation pairing
   dialog is show instead of Consent pairing dialog.

Issue:
Wrong Pairing Popup is shown. Passkey Confirmation pairing
dialog is show instead of Consent pairing dialog.

Reproducible Rate: 100%

Root Cause:
PendingIntent created for showing pairing notification are getting
reused as only FLAG_ONE_SHOT is used. This flag is not updating new
extra's in the pending intent.

Fix:
Use flag FLAG_UPDATE_CURRENT in pending Intent.

Test: Tested above mentioned testcase and pairing scenarios.

Bug: 129456113

Change-Id: I46813f355cd796cee1b472774b494c8580b39784
2019-03-28 11:11:38 +00:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Marie Janssen
3cc4522cbc Merge "Bluetooth: Make notifications local-only" am: 348a7085fa
am: 620fe71520

Change-Id: I3df0a009c7fc6184ea1176f6953748c5031d76cd
2017-06-22 15:41:55 +00:00
Marie Janssen
426903d155 Bluetooth: Make notifications local-only
This will prevent them from showing up on external devices where they
would be less than useful.

Test: connect to watch and pair a device
Bug: 34612389
Change-Id: I8b02c20200ce78a73967b8121cf7d5653b68f356
2017-06-19 16:11:33 -07:00
Ajay Panicker
2432051bfd Add Bluetooth Pairing notifications to a channel
Bug: 37531430
Test: Send a pairing request to DUT from remote phone
Change-Id: I2014b0aa3c4797cbf8e601003471372f4920d21d
2017-04-21 16:44:55 -07:00
Marie Janssen
f8aaed9e1f Bluetooth: Make pairing notification cancellable
Add actions to the pairing service notification so the user can dismiss
the pairing request if they want to.

Add some more information to logs when the user takes an action.

Reformat the file to match android style.

Test: pair from a remote device, dismiss using the new actions
Bug: 36036358
Change-Id: Ie110044bd4caf465f454452737000f01e7430925
(cherry picked from commit c79470d089)
2017-04-21 20:19:20 +00:00
Marie Janssen
c79470d089 Bluetooth: Make pairing notification cancellable
Add actions to the pairing service notification so the user can dismiss
the pairing request if they want to.

Add some more information to logs when the user takes an action.

Reformat the file to match android style.

Test: pair from a remote device, dismiss using the new actions
Bug: 36036358
Change-Id: Ie110044bd4caf465f454452737000f01e7430925
2017-04-20 15:22:20 -07:00
Marie Janssen
d76cc0a468 Bluetooth: only unregisterReceiver if we register
We can get to onDestroy() without registering now.

Test: none
Fixes: 36501241
Change-Id: I90da3b350f9951993238d51f9fde86ccb335cafd
(cherry picked from commit af34ed06f1)
2017-04-06 08:45:27 -07:00
Marie Janssen
af34ed06f1 Bluetooth: only unregisterReceiver if we register
We can get to onDestroy() without registering now.

Test: none
Fixes: 36501241
Change-Id: I90da3b350f9951993238d51f9fde86ccb335cafd
2017-03-23 14:41:06 -07:00
Marie Janssen
d06f49189c Bluetooth: stop pairing service correctly
If BluetoothPairingService was stopped and restarted, it would receive
a null intent, and it also would not signal correctly when it needed to
be stopped.

Since restarts can happen, check that we are still bonding when starting.

Also prevent crashes when we might be called with a null intent.

Test: initiate pairing remotely, adb am kill service, notice no crash
Bug: 36130262
Change-Id: I408811935fdb36591826f4481d103cf4799db27e
2017-03-20 12:23:26 -07:00
Marie Janssen
d06d83c531 Bluetooth: service for pairing notification
Use a foreground service to show the notification, separating dialog
creation from the receiver.

Test: pair request from remote device while the screen is off
Bug: 35234069
Change-Id: Ia3be3e8efdacf465e095af5a498ef5eb0fca83cd
2017-02-21 14:43:40 -08:00