Commit Graph

84 Commits

Author SHA1 Message Date
Edward Jee
a539716a94 Do not show phonebook access permission dialog if pairing dialog has already been shown.
Bug: 16964116, 13886947, 16345619

Change-Id: I9cf2622b49c3812771d57432fed030affaa5ba48
2014-09-15 14:33:13 -07:00
PauloftheWest
58938ba0d6 Changed PBAP's default permission from allow to UNKNOWN.
Bug: 16956658
Change-Id: Ib08bb873a22b8f6b3fb25172aa8612a132257d66
2014-08-12 14:50:10 -07:00
PauloftheWest
46c70190d6 Set new PBAP connections to always allow.
Bug: 13886947
Change-Id: I6ec612b803433db90992f5e4d1bac26311d90a84
2014-07-30 11:18:36 -07:00
PauloftheWest
361d870e54 Added ability for user to automatically accept/deny Bluetooth Phonebook Syncs
Bug: 16040292
Change-Id: Ieeaa014052f53787cf7057578e0b2ac048dc6eb1
2014-07-30 08:39:46 -07:00
Zhihai Xu
1b5bd091eb need persist adding bluetooth MAP profile to profile list in case the settings process being killed
bug:11303213
Change-Id: I1f227839931872ba6fdca0b5932a24e0b002ec44
2013-10-19 23:37:35 -07:00
Zhihai Xu
1083b4726b BT keeps on asking me if I want to allow car to do stuff
Persist the "no" count
bug:11176511

Change-Id: I39674334fe8bf09d1f3f2b07c12513a6c46f053b
2013-10-17 17:11:38 -07:00
Zhihai Xu
3fd5e2839f BT keeps on asking me if I want to allow car to do stuff
remember how many time the user choose the "no",
if user choose "no" twice, we will make it persist.
bug:11176511

Change-Id: I7234e7b4ba4586065dea462029e2da5ddaf53316
2013-10-15 11:27:54 -07:00
Zhihai Xu
9998639a65 BT keeps on asking me if I want to allow car to do stuff
We can remember it as a non persist global value when user click no.
This value won't be saved when power down.
We will restore the permission choice
when we are disconnected with the remote device.
So the "no" choice selected by user will only take effect
until we are disconnected with the remote device.

bug:11176511
Change-Id: Ic0c0829587cf7a812b5fa96fbd381921f67c186f
2013-10-11 12:15:19 -07:00
Kim Schulz
5d2595f051 MAP 1.1 Review fixes
- Fixes to the issues found during review.
- added support for BluetoothProfile ProfileService Classes
- Added new MapProfile.java to comply with new structure
- changed ORDINAL to use BluetoothProfile.MAP directly
- Moved construction of MapProfile to LocalBluetoothProfileManager constructor
- Added support for multiple concurent permission activities and/or multiple notifications (i.e. pbap and map permission request right after each other)
- cleanup
- changed settings to use Notification.Builder
- made the notifications for map/pbab more informative
- added handling of back button + "clear all notifications"

Bug:10692365
Change-Id: I9803c9658a96b1a9c1d4734d2fdd22f1421d2827
2013-09-13 15:44:26 -07:00
Matthew Xie
5b5b1e39dd Bluetooth MAP profile - sms and mms support initial check-in
bug:10116530

Change-Id: I3f50e66420e53bf21a1ecba06aed6b8261ff3064
2013-08-09 15:47:10 -07:00
Ganesh Ganapathi Batta
7951b43bd9 Clear profile connnection status of bonded devices when BT is turned off
When BT is turned off in mid of a profile connection, sometimes
profile connection status change message with status= DISCONNECTED
does not reach Settings app which results in stale connection status
for the device when BT is enabled next time. Fixed the issue
By explicitly clearing the connection status for all paired devices
when BT is turning OFF

Change-Id: I5d0c158636f3b62eff9094821abe2ef3a7cab16e
2012-09-04 15:18:25 -07:00
Ganesh Ganapathi Batta
0654b71534 Remove Profile Auto connection specific logic
Remove  profile auto connection specific logic as it is not implemented in
Bluetooth app
Disconnect PBAP server connection  when user initiates device level disconnection

Change-Id: I381ed96f6b57f414bbaccd694f55d2b992e330a4
2012-08-06 23:27:27 -07:00
Syed Ibrahim M
6bce91bb9b Fix for correctly enabling PAN profile in Settings
Update the connected profile list in CachedBluetoothDevice correctly
if a PANU-NAP connection is already existing but the onUuidChanged()
callback doesnt contain the PANU UUID in SDP inquiry. Now, the
DeviceProfileSettings screens displays valid 'Internet connection
sharing' option when connected as a NAP to remote PANU.

Change-Id: I35821233e7776fb13f7fb1eb22af992b497202a9
2012-08-01 23:52:47 -07:00
Ravi Nagarajan
c70f548355 Reset the priority on unbond
Change-Id: I67b68bd70b947177218e0b908b79ebb9de9f45a8
2012-08-01 00:25:24 -07:00
Kausik Sinnaswamy
744ef74d37 On an incoming pairing of a newly paired device, setPreferred of the
profiles needs to be called to enable incoming/outgoing connections

Change-Id: Ic90e4857fb119e31639e4a50db48b084201aadb2
2012-07-16 15:38:38 -07:00
Kausik Sinnaswamy
6e4060212e Fixed a race condition during pairing with carkits wherein connect was
issued even before ACTION.uuid changed was received.

Change-Id: Iafc2c61b92537a219e46e08366fab1ad5f4e97bd
2012-07-16 15:38:38 -07:00
Syed Ibrahim M
f457e613d5 Fix to update the checkbox attribute values after connect() is called; This is to make sure for profiles like HID where re-connection can happen only from the device side, the UI is updated to be in sync with the right priority of the corresponding profiles
Change-Id: I4a17d8bbf584e6e64519fe3508bccd5d167a020d
2012-07-16 15:38:38 -07:00
Swaminatha Balaji
2ac143fff7 Auto connect hf/a2dp
Change-Id: I4cb260a1f794c2e094a0b19bdc1df919c4287232
2012-07-16 15:38:37 -07:00
Harish Paryani
4e1876a40a Disconnect before Unpair 2012-07-16 15:38:37 -07:00
Matthew Xie
b707255a44 Remember user choice for phone book access permission dialog
Change the always-allowed checkbox to be don't-ask-again checkbox to remember
user's decision so that user will not be bothered agian if he/she checks
the don't-ask-again checkbox
bug 5099661

Change-Id: If32ab8e93313bbd33ff040553083f0cf9359b69e
2011-08-18 16:31:30 -07:00
Matthew Xie
2036ebd889 Save changed name from CachedBluetoothDevice to native storage
The change preserves the friendly name change over power cycle.
bug 5081605

Change-Id: I2b2cce5a789c72d52439511c42df369639eb0b4b
2011-07-27 17:35:48 -07:00
Jake Hamby
ca9812a852 Upgrade Bluetooth pairing dialogs for ICS.
* Change Bluetooth pairing dialogs to match ICS wireframes.
* Default to numeric soft keyboard for PIN entry, and add checkbox
  to allow user to switch to alphanumeric keyboard if necessary.
* Move all Bluetooth advanced settings into action bar menu.
* Toggle visibility by touching "My device" entry in devices list.

Change-Id: Ic2377eb4364f41d215181cb1e3933997c9db9106
2011-07-15 15:39:53 -07:00
Jake Hamby
c777ee29c8 Improve Bluetooth tethering UI usability.
- Updated hint text for BT tethering checkbox to
  "[Sharing|not sharing] this [tablet|phone]'s mobile data connection".
- Show correct hint text when user enters tethering screen.
- Show correct status after user enables tethering when Bluetooth is off.
  When BluetoothPan.setBluetoothTethering(true) is called with BT off,
  BluetoothPanProfileHandler will add a broadcast receiver to enable
  tethering after BT turns on. This happens too late to show the correct
  status when TetherSettings gets the adapter state changed event, so set
  a flag (mBluetoothEnableForTether) instead, and call setBluetoothTethering
  ourselves after the state changes to ON. Also, clear the flag if the
  adapter state changes to OFF or ERROR.
- Show correct status when user enables tethering, then disables Bluetooth,
  then returns to the tethering screen. Previously it would show
  Bluetooth tethering enabled, even though adapter state was OFF.
- Show the number of connected devices in tethering preference screen.
- Distinguish between PANU and NAP in device profiles screen, and show
  appropriate text to clarify the direction of tethering.
- Remove profiles from device profiles list when the device removes the UUID
  (e.g. Mac OS X turning NAP on/off) and after a NAP disconnection when the
  remote device only supports PANU.

Bug: 3414575
Change-Id: I2c0830876d5b9bddb293e57c4d3ca74f105911b8
2011-03-09 14:56:56 -08:00
Jaikumar Ganesh
50e0b0cf87 Fix settings app not showing correct profile connection state message.
Bug:3385085
Change-Id: Ie4b7eb6bc9d8c91264cf7f68d7830c110e34496d
2011-03-04 10:27:31 -08:00
Jake Hamby
436b29e68e Refactor Bluetooth settings for readability and performance.
Major refactoring of Bluetooth settings classes.
- Moved all functionality from LocalBluetoothManager into new
  LocalBluetoothAdapter and LocalBluetoothPreferences, and into
  existing classes.
- Refactored functionality from BluetoothEventRedirector into new
  BluetoothEventManager class, deleting the original version. New
  version uses a HashMap from action Strings to implementers of the
  BluetoothEventManager.Handler interface.
- Created new BluetoothDiscoveryReceiver to update shared preferences
  timestamp for Bluetooth discovery start/finish. This is the only event
  handling we need to do when the settings app is not visible, so it has
  its own receiver entry in AndroidManifest.xml. Edits are written using
  QueuedWork.singleThreadExecutor(), which BroadcastReceiver knows about
  and will wait for completion, eliminating the need for PendingResult.
- Miscellaneous cleanups to code style and logic for readability.
- Pulled some large switch statement code blocks into new methods.
- Changed all Bluetooth state references to the new BluetoothProfile
  constants.
- Changed use of deprecated Notification constructor in
  BluetoothPairingRequest to use Notification.Builder.
- Moved Utf8ByteLengthFilter helper function from BluetoothNamePreference
  into its own class, and moved test cases into the same package.
- Moved all LocalBluetoothProfileManager functionality related to
  specific profiles into new top-level classes (A2dpProfile, etc.), all
  implementing the LocalBluetoothProfile interface.
- Moved all UI-related methods from CachedBluetoothDevice into the class
  that uses the method, or into the static Utils class for shared methods.

Change-Id: I6d49b7f4ae0c7d7dcf62551ee40b51ecb5fe4f47
2011-03-01 18:44:36 -08:00
Jaikumar Ganesh
5a3120cab7 Display imaging icon for printer devices.
Change-Id: Iea2a77bb3b79934174f6e39b080ade47bd119773
2011-02-28 11:27:35 -08:00
Amith Yamasani
b98c00e710 Update airplane mode checkbox when toggled from system bar.
Bug: 3148095

Also fix an NPE crash I saw when exiting Settings immediately after toggling
the airplane mode.

Change-Id: I83eb2d90e203fd56b09269cf9fa8f74a4354834f
2011-01-26 09:56:44 -08:00
Jake Hamby
cde015b3d4 Display correct HID icon for pointing and misc. devices
Added placeholder icons and code for non-keyboard HID devices.
ic_bt_pointing_hid.png - pointing device
ic_bt_misc_hid.png     - gamepad, remote control, card reader, etc.

Bug: 3137982
Change-Id: Iac7a53a6fbafa9c6ed794a29aa330da314d580d8
2011-01-19 15:24:39 -08:00
Jake Hamby
a0d39a39c2 Allow multiple simultaneous connections for BT input devices.
Move responsibility for disconnecting devices before connecting a new
profile from CachedBluetoothDevice to LocalBluetoothProfileManager.

The ProfileManager subclasses of LocalBluetoothProfileManager will
handle disconnecting the previously connected device, if necessary,
as part of connect(). The HID profile allows multiple simultaneous
connected devices, while the other supported profiles do not.

Bug: 3333975
Change-Id: Id51b26e64f7c3ee7d54af3a03ca82a669f305b52
2011-01-10 17:02:26 -08:00
Jake Hamby
4bd7cb0e07 Don't auto connect reverse tethering after pairing.
Added boolean param to connect() method in CachedBluetoothDevice
to specify whether to connect PAN profile. This is set to true when
the user clicks on a device in the paired devices list, but false
when auto connecting profiles after pairing and other circumstances.

Bug: 3330207
Change-Id: I6d8d50abb65a8cb24f87ad93c01693923991b6ef
2011-01-06 21:01:30 -08:00
Jake Hamby
39ef225e7c Enable reverse tethering in BT settings screen.
- Enable support for reverse tethering in BT settings.
- Add string resource for "Auto connect" preference.
- Remove unused imports and other minor cleanups.
- Add isConnectable() and isAutoConnectable() methods to Profile
  enum type and remove isConnectableProfile() method.

Change-Id: Ie606db04028a8278e98231f0671a388671f2f067
2010-12-22 14:54:33 -08:00
Jaikumar Ganesh
498d12bac0 Add ability to connect to only headset profile.
Fix some SDP records issues.

Change-Id: I42816527b1ae0749b4b59b7947f1acb9d2e6f001
2010-12-10 17:51:52 -08:00
Jake Hamby
c090feb64f Implement BT settings functionality for new UI.
- Removed context menu logic for long press (no longer used).
- Converted device picker to run in its own Activity, using a dialog
  theme on large screen devices and full-screen on phones.
- Removed unused resources.
- Add device to "Paired devices" list when pairing is initiated by the
  remote device.
- Return to Bluetooth settings pane after successfully pairing a new
  device from the "Find nearby device" pane.
- Add support for renaming devices (TODO: persist the custom name and
  update the "bread crumb" in the action bar to the new device name).
- Add support for incoming file transfer and auto connect checkboxes
  in DeviceProfilesSettings.
- Show available and connected device profiles as icons instead of
  summary text. Available but disconnected profiles are drawn in gray.
- Fixed bluetooth_notif_message to include the device name as a parameter
  instead of appending the name to the end of the localized string.
- Changed some fields from private to package scope for more efficient
  access from inner classes.

Bug: 3137982

Change-Id: Ic2d6ee5be60c9c5b3f3a8a58846d58efedfa5c93
2010-12-09 16:32:41 -08:00
Jaikumar Ganesh
8c04b90cc9 Update supported profiles for voice capability.
Change-Id: If12f97ccc5d7d54d8d3e470dd4bc91fe9119b9cd
2010-11-23 20:33:59 -08:00
Jake Hamby
e79f990490 Implement individual Bluetooth profile connect/disconnect.
Allow individual Bluetooth profiles to be connected/disconnected from
the device's settings pane.

Bug: 3137982
Change-Id: I21512c5bf965fc523f3dc1e83d029b16b5e22440
2010-11-03 13:02:59 -07:00
Amith Yamasani
48e9000283 Bluetooth settings revamp
Added a separate scanning screen.
UI changes to not require long-press options.
Needs TODOs to be filled by BT team.

Bug: 3038327
2010-10-27 16:23:05 -07:00
Jaikumar Ganesh
659b39abf8 Update BT APIs for change in return type.
Change-Id: Ic85b47da50876fd6bdc6e223af4248a8586d82bc
2010-10-22 11:12:48 -07:00
Jaikumar Ganesh
c0a2044b9a am 0d5e320c: am bdf13107: Merge "Call disconnect / connect without checking the current status" into gingerbread
Merge commit '0d5e320cdd9cbd76012c0a1aec157e358d05891e'

* commit '0d5e320cdd9cbd76012c0a1aec157e358d05891e':
  Call disconnect / connect without checking the current status
2010-10-14 19:30:08 -07:00
Jaikumar Ganesh
0d5e320cdd am bdf13107: Merge "Call disconnect / connect without checking the current status" into gingerbread
Merge commit 'bdf1310707e436db484113d7aa2881c966cddd0f' into gingerbread-plus-aosp

* commit 'bdf1310707e436db484113d7aa2881c966cddd0f':
  Call disconnect / connect without checking the current status
2010-10-12 19:06:15 -07:00
Jaikumar Ganesh
d3a460cce7 Call disconnect / connect without checking the current status
Its the job of the framework to check that, it already does that.
Framework will queue the commands. Earlier settings app used to queue
them.

Bug: 3076404

Change-Id: I664e1c4e2c0ef9c697066251ccca382ad12dfa2f
2010-10-12 16:19:40 -07:00
Jake Hamby
4747950d8e am d7f7213a: am 4c0ff2c7: Merge "Fix bug where car dock sometimes doesn\'t connect." into gingerbread
Merge commit 'd7f7213af27fa6c5e476bb8a8d2951feb5e630b5'

* commit 'd7f7213af27fa6c5e476bb8a8d2951feb5e630b5':
  Fix bug where car dock sometimes doesn't connect.
2010-10-12 13:18:21 -07:00
Jake Hamby
d7f7213af2 am 4c0ff2c7: Merge "Fix bug where car dock sometimes doesn\'t connect." into gingerbread
Merge commit '4c0ff2c7b5138c0fce6c83f6c414204e32ac96f3' into gingerbread-plus-aosp

* commit '4c0ff2c7b5138c0fce6c83f6c414204e32ac96f3':
  Fix bug where car dock sometimes doesn't connect.
2010-10-11 13:07:09 -07:00
Jake Hamby
582f1f84bb Fix bug where car dock sometimes doesn't connect.
Attempt to connect to car/desk dock after pairing completes. This
fixes a bug where we didn't try to connect if we received the UUID
change intent before the bonding state change intent.

Change-Id: I7c12a4eb23d17d506e43a64bf2a3aa5241debcb9
2010-09-29 15:38:19 -07:00
Jake Hamby
989408cc70 am 68c6188b: am dd79a33b: Auto-connect Bluetooth device only when user initiates pairing.
Merge commit '68c6188b91ca4034caeff7527487513c8cb012f8'

* commit '68c6188b91ca4034caeff7527487513c8cb012f8':
  Auto-connect Bluetooth device only when user initiates pairing.
2010-09-24 17:19:24 -07:00
Jake Hamby
68c6188b91 am dd79a33b: Auto-connect Bluetooth device only when user initiates pairing.
Merge commit 'dd79a33ba53fec530094f4d2fe37f0538530d9f8' into gingerbread-plus-aosp

* commit 'dd79a33ba53fec530094f4d2fe37f0538530d9f8':
  Auto-connect Bluetooth device only when user initiates pairing.
2010-09-24 17:16:37 -07:00
Jake Hamby
dd79a33ba5 Auto-connect Bluetooth device only when user initiates pairing.
Fix bug 2271901: do not auto-connect to services on a BT device
when pairing was initiated by the device (e.g. for OPP file transfer).

Also corrected some typos and removed an unneeded lock object in
LocalBluetoothManager (synchronize on .class object instead, like
android.bluetooth.BluetoothDevice.getService() does).

Change-Id: I121105c6eee2658129f6094786754bbc7932d324
2010-09-24 14:23:26 -07:00
Jaikumar Ganesh
69b0218849 am 356745ec: am 213d579f: Merge "Don\'t disconnect the same device before connecting." into gingerbread
Merge commit '356745ecc63419a2569345186e8612a5b0ced28d'

* commit '356745ecc63419a2569345186e8612a5b0ced28d':
  Don't disconnect the same device before connecting.
2010-09-16 23:24:15 -07:00
Jaikumar Ganesh
356745ecc6 am 213d579f: Merge "Don\'t disconnect the same device before connecting." into gingerbread
Merge commit '213d579f98a83145989f11cfdbd47631b64de000' into gingerbread-plus-aosp

* commit '213d579f98a83145989f11cfdbd47631b64de000':
  Don't disconnect the same device before connecting.
2010-09-16 22:15:50 -07:00
Jaikumar Ganesh
84905edb63 Don't disconnect the same device before connecting.
We Pair: Remote device sends incoming connection, we get connected.
We get BondingState change and we connect.
Settings app disconnects connected profiles and then connects
without checking whether we are disconnecting the same device itself.

How was it working before ? Settings app used to queue all
commands. The disconnect followed by the connect would work
but unnecessarily disconnect and then connect.
With the queuing moved to framework, the connect fails
since the disconnect status has not been broadcasted.

Settings app shouldn't be disconnecting connected profiles.
That logic should reside in the framework. There is an open bug
and when the new APIs get implemented this will get removed.

Change-Id: I32a7fa36ff3c3321691c55071498f985dcdcfe8e
2010-09-16 18:56:30 -07:00
Danica Chang
32711b6752 bluetooth tethering
Change-Id: I8dfb1c85bb8b963d2937b8bc4a4c9f0cf641785d
2010-08-17 19:07:07 -07:00