+ Bluetooth Settings properly stores the MAP state as a shared
preference.
+ A Bluetooth's Settings profile will display MAP even if it was
previously denied.
Bug: 17391677
Change-Id: I94dd7d1a75cc4fe09647c85d84d9e3651a07a673
- 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
When BluetoothSettings is entered via QuickSettings while an A2DP
device is connected, we aren't showing the device connection
status in the UI, because the device list is created before we've
connected to the A2DP and Headset profile services, and we weren't
refreshing the device list UI after getting the callback for
onServiceConnected() and retrieving the list of connected devices.
Add a line to HeadsetServiceListener.onServiceConnected() to call
device.refresh() after we call device.onProfileStateChanged() to
refresh the device list UI. Also copy the logic into A2dpProfile's
onServiceConnected() callback so it will refresh the UI for any
connected A2DP devices.
The reason this bug doesn't show up when entering BT settings
from the main Settings screen is because the onServiceConnected()
callbacks happen before the device list is initialized, so the
UI items are created with the correct connection status. For the
same reason, the bug doesn't occur if the Settings app is already
running and we re-enter it via Bluetooth QuickSettings.
Bug: 8724247
Change-Id: I1a993636ecab18dd6e980e3b4d2485bbed256d74
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
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
- 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
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
The getDrawableResource() method for OppProfileManager was returning
the resource ID for the A2DP icon. This was causing an extra headset
icon to be drawn for devices supporting OPP, when no icon should be
shown for this profile. Changed to return 0.
Bug: 3368197
Change-Id: Idcadaf59fe53301544cda215ca24f15608b2d727
Sometimes when the settings app is resumed, HeadsetProfileManager's
getConnectedDevices() method is called before the onServiceConnected()
callback gives us the proxy object, causing an NPE. Check that we
have the proxy object, and return an empty list otherwise. The
correct states will be shown in the UI because the
onServiceConnected() callback makes its own call to getConnectedDevices()
to set the correct headset profile state.
Bug: 3378431
Change-Id: I364ade0804fb2090378438c8721afef6cac2b0b8
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
- 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
- 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
Allow individual Bluetooth profiles to be connected/disconnected from
the device's settings pane.
Bug: 3137982
Change-Id: I21512c5bf965fc523f3dc1e83d029b16b5e22440
The fix was to wait for the Bluetooth Headset service to come up before grabbing the settings and connecting.
Change-Id: I57affca2fe7d571c96cfeaf9ffe5439a0b02af45
1. PRIORITY_OFF is when it is unchecked.
2. PRIORITY_ON is when it is checked.
3. PRIORITY_AUTO_CONNECT is when we want to auto connect.
When the box is checked, we want to auto connect,
so set the priority to AUTO_CONNECT.
When the user disconnects, we set the priority back
to PRIORITY_ON.
Change priority for Headset profile on the same lines as A2DP profile.
AUTO_CONNECT => we auto_connect.
ON => Settings app box is checked and we allow incoming connections.
OFF => Settings app check box is unchecked.
Dr no: Eastham
Bug: 2133530
The settings app has been updated to use UUIDs.
When there is a filter type set for device picket UI, use the
UUIDs first and then the class bits.
Change-Id: Ifde5dbc3a1cf25babce4c686002315aa3933de59
Add Bluetooth device picker in Settings
- add resource to support device picker
- show different UI accroding to start Intent
- add OPP profile manager
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).
Always add the bt profile to profile list on the arrive of a connect event. Previously,
the connect event is ignored if it is a profile that's not known ahead of time.