Commit Graph

22 Commits

Author SHA1 Message Date
Matthew Xie
b17031bed0 Do not remove bonded devices from cached device list upon a device scan
Bug: 17405122

Change-Id: I3f5cc6ddc8f85d3b6223f9ff60e1d5eeb76c530a
2014-09-09 15:12:43 -07:00
PauloftheWest
f42a0a27e3 Refreshing Bluetooth devices will clear all available devices.
Bug: 16851309
Change-Id: I9ffb1ddaeb8e785be145ea79467fc361a022d8d7
2014-08-12 07:35:11 -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
Ravi Nagarajan
2582e6ca94 On bluetooth disable, delete all devices that are not bonded
Change-Id: If66d54eb4d953c4cc78a22a8b3e89e42bc16f5f4
2012-07-16 15:38:38 -07:00
Kausik Sinnaswamy
737a30f593 Clear the Available (unbonded devices) from the CachedDevices List
during BT disable.

Change-Id: I576237a4165759fe952690f19fde59ce78cd1d29
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
Jake Hamby
79be0b3e6b Fix multiple BT settings bugs.
- Change Bluetooth profiles screen to match ICS wireframes
- Remove BluetoothProfilePreference.java (no longer used)
- Remove "Pair with this device" summary below every unpaired device
- Remove "Paired but not connected" summary below unconnected paired devices
- Fix auto connection after pairing (reuse existing CachedBluetoothDevice)
- Add "Connected (no phone/media)" summaries based on ICS wireframes
- Fix visibility timeout strings.
- Fix crash when starting Bluetooth from Settings shortcut widget.

Bug: 5064139
Bug: 5064324
Bug: 5080404
Bug: 5093513
Bug: 5104485
Change-Id: Ie87103e183ce414c86cb1831a38ef0178b1b1292
2011-08-03 17:55:27 -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
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
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
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
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
Adam Powell
54f334489c Fix bug 2564450 - prevent deadlock in BT settings
Change-Id: Iea5d341d771d18e5d9bf7c6686995ba6cbbf2172
2010-04-06 13:32:35 -07:00
Jaikumar Ganesh
b172cd5d23 Fix desk dock getting stuck after unpairing.
Note: This is a workaround. The read problem is that
we are making a call to Bluez when it is not ready yet.
The interface has not been registered, so dbus call should fail.
We need to fix this properly.

Dr No: Eastham
Bug: 2317784
2009-12-10 02:02:47 -08:00
Jaikumar Ganesh
c065348eba Show an error message when the remote side cancels the authentication
and show OPP device list correctly.

Dr No: Eastham
Bug: 2174874
2009-10-08 08:06:27 -07:00
Jaikumar Ganesh
fca3c1cf8b Check if a device is added to the cache before returning.
For incoming connections, we don't have the device in the Settings cache.
After we tried to readPairedDevices, check if we added to the cache.
If we successfully added it, continue with the connections, else bail out.

Bug id: 2160617

Change-Id: I25f2afba8ef6d2c32a7940f967cf12f1321ad9e0
2009-10-01 13:05:22 -07:00
Michael Chan
eaf13a2c15 b/2154576 Fixed the problem were some BT profiles were not connected when first UUID notification of many didn't have all the UUIDs
Reset connect timer event if profile was non-empty.
Clear profiles after unpair
mConnectAttemptedWithoutUuid

Change-Id: I5eab1270a755c6c87eb5be13a2f43dbbcd9a2f88
2009-09-30 12:34:32 -07:00
Michael Chan
2aef1f3c81 b/2126036 Improve remote device capability identification by switching to use UUIDs instead of class bits.
Change-Id: Ie60d1c579e40027c2174215c1989887a3250c9bc
2009-09-22 15:37:14 -07:00
Jaikumar Ganesh
3eb43fe7a4 Show name for incoming pairing requests.
Settings apps invalidates its cache whenever a new scan is started.
When there is a new incoming pairing request, we will not get a DeviceFound
signal, because its not due to a inquiry scan. Thus when the pairing request
is displayed, the settings app doesn't have it in cache and hence will
just display the address. Make it query the framework when it doesn't have the name.
2009-09-15 14:07:22 -07:00
Jaikumar Ganesh
5f23cb39a1 Modify settings for 2.1
Add incoming pairing dialog
Add DisplayPasskey handling of pairing keyboards with 2.1 devices.
Modify code path to show errors when bonding request fails.
Misc fixes like string changes.
2009-09-11 12:00:14 -07:00
Nick Pelly
16cc86315d Update application for Bluetooth API changes.
Change-Id: I8351611f0f0c5eda3e423dbe7e7b53e52d75ac36
2009-09-10 18:44:25 -07:00
Nick Pelly
d63c011225 Bluetooth: Update Settings.apk to match BT API change.
Split BluetoothDevice into BluetoothDevice and BluetoothAdapter.

BluetoothAdapter: Represents the local BT adapter. Operations on the local
                  adapter (start a scan, etc).
BluetoothDevice: Represents a remote BT device. Operations on remote devices
                 (pair, connect, etc).
2009-08-17 17:09:44 -07:00