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
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
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
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
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
- 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
Allow individual Bluetooth profiles to be connected/disconnected from
the device's settings pane.
Bug: 3137982
Change-Id: I21512c5bf965fc523f3dc1e83d029b16b5e22440
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
apply() starts an async disk write and doesn't have a return
value but is otherwise identical in observable effects.
Change-Id: I0f528607319d7eb5136bb11fce0b24d8741ccdf9
The fix was to wait for the Bluetooth Headset service to come up before grabbing the settings and connecting.
Change-Id: I57affca2fe7d571c96cfeaf9ffe5439a0b02af45
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
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
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