Commit Graph

29 Commits

Author SHA1 Message Date
Jason Monk
f2982a9ba1 Move isolatable bluetooth code to SettingsLib
Move the non-ui bluetooth control/tracking code to SettingsLib so
that it can be shared with others.

Mostly just move classes to frameworks/base/packages/SettingsLib,
however a few things had to move around.
 - Dock handling had to move back to code still in settings
 - Local preference related code had to be moved back to settings
 - Added an error flow from SettingsLib to Settings

Depends on I69fd888362c6dbb325f6113b32c4b15cc6a23a41
Bug: 19180466
Change-Id: Ie57fe26a27bbb0adc2ef69e042a05c7290c6a52a
2015-02-05 10:43:57 -05:00
Eric Laurent
9f4afb0762 fix dock audio enable dialog
The dock audio enable setting is not saved if the user
dismisses the dialog without checking or unchecking the check box.
The dialog is then displayed each time the device is docked until the
user checks/unchecks the dialog or goes to sound settings to enable
or disable dock audio.

Bug 7518165.

Change-Id: Ifbc6179e78b64b5b7577ac750acf9846525e47c5
2012-11-12 14:29:17 -08:00
Eric Laurent
f892bc856c display audio dialog when connecting low end dock
Display a dialog to enable the use of the dock audio connection
when a low end dock is connected for the first time.

Modify DockService to process docked and undocked messages even if
the device indicated is null (meaning the dock is not a bluetooth dock)
only for low end docks.

Bug 7302106.

Change-Id: I331d83a74fecf5f26b24bfc178342df414bd8153
2012-10-30 10:41:46 -07:00
Jeff Brown
b8dd637887 Handle EXTRA_DOCK_STATE_LE_DESK and HE_DESK.
Bug: 5569662

Change-Id: Ib2a96a27239228123ed53bd0c03ca412bb4357ba
2011-11-08 14:32:29 -08: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
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
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
Jaikumar Ganesh
cf7ef7cbd6 am 7805fa99: am 022299df: Merge "Disconnect dock only if its connected." into gingerbread
Merge commit '7805fa99ffce21bb9b016ffdd5375d331b9a8a54'

* commit '7805fa99ffce21bb9b016ffdd5375d331b9a8a54':
  Disconnect dock only if its connected.
2010-10-16 08:52:36 -07:00
Jaikumar Ganesh
9d03e98d22 Disconnect dock only if its connected.
Scenario: BT is off, device is paired with the desk dock.
Media is switched off. So when the user docks, it was trying to
disconnect even when BT was off and hence DBUS was crashing.

Bug: 3097224

Change-Id: I13e1dd4459c47d5ba9a403f2ae1cc8a131f02a08
2010-10-14 15:09:57 -07:00
Jaikumar Ganesh
5809d33296 Update code for public Bluetooth APIs
Change-Id: Iab22e4ae3206f9085b2d53b8b18dc2abd6197226
2010-09-28 17:53:02 -07:00
Brad Fitzpatrick
c5c8dad0af Use new apply() instead of commit().
apply() starts an async disk write and doesn't have a return
value but is otherwise identical in observable effects.

Change-Id: I0f528607319d7eb5136bb11fce0b24d8741ccdf9
2010-09-14 09:26:51 -07:00
Michael Chan
57d5585595 b/2680057 Fixed a bug where bt won't connect when the phone is docked (if Settings wasn't running).
The fix was to wait for the Bluetooth Headset service to come up before grabbing the settings and connecting.

Change-Id: I57affca2fe7d571c96cfeaf9ffe5439a0b02af45
2010-05-27 17:06:50 -07:00
Michael Chan
732c1dad5a b/2498180 b/2568119 Retry if BT dock disconnects unexpectedly
Change-Id: Ic4771e7c305192fee56f5f80c6cabeecf11a99dc
2010-04-06 15:42:04 -07:00
Michael Chan
ae3311e5bd b/2370089 Pop the dock dialog above the keyguard
Change-Id: I958ac22defb057fd1ce98a711e3e92073588b1e8
2010-01-20 15:39:13 -08:00
Michael Chan
c93b82496e b/2332395 Fixed a bug where BT is not disabled if the phone was inserted and removed quickly.
Change-Id: Ifa721afa9c4a9d83a4dd70ed75f5d66ec06a01f6
2010-01-19 22:35:28 -08:00
Michael Chan
3fe86a346c b/2332395 Disable BT when undocked if BT was off to at docking time
unless if 1) the user has manually turned off bt while docked or
2) there's a connect device at the time we are ready to turn off bt

Change-Id: Ic27308688a525120a09a25c9416b3cdc477412ab
2010-01-19 16:15:44 -08:00
Michael Chan
845e740fc6 b/2367861 Auto connect if the user turns on BT while docked.
Change-Id: I855d0448af9c9c665fb8288c83cd13ae9c3d6050
2010-01-14 11:26:18 -08:00
Michael Chan
c5aa68f3f2 b/2367020 Enable bt profiles by default for car dock.
Change-Id: I95b1330ab432d38fb509321d843d04a41185d331
2010-01-12 12:54:51 -08:00
Michael Chan
fb5b54d77a b/2335780 Fixed race conditions which causes BT to not be in the correct state in respect to the dock state. DO NOT MERGE
Change-Id: I02825cbde24ff0215787bb2d4f78cd6e7e1f4033
2010-01-08 18:33:43 -08:00
Michael Chan
d8eec52a37 b/2318290 connect should be called instead of connect(profile) if device is unpaired.
Change-Id: I5d665d1c3149ffc77387f96c3822e80b84c78de1
2009-12-17 14:30:05 -08:00
Michael Chan
29d70e44e4 b/2334482 Disable Music and audio by default for the docks
Change-Id: I1d84cd1dfe54dd3ae4e9183a291cb8f3e0d5da5a
2009-12-17 10:49:14 -08:00
Michael Chan
052ad24219 b/2323277 Fixed race condition where the user clicks on the dialog before dismiss() is processed.
Change-Id: Iae98c45e4c1c5d36f33d6519ee2adba515f6b9aa
2009-12-14 10:42:27 -08:00
Michael Chan
6fd5bc935e b/2296110 Disable debugging/logging code before shipping.
Change-Id: I10036c49e3c3d61d0fa1af74f1f0cd9d03502103
2009-12-09 18:00:48 -08:00
Michael Chan
503c236db5 b/2296110 Car Dock - Stop service when done processing each command. Clean up logs.
Change-Id: I92124d2856e6c825a2b4148473431789a1f5b156
2009-12-09 17:27:56 -08:00
Michael Chan
d617a0781c b/2314560 Prevent PIN dialog from showing up on undocked docks
If unpaired while undocked, device will be removed from the BT device list.
If unpaired while docked, the user can do pair and connect. No PIN dialog will pop up.
If undocked after unpaired, device will be removed from the BT device list.

Change-Id: Id587a517999e08641451f78dec8696a06028cf16
2009-12-09 17:16:46 -08:00
Michael Chan
146385663b b/2296110 Car Dock - Enable BT if not already enabled.
Change-Id: If1798f62c9438e58c342869176437067f941c8cb
2009-12-08 14:18:13 -08:00
Michael Chan
df9504ef58 b/2296110 Dialog for setting up dock audio.
Reimplemented as a Foreground Service just so it can get on top of the Car Dock App.
Added debounce mechanism to not disconnect immediately after getting a undock event.
Each dock now has its own "Remember setting".
Remember Settings is on by default

Change-Id: I80790bdb7c831e2a642365b92433012191aa70c1
2009-12-07 16:57:26 -08:00