remember how many time the user choose the "no",
if user choose "no" twice, we will make it persist.
bug:11176511
Change-Id: I7234e7b4ba4586065dea462029e2da5ddaf53316
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
- 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 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
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
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
* 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
- 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
Bug: 3148095
Also fix an NPE crash I saw when exiting Settings immediately after toggling
the airplane mode.
Change-Id: I83eb2d90e203fd56b09269cf9fa8f74a4354834f
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
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
- 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
Merge commit '0d5e320cdd9cbd76012c0a1aec157e358d05891e'
* commit '0d5e320cdd9cbd76012c0a1aec157e358d05891e':
Call disconnect / connect without checking the current status
Merge commit 'bdf1310707e436db484113d7aa2881c966cddd0f' into gingerbread-plus-aosp
* commit 'bdf1310707e436db484113d7aa2881c966cddd0f':
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
Merge commit 'd7f7213af27fa6c5e476bb8a8d2951feb5e630b5'
* commit 'd7f7213af27fa6c5e476bb8a8d2951feb5e630b5':
Fix bug where car dock sometimes doesn't connect.
Merge commit '4c0ff2c7b5138c0fce6c83f6c414204e32ac96f3' into gingerbread-plus-aosp
* commit '4c0ff2c7b5138c0fce6c83f6c414204e32ac96f3':
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
Merge commit '68c6188b91ca4034caeff7527487513c8cb012f8'
* commit '68c6188b91ca4034caeff7527487513c8cb012f8':
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.
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
Merge commit '356745ecc63419a2569345186e8612a5b0ced28d'
* commit '356745ecc63419a2569345186e8612a5b0ced28d':
Don't disconnect the same device before connecting.
Merge commit '213d579f98a83145989f11cfdbd47631b64de000' into gingerbread-plus-aosp
* commit '213d579f98a83145989f11cfdbd47631b64de000':
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