Commit Graph

17 Commits

Author SHA1 Message Date
SongFerngWang
51cabc5553 Add the way for hiding the "contact sharing" on the pairing dialog
There is the way to hide the "contact sharing" at the "device details"
page, but it did not be implemented on the pairing dialog. Add this way
on pairing dialog.

Bug: 246668278
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothPairingControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothPairingDialogTest

Change-Id: I472acb80e70fe5d2a59cb9eed95fcbccfa417fa5
2022-09-27 16:06:49 +08:00
Himanshu Rawat
dc7aa0e87f Don't cancel passkey entry pairing autonomously
Bluetooth pairing is cancelled if the pairing popup is closed without
explicitly accepting the pairing. However there is no way to
explicitly accept the pairing when the local device displays for the
passkey entry or pin key entry pairing method.
As a result all passkey entry and pin key entry pairings, where the
local device is displaying the value, are cancelled after the pairing
is successful. If the BT stack has not completed the SDP search when
the pairing is cancelled after successful pairing, it may result in
removal of the bond information.

Bug: 237757124
Test: Pair with BT HID keyboard; adb logcat | grep "BTPairingController:
Pairing dialog canceled"

Change-Id: Ifdb98c16084dd811eed68469e7df5d1913c6ace8
(cherry picked from commit aa1950fd80)
Merged-In: Ifdb98c16084dd811eed68469e7df5d1913c6ace8
2022-07-26 03:15:36 +00:00
Qasim Javed
29b7f1d5fa Only cancel bonding if pair button is not pressed
aosp/2093046 cancels bonding unconditionally in onDestroy(), this
results in the user not being able to pair when the pair button is
pressed because onDestroy() is also called in that case.

Only cancel bonding if the user did not press the pair button.

Bug: 231554812
Test: Changed settings app is able to scan after dismissing the dialog
and is also able to pair when the pair button is pressed

Change-Id: I868af9b795f1bb0766656e4619bd06dc8028008a
Merged-In: I868af9b795f1bb0766656e4619bd06dc8028008a
2022-05-10 12:03:33 -07:00
Qasim Javed
78765b0b26 Cancel bonding upon back gesture.
When pairing dialog is dismissed using the back gesture, we do not call
cancelBondProcess() for the remote device. Since bonding is not
cancelled and the dialog is dismissed, when the user tries to pair again
and scans for devices, nothing shows up. This is because in case of a
pending bond or pending SDP, the request to search for new devices is
queued.

The correct behavior is to cancel bonding if the pairing dialog is
dismissed using the back gesture. This is similar to what
happens when the pairing dialog is dismissed using the cancel button.

Bug: 231554812
Test: Changed settings app is able to scan after dismissing the dialog

Change-Id: Ia790e345be811be1b60762ff819544d03c5a18fd
Merged-In: Ia790e345be811be1b60762ff819544d03c5a18fd
2022-05-09 13:55:52 -07:00
Alice Kuo
02cadb9b32 Add the pairing string for CSIP supported device
Show the pairing dialog with the hint message
that pairing this device will pair all of the
set member of a coordinated set. If the device
supports CSIP, the message will be shown.

Screenshot: https://screenshot.googleplex.com/8WcrdgBoLRgJjHs

Bug: 178981521
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BlueotohPairingDialog
Change-Id: I5432b7264652dd4485e2669f6004caa4f7459238
2021-09-18 01:15:51 +08:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -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
tmfang
41ab6b4bf8 Migrate all AlertDialogs to AndroidX version
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.
2018-07-20 11:32:13 +08:00
Fan Zhang
176ccd0c35 Clean up: fix incorrect @VisibleForTesting imports
Test: rebuild and robotests
Change-Id: I33d7ee1c0622c01f592920baaf01d44ad19d9a13
2018-07-13 13:08:53 -07:00
Hemant Gupta
a84a535729 Merge "Bluetooth: Give PBAP permission only if device is AUDIO_VIDEO_HANDSFREE"
am: b21a10b2ff

Change-Id: Id0378b1c410afcc0566652e3308cd812dcd68470
2017-11-30 17:40:31 +00:00
Hemant Gupta
5b84cfae44 Bluetooth: Give PBAP permission only if device is AUDIO_VIDEO_HANDSFREE
Step by step:
1. Pair and connect with BTHS (e.g. SBH50).
2. Click the settings icon of paired device, and check "Use for" items.
-----------------------------------------------------------------
Expected Result:
After step 2, "Contact sharing" should not be checked.

Actual Result:
After step 2, "Contact sharing" is checked.

Fix:
Set phone book permission as REJECTED if class of Device is
not AUDIO_VIDEO_HANDSFREE

Test: Checked above usecase and issue is not observed

Bug: 64372703
Change-Id: I178a09dd9e76d67c461c4b04d9b2ee0078ed24c9
2017-11-29 20:37:05 +00:00
Antony Sargent
563c4a6557 Fix rotation bug in Bluetooth pairing PIN dialog
BluetoothPairingDialogFragment has code that makes the OK button on the
dialog disabled until the user has entered at least one character into
the PIN field. However it didn't properly handle the case where the user
had entered some text and then rotated the screen - because it always
marked the OK button as disabled during onShow even if it already had
some content. This CL fixes that by looking at the text content and only
disabling the OK button if the content is empty.

Bug: 36514895
Test: make RunSettingsRoboTests
Change-Id: I4e8e70089a862e67b20ff614bbaa64fc2b641fd4
2017-08-16 15:19:47 -07:00
Antony Sargent
4d7df06eb4 Make sure PIN edit control is focused
When doing Bluetooth pairing and the dialog reqesting a PIN comes up, we
want the PIN field to be focused and the keyboard to be shown. This fixes
a regression from N.

Bug: 62857671
Test: make RunSettingsRoboTests
Change-Id: I00dabfda737b6ac61b50518e11f21e5f9a5a1be1
2017-07-12 17:34:36 -07:00
Jack He
2a67cf0465 Bluetooth: Dismiss pairing dialog on user click
* Existing pairing dialog should be dismissed when user clicks on Yes/No
* In a pairing session with multiple pairing dialogs, this is necessary
  as otherwise the second pairing dialog will not be shown
* Modified unit test to test this behavior
* Launch pairing dialog as UserHandle.CURRENT to avoid Context warnings

Bug: 35833536
Test: make, unit test, pair with Bluetooth devices
Change-Id: I1823b78d287134505f59eab7caca2329ecc3a36f
2017-04-25 14:13:26 -07:00
Tamas Berghammer
265d3c2a0c Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:17 +00:00
Salvador Martinez
f492c28cc1 Robotests for BluetoothPairingDialog
Created some tests to protect some basic bluetooth
pairing dialogs features from regressing. Most of the
tests in this CL ensure that the view is properly
created and that it is properly updating the
associated controller when a relevant action occurs.

Test: make RunSettingsRoboTests
Bug: 32180625
Change-Id: I2f4103a39ffced52353712f952e8ff3d26590169
2016-10-25 17:18:53 -07:00
Salvador Martinez
d98d0837d8 Refactoring for bluetooth dialogs
Dialogs displayed when attempting to connect
to a bluetooth device have been refactored so
that they use a proper dialog fragment. Hardware
dependencies have also been refactored into a
controller class to make it possible to test
these dialogs as well as the controller
independently of one another.

Test: RoboTests
Bug: 32180625
Change-Id: I5447f8299bc13e139052635fc63546cbfc997f33
2016-10-18 11:13:44 -07:00