Commit Graph

521 Commits

Author SHA1 Message Date
Jake Hamby
3d1fd57e30 Increase size of BT profile icons and decrease alpha for inactive profiles
Increase the size of the Bluetooth profile icons from 20dp to 30dp.
Decrease the alpha for disabled profile icons to 50% of theme default.

Bug: 3400851
Change-Id: Ieb5ecb01ccbd7185d383828e0d9c9f78525ee0c4
2011-01-27 18:33:17 -08:00
Jake Hamby
632a10f470 Fix settings NPE crash on launch.
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
2011-01-26 17:49:20 -08:00
Jake Hamby
1f5be05ee5 Merge "Implement "show received files" preference item." into honeycomb 2011-01-26 13:40:37 -08:00
Jake Hamby
4ee12032a3 Implement "show received files" preference item.
Add handler to send an intent to the Bluetooth OPP app to show the
list of received files to the user.

Bug: 3167219
Change-Id: I59e18559a0c35add7f1be56a5f040dae4dccc7f1
2011-01-26 10:51:32 -08:00
Amith Yamasani
b98c00e710 Update airplane mode checkbox when toggled from system bar.
Bug: 3148095

Also fix an NPE crash I saw when exiting Settings immediately after toggling
the airplane mode.

Change-Id: I83eb2d90e203fd56b09269cf9fa8f74a4354834f
2011-01-26 09:56:44 -08:00
Amith Yamasani
03b58dff82 Use expander assets for bluetooth profile preference.
Also adjust some padding and set correct highlight background.

Bug: 3383060
Change-Id: I5a4abe98c49efd156523085418958b69df6c8d85
2011-01-25 17:20:43 -08:00
Jake Hamby
51cd0d6d29 Remove "Allow incoming file transfers" option from BT settings.
The user preference to allow automatic incoming file transfers for
specific devices isn't implemented yet. Remove the preference from
the settings UI.

Bug: 3385941
Change-Id: Ib8fee9a0d99063a8c05d52a960664364e4812ace
2011-01-25 13:57:30 -08:00
Jake Hamby
cde015b3d4 Display correct HID icon for pointing and misc. devices
Added placeholder icons and code for non-keyboard HID devices.
ic_bt_pointing_hid.png - pointing device
ic_bt_misc_hid.png     - gamepad, remote control, card reader, etc.

Bug: 3137982
Change-Id: Iac7a53a6fbafa9c6ed794a29aa330da314d580d8
2011-01-19 15:24:39 -08:00
Jake Hamby
8140d9c916 Add icons for Bluetooth HID and PAN profiles.
Add icon resources for Bluetooth keyboard/mouse (HID profile)
and reverse tethering (PAN profile).

Bug: 3137982
Change-Id: Id6c4a9f2b4bee2fdf43626592e32070b49e49d73
2011-01-19 12:25:46 -08:00
Jake Hamby
2748fc24cf Close scan screen when pairing and remove device when unpairing.
Close the scan screen after successful pairing, and remove a
device from the list of paired devices after unpairing.

As part of the fix, BluetoothSettings was refactored into a parent
class, DeviceListPreferenceFragment, and three subclasses for each
variant type: BluetoothSettings, BluetoothFindNearby, and
DevicePickerFragment, replacing the checks against mScreenType with
custom logic in the child classes.

Bug: 3325848
Change-Id: If64fddc3ba5b4f1136451491c7d5a1139b696e47
2011-01-12 20:33:27 -08:00
Jake Hamby
55b7d27936 Only show "Allow incoming file transfer" option if device supports OPP
In the Bluetooth profiles settings screen for a device, the "Allow
incoming file transfer" item should only be shown if the device
supports the Object Push Profile.

Bug: 3297633
Change-Id: I4bbe66ef901feef9dd8a3916fb9827120c1fdfc0
2011-01-11 19:27:17 -08:00
Jake Hamby
055c20e576 Merge "Allow multiple simultaneous connections for BT input devices." into honeycomb 2011-01-11 18:44:57 -08:00
Jake Hamby
c6e1b293a7 Don't throw exception on unexpected BT device addition.
Fix for reported bug where settings app crashes while trying to share
a picture. Bug report showed IllegalStateException thrown with message
"Got onDeviceAdded, but cachedDevice already exists." Changed code to
print an error message to the log and ignore the unexpected event,
rather than throwing an uncaught exception that crashes the app.

Bug: 2192884
Change-Id: I016be6a1616b317b2289768d18ae9f069a49445e
2011-01-11 13:27:50 -08:00
Jake Hamby
a0d39a39c2 Allow multiple simultaneous connections for BT input devices.
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
2011-01-10 17:02:26 -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
Jaikumar Ganesh
da23ae88d1 Add new pairing dialog for keyboard pairings.
Change-Id: I672a3d874a7876fca6bd38091444dc9c5fb3a2f1
2011-01-06 13:38:09 -08:00
Jaikumar Ganesh
bf724587be Listen to Input device connection state intents.
Change-Id: I99addef820438c9c34bfccf2877578b06e14a00c
2011-01-04 13:35:53 -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
3f0f998aa7 Remove Bluetooth tethering settings screen.
Remove obsolete Bluetooth tethering settings screen. BT tethering can
be turned on and off, but the connection must be initiated by the
remote device. For reverse tethering, there will be a checkbox for
that profile in the regular Bluetooth device settings screen.

Bug: 3283928
Change-Id: Ic25139f8862b305feb0381e61c24b7783fad2366
2010-12-14 13:40:10 -08:00
Jaikumar Ganesh
498d12bac0 Add ability to connect to only headset profile.
Fix some SDP records issues.

Change-Id: I42816527b1ae0749b4b59b7947f1acb9d2e6f001
2010-12-10 17:51:52 -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
Jaikumar Ganesh
8c04b90cc9 Update supported profiles for voice capability.
Change-Id: If12f97ccc5d7d54d8d3e470dd4bc91fe9119b9cd
2010-11-23 20:33:59 -08:00
Amith Yamasani
43a673053f Use the new Preference:icon attribute and placeholder for showing icons on the left. 2010-11-17 16:37:16 -08:00
Brad Fitzpatrick
66dc706570 Don't stutter animations during Bluetooth broadcasts.
Bug: 3163109
Change-Id: I89ba3da4ee1f0999f3c7113f2f5fdce6fdafebd7
2010-11-08 13:16:02 -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
Amith Yamasani
48e9000283 Bluetooth settings revamp
Added a separate scanning screen.
UI changes to not require long-press options.
Needs TODOs to be filled by BT team.

Bug: 3038327
2010-10-27 16:23:05 -07:00
Jaikumar Ganesh
659b39abf8 Update BT APIs for change in return type.
Change-Id: Ic85b47da50876fd6bdc6e223af4248a8586d82bc
2010-10-22 11:12:48 -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
c0a2044b9a am 0d5e320c: am bdf13107: Merge "Call disconnect / connect without checking the current status" into gingerbread
Merge commit '0d5e320cdd9cbd76012c0a1aec157e358d05891e'

* commit '0d5e320cdd9cbd76012c0a1aec157e358d05891e':
  Call disconnect / connect without checking the current status
2010-10-14 19:30:08 -07:00
Jaikumar Ganesh
7805fa99ff am 022299df: Merge "Disconnect dock only if its connected." into gingerbread
Merge commit '022299dfce6a705a8cbaff972a4309da6e90a8c2' into gingerbread-plus-aosp

* commit '022299dfce6a705a8cbaff972a4309da6e90a8c2':
  Disconnect dock only if its connected.
2010-10-14 15:33:42 -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
Jake Hamby
8028cea196 am 8021537f: BT settings wait for HS service before connect. DO NOT MERGE
Merge commit '8021537ffea45d1a36274217610a314b3a0ac774' into gingerbread-plus-aosp

* commit '8021537ffea45d1a36274217610a314b3a0ac774':
  BT settings wait for HS service before connect.  DO NOT MERGE
2010-10-13 16:28:34 -07:00
Jake Hamby
8021537ffe BT settings wait for HS service before connect. DO NOT MERGE
Bluetooth connections from Settings app can sometimes fail if the
connection to BluetoothHeadsetService isn't ready. Changed code to
delay any headset connect or disconnect attempt when the service isn't
connected until onServiceConnected() is called.

Tested by adding a call to Thread.sleep(5000) before the return
statement in BluetoothHeadsetService.onBind(). This makes it easier to
kill the phone process and then attempt to connect in the settings app
before the service restarts.

Bug: 3048839
Change-Id: I2114ff8ad67c8c672fcf6ce0bf3de61fca7a49b3
2010-10-13 16:10:47 -07:00
Amith Yamasani
290ba7c1ae Fix NPE in BT Settings launch from a shortcut.
Bug: 3089335
2010-10-13 13:33:32 -07:00
Jaikumar Ganesh
836b4297cc am 03403712: Merge "DO NOT MERGE Add null check before disconnecting a device." into gingerbread
Merge commit '0340371297887290d7593d7c346e422a4c9ecd1a' into gingerbread-plus-aosp

* commit '0340371297887290d7593d7c346e422a4c9ecd1a':
  DO NOT MERGE Add null check before disconnecting a device.
2010-10-13 11:13:33 -07:00
Jaikumar Ganesh
268d1f1e4b DO NOT MERGE Add null check before disconnecting a device.
Bug: 3076404
Change-Id: I8ef140395503816296124a38e42ab9cc7e6f7159
2010-10-13 10:56:01 -07:00
Jaikumar Ganesh
0d5e320cdd am bdf13107: Merge "Call disconnect / connect without checking the current status" into gingerbread
Merge commit 'bdf1310707e436db484113d7aa2881c966cddd0f' into gingerbread-plus-aosp

* commit 'bdf1310707e436db484113d7aa2881c966cddd0f':
  Call disconnect / connect without checking the current status
2010-10-12 19:06:15 -07:00
Jaikumar Ganesh
d3a460cce7 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
2010-10-12 16:19:40 -07:00
Jake Hamby
4747950d8e am d7f7213a: am 4c0ff2c7: Merge "Fix bug where car dock sometimes doesn\'t connect." into gingerbread
Merge commit 'd7f7213af27fa6c5e476bb8a8d2951feb5e630b5'

* commit 'd7f7213af27fa6c5e476bb8a8d2951feb5e630b5':
  Fix bug where car dock sometimes doesn't connect.
2010-10-12 13:18:21 -07:00
Jake Hamby
d7f7213af2 am 4c0ff2c7: Merge "Fix bug where car dock sometimes doesn\'t connect." into gingerbread
Merge commit '4c0ff2c7b5138c0fce6c83f6c414204e32ac96f3' into gingerbread-plus-aosp

* commit '4c0ff2c7b5138c0fce6c83f6c414204e32ac96f3':
  Fix bug where car dock sometimes doesn't connect.
2010-10-11 13:07:09 -07:00
Jake Hamby
582f1f84bb 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
2010-09-29 15:38:19 -07:00
Jaikumar Ganesh
5809d33296 Update code for public Bluetooth APIs
Change-Id: Iab22e4ae3206f9085b2d53b8b18dc2abd6197226
2010-09-28 17:53:02 -07:00
Jake Hamby
989408cc70 am 68c6188b: am dd79a33b: Auto-connect Bluetooth device only when user initiates pairing.
Merge commit '68c6188b91ca4034caeff7527487513c8cb012f8'

* commit '68c6188b91ca4034caeff7527487513c8cb012f8':
  Auto-connect Bluetooth device only when user initiates pairing.
2010-09-24 17:19:24 -07:00
Jake Hamby
68c6188b91 am dd79a33b: 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.
2010-09-24 17:16:37 -07: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
Jake Hamby
2695660674 am 5496db04: am 59091c08: Fix Bluetooth device name max length checking.
Merge commit '5496db047df21a44280c56984dbc296e2a1d7968'

* commit '5496db047df21a44280c56984dbc296e2a1d7968':
  Fix Bluetooth device name max length checking.
2010-09-22 17:05:30 -07:00
Jake Hamby
5496db047d am 59091c08: Fix Bluetooth device name max length checking.
Merge commit '59091c08f4d0ad8f42013f58ce9bd23ac3306336' into gingerbread-plus-aosp

* commit '59091c08f4d0ad8f42013f58ce9bd23ac3306336':
  Fix Bluetooth device name max length checking.
2010-09-22 16:26:02 -07:00
Jake Hamby
59091c08f4 Fix Bluetooth device name max length checking.
The Bluetooth device name has a maximum length of 248 bytes in UTF-8
encoding. The settings app previously limited the Bluetooth device
name entered by the user based on the number of characters, which is
incorrect when the name includes non-ASCII characters.

Created a new Utf8ByteLengthFilter class for BluetoothNamePreference
which counts UTF-8 bytes instead of Unicode characters, along with
unit tests.

We can move Utf8ByteLengthFilter into the framework in the future
if it would be useful elsewhere in the system or for applications.

Change-Id: I9debface09659f09d750f3bfe8ad6ddfd34c75c5
2010-09-22 16:04:50 -07:00
Jaikumar Ganesh
69b0218849 am 356745ec: am 213d579f: Merge "Don\'t disconnect the same device before connecting." into gingerbread
Merge commit '356745ecc63419a2569345186e8612a5b0ced28d'

* commit '356745ecc63419a2569345186e8612a5b0ced28d':
  Don't disconnect the same device before connecting.
2010-09-16 23:24:15 -07:00
Jaikumar Ganesh
356745ecc6 am 213d579f: Merge "Don\'t disconnect the same device before connecting." into gingerbread
Merge commit '213d579f98a83145989f11cfdbd47631b64de000' into gingerbread-plus-aosp

* commit '213d579f98a83145989f11cfdbd47631b64de000':
  Don't disconnect the same device before connecting.
2010-09-16 22:15:50 -07:00