Commit Graph

521 Commits

Author SHA1 Message Date
Ed Heyl
a762e1d708 Merge remote branch 'goog/ics-mr1' into ics-aah 2011-10-31 05:54:48 -07:00
Jaikumar Ganesh
f5754a078c Fix UI issue with Bluetooth Settings.
When a profile fails to connect, the preference was getting unset.

Patch generated in conversation with Jake Hamby.

Bug: 5526404
Change-Id: I27ab8d337b6d121f8d369841d3f9a691293ef922
2011-10-27 16:39:50 -07:00
Mike J. Chen
ef4eb89d71 Allows auto dismissing of bluetooth activation dialogs
Create a new overlay boolean that allows products (like Android@Home
ones that have no or minimal display) to not bring up the bluetooth
activation confirmation dialog.

Change-Id: I23c2d1483a4d71b0025624c2e4aaacc688de3260
Signed-off-by: Mike J. Chen <mjchen@google.com>
2011-10-27 17:39:54 -04:00
Jake Hamby
de53b46b16 BT device picker: don't rescan after rotating the device
The Bluetooth device picker was restarting the device scan after
the screen is rotated. Fix this by only starting the scan when the
savedInstanceState Bundle passed to onCreate() is null.

Also removes "No Bluetooth devices were found nearby" from list if
the user switches to a different app and then switches back to
the device picker.

Bug: 5249380
Change-Id: I8959c850649eb713fb930ee0a8a7bcb73ca7c1aa
2011-09-06 18:35:08 -07:00
Jake Hamby
9a4543e1de Fix unresponsive UI during scan and display of "No Bluetooth devices"
- When there are no available Bluetooth devices, we show
  "No Bluetooth devices were found nearby" as a preference item after
  the scan completes. Update the layout for this Preference item so
  that the text is centered and doesn't highlight when touched.

- Fix slow responsiveness on scanning caused by repeated removal of
  "No Bluetooth devices were found" preference item on every call to
  onBindView().

- If no devices are paired, don't restart the scan on every rotation.

Bug: 5173935
Bug: 5055460
Change-Id: I52fb2d52f315c5e793f08499146842d54c5c3ead
2011-08-31 17:18:36 -07:00
jhtop.kim
8abbaab8b3 Bluetooth : fix for showing paired device list error
- Pair one devie, then turn off BT then reboot the phone
  and enter Bluetooth settings screen and turn on BT.
  The last paired device will not be displayed in paired list.
- After onResume() is called, the list is shown.

- The reason is that mDevicePreferenceMap is not empty. The paired
  devices are cached when BT is off and then skipped when BT is
  turned on and updateContent() is called again.
- Make the mDevicePreferenceMap clear when updateContent() is called
  and adapter state is BluetoothAdapter.STATE_ON.

Change-Id: Ia745e02bcb4e21a54ccc8477a4dfbad1fa5aed17
Signed-off-by: jhtop.kim <jhtop.kim@samsung.com>
2011-08-25 11:42:38 -07:00
jhtop.kim
d66b61908d Bluetooth : fix for unnecessary device-scan starting
- When trying to pair with any device, if bond state changes
  device scan will be started automatically.

- add some flag to check proper scan time and to prevent unnecessary device scanning.

Signed-off-by: jhtop.kim <jhtop.kim@samsung.com>

Change-Id: I4977ec122105f33cdd25a4f5c9fed59dda916379
2011-08-24 15:31:40 -07:00
Matthew Xie
92f92b5449 Merge "Remember user choice for phone book access permission dialog" 2011-08-18 17:12:33 -07:00
Matthew Xie
b707255a44 Remember user choice for phone book access permission dialog
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
2011-08-18 16:31:30 -07:00
Jeff Sharkey
dcf8ba9eb2 Follow preferences padding changes in framework.
Change-Id: Ia83237290da035e5ee7a2e92ef56fc02838aac56
2011-08-16 16:37:49 -07:00
jhtop.kim
e96f04c1ff Bluetooth : fix for Settings crashes while rotating the screen.
- Add some codes preventing setting crash when rotating the screen
  when the Rename device or Visibility timeout dialogs are visible.

Change-Id: I5e142a5d869a0d5c91c6ace80093d09178d79558
Signed-off-by: jhtop.kim <jhtop.kim@samsung.com>
2011-08-15 15:14:58 -07:00
Jake Hamby
12294f893d Merge "Bluetooth : fix for unexpected discovery summary string changing" 2011-08-09 13:29:25 -07:00
jhtop.kim
1ecee6c100 Bluetooth : fix for unexpected discovery summary string changing
- While Visibility timeout setting is never,
  the summary string "Visible to all nearby Bluetooth devices" is shown.
  but if rotating screen or unpairing, pairing actions make the summary
  be changed "Not visible to other Bluetooth devices" or
  "Only visible to paired devices"
- call handleModeChanged() to refresh summary state.

Change-Id: I4b324f2a9530e5e4ca4571f3dd47e8992bdae0cb
Signed-off-by: jhtop.kim <jhtop.kim@samsung.com>
2011-08-08 15:46:44 -07:00
jhtop.kim
aaf8ffff79 Bluetooth : fix for handling back key during pair dialog display
- Pressing back key when pairing dialog appears infront , device shows "Pairing..."
  if we don't have any bonded device in device list.
- when press back key will perform onCancel() operation.

Change-Id: Iacd654efad455f17a5c3bb09f822d9af5a7aed7d
Signed-off-by: jhtop.kim <jhtop.kim@samsung.com>
2011-08-08 15:21:12 -07:00
Jake Hamby
79be0b3e6b Fix multiple BT settings bugs.
- Change Bluetooth profiles screen to match ICS wireframes
- Remove BluetoothProfilePreference.java (no longer used)
- Remove "Pair with this device" summary below every unpaired device
- Remove "Paired but not connected" summary below unconnected paired devices
- Fix auto connection after pairing (reuse existing CachedBluetoothDevice)
- Add "Connected (no phone/media)" summaries based on ICS wireframes
- Fix visibility timeout strings.
- Fix crash when starting Bluetooth from Settings shortcut widget.

Bug: 5064139
Bug: 5064324
Bug: 5080404
Bug: 5093513
Bug: 5104485
Change-Id: Ie87103e183ce414c86cb1831a38ef0178b1b1292
2011-08-03 17:55:27 -07: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
2837fbbe15 Merge "Bluetooth : fix for crashing alertDialogbox" 2011-07-25 17:21:58 -07:00
jhtop.kim
bb16e15de3 Bluetooth : fix for crashing alertDialogbox
- changes for crashing of alertDialogbox while displaying message
- in showError function, this fix code shoud be added in case of showing error pop up

Bug: 5068089
Change-Id: I40e8a699461832b7bd47080b40f467572632d412
Signed-off-by: jhtop.kim <jhtop.kim@samsung.com>
2011-07-25 16:22:43 -07:00
Jake Hamby
49cfe8a3c8 Fix some Bluetooth settings bugs.
- Remove BluetoothFindNearby.java (no longer used)
- Show message when Bluetooth is turning off
- Fix case where device name sometimes didn't show when turning BT on
- Disable "Rename device" and "Visibility timeout" menus when BT is off
- Remove "Got onDeviceAdded, but cachedDevice already exists" log message
- Never show "Rename device" in action menu (bug 5064378)
- Show discovery time remaining as "m:ss", not "mm:ss" (bug 5064104)

Bug: 5064378
Bug: 5064104
Change-Id: I79609dfdad61993a28cff64c9e082870ff74d180
2011-07-25 14:57:07 -07:00
jhtop.kim
298365bbf3 Bluetooth : Fix for changing the BT device icon if the calss is null (mouse)
- mouse is displayed as keyboard. if class is null, default icon is keyboard in hid profile

Change-Id: I2ff928ce1032d8eb492d81fff2e7fb218970b768
Signed-off-by: jhtop.kim <jhtop.kim@samsung.com>
2011-07-18 15:54:14 -07:00
jhtop.kim
01525c9a05 Bluetooth : fix to finish deviceprofilesettings activity when device is not bonded
- if cached device state is "BluetoothDevice.BOND_NONE" then finish activity

Change-Id: I5c981e8c4800c10f1f8570668794301d5da03188
Signed-off-by: jhtop.kim <jhtop.kim@samsung.com>
2011-07-18 15:49:12 -07:00
jhtop.kim
5ab6b6b004 Bluetooth : fix UI bug: Disable "OK" button if friendly name is null
- If device's name is null, BT address is set as friendly name.
- so, fixed. if name field is null "OK" button is disabled.

Change-Id: I04b59ebf13d1b3203acf7345bd531cc6c563da0d
Signed-off-by: jhtop.kim <jhtop.kim@samsung.com>
2011-07-18 15:44:14 -07:00
jhtop.kim
2affa6b28d Bluetooth : UI bug fix : Pairing dialog box takes space as character
- In pairing dialog box even if PIN was removed in text box, still the OK button is enabled
- When length is zero , disable the OK button in pairing dialog
- update fix to prevent error while mOkButton is not ceated.

Change-Id: I38ff3029cff2e7c4e87b7f9c93fa262125e91d44
Signed-off-by: jhtop.kim <jhtop.kim@samsung.com>
2011-07-18 15:32:25 -07:00
Jake Hamby
ca9812a852 Upgrade Bluetooth pairing dialogs for ICS.
* 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
2011-07-15 15:39:53 -07:00
Gilles Debunne
6dc0f9639e Refactor Bluetooth settings
Two lists: paired devices and available devices.
New item at top for the device itself (not connected to discoverable, this is a larger
refactoring).

New settings icon.

Change-Id: I788a6c0afdb07309d449a4d41a02cf8480c95a37
2011-07-08 09:40:47 -07:00
Gilles Debunne
606d878852 Merge "Changed text and appearance when Wifi/Bluetooth is off" 2011-07-07 16:04:53 -07:00
Gilles Debunne
18e9992a5e Changed text and appearance when Wifi/Bluetooth is off
A TextView is used as an empty view, centered on screen with the message.

Change-Id: I33825775d6b2ed212e5839cfac84d055b9336667
2011-07-07 16:04:00 -07:00
Matthew Xie
722934dbbc Merge "Show user dialog for BT connection and phonebook access" 2011-07-07 12:27:41 -07:00
Gilles Debunne
9416136b4d Bluetooth messages improved.
Tap to pair in place of searching. Message when no device is found.

Change-Id: I0a4b1fa140e8a30b154ae2686e9c75d3768fc44e
2011-06-30 15:44:07 -07:00
Matthew Xie
dbed12020c Show user dialog for BT connection and phonebook access
Show user dialog for incoming BT connection requests from unknown
devices. Move phone book access permission dialog from bluetooth to settings.
The permision dialog pops up to the screen properly instead of
always as notification. AT+CPBR will also use the permission dialog
to ask for user permission.

bug 4489572

Change-Id: Ic1e74b2a9416a462cac4f519240a313691da90c4
2011-06-29 23:33:26 -07:00
Gilles Debunne
4346cda76c Double list in Bluetooth Settings
Paired devices are listed first (from cache), followed by unpaired ones.
A scan is only started on user request or when there is no paired device
(should it be when there is no paired *connected* device?).

Wrench icon only displayed for paired devices.

Wrench click listener no longer uses mDeviceSettings which is unreliable
with ListView view recycling.

Fixed blinking ProgressCategory when the category was first in the list.

Change-Id: Ie749883426c12bd354da64733bd04b00304bc1f5
2011-06-28 18:17:30 -07:00
Gilles Debunne
dc7101ff88 Split ActionBar in Settings
Made menu item visible to force action bar, changed style.

Also change parent_fragment for items that have been moved to top level (wifi,
bluetooth, development, battery).

Change-Id: I62932ba55356abdfbf94942f5b4efaa0f15dbd6a
2011-06-27 17:00:23 -07:00
Gilles Debunne
2454f49c93 Fixed Bluetooth availability test in Settings
Added similar test for WiFi to be consistent.

Added null tests in BluetoothEnabler.

Change-Id: Ia6e7b150a1bc060c7ce0b4db12ab3f6c958af104
2011-06-21 16:37:26 -07:00
Gilles Debunne
e78c187905 Settings refactoring
Wifi and bluetooth pane refactored, main toggles moved to left pane.

Change-Id: I42ea4cf3bdf24158f3c67e0dea311258206cd78a
2011-06-21 11:05:29 -07:00
Amith Yamasani
3a5b3494a7 Make the BT class icon visible.
This change is required due to a change in the framework to accomodate smaller screen sizes.

Bug: 4519989
Change-Id: I77c5d72b29dec69df2bdd4d82811f4828ad155a6
2011-06-02 11:48:55 -07:00
Jake Hamby
f1139aab80 Fix NPE in WirelessSettings.onCreate() for SDK and non-BT devices.
Fix NPE when entering Settings app in the SDK (and for devices without
Bluetooth). Also remove the "Bluetooth settings" item in addition to
the Bluetooth toggle item from Wireless settings when BT is missing.

Bug: 4149307
Change-Id: Iecc5960a193cf88664d3217b4d7bdbc2276dabc0
2011-03-28 20:25:23 -07:00
Amith Yamasani
f502eaba0a Flip the icon states for Bluetooth profile auto-connect settings
Bug: 4109035
Change-Id: Idb37a583957eeb8ea4c0b804e7933fd8e9af98e3
2011-03-15 15:14:48 -07:00
Jake Hamby
c777ee29c8 Improve Bluetooth tethering UI usability.
- 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
2011-03-09 14:56:56 -08:00
Jaikumar Ganesh
46a2941b3f Merge "Return profile state disconnected when not yet bound to service." into honeycomb-mr1 2011-03-08 19:40:12 -08:00
Jaikumar Ganesh
37bf3353d1 Return profile state disconnected when not yet bound to service.
Bug: 4007080

There is a another bug open to handle service object being null
and a connect / disconnect call being made.

Change-Id: I30f6923323532b5756338b350ec4ce0e1a31d1ff
2011-03-08 18:04:25 -08:00
Jaikumar Ganesh
6eb84ac6de Settings app: Run Bluetooth Event receiver when not in fg.
Also fix connection indication issues.
Fixes bugs 3510336 and 3513352

Change-Id: Iaa47c9d7fd04fa5dd2700f55993ba2fd1a78fd70
2011-03-04 14:53:44 -08:00
Jaikumar Ganesh
50e0b0cf87 Fix settings app not showing correct profile connection state message.
Bug:3385085
Change-Id: Ie4b7eb6bc9d8c91264cf7f68d7830c110e34496d
2011-03-04 10:27:31 -08:00
Jaikumar Ganesh
98fc5e2570 Fix crashes with OPP profile in Settings app.
Change-Id: I712667f11c0de849da48add912421dfca3e85484
2011-03-01 19:12:44 -08: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
Jaikumar Ganesh
5a3120cab7 Display imaging icon for printer devices.
Change-Id: Iea2a77bb3b79934174f6e39b080ade47bd119773
2011-02-28 11:27:35 -08:00
Jaikumar Ganesh
9ad703cdb9 Make BluetoothPan implement BluetoothProfile.
This makes it consistent across all other profiles.

Change-Id: I4c0694d042d7ed1b78c92ca3be38c8d543886769
2011-02-23 13:30:08 -08:00
Jaikumar Ganesh
77bcd7e807 Update code for making BluetoothInputProfile implement BluetoothProfile.
Change-Id: Ib04abc590429eaa40c0ea1bd24fa728d41306fe8
2011-02-18 14:57:25 -08:00
Jaikumar Ganesh
d955af8461 Changes for public API of Bluetooth Discoverability.
1. Apps can ask for any time between 0 and 3600 secs
2. O implies always discoverable
3. Any invalid values will default to the defaul - 120 secs.

Change-Id: Ife1bc803587ba975bb103a5ba7629d4a382cd705
2011-02-01 19:58:29 -08:00
Chris Wren
1b0489cb3e Allow users to change the length of Bluetooth discoverability to
be two minues, five minutes, an hour, or forever discoverable.

This addresses the internal bug 2413429:
	http://b/issue?id=2413429
and external issue 6348:
	http://code.google.com/p/android/issues/detail?id=6348

Original Author: Chris Wren <crwen@google.com>
Modifications done by: Jaikumar Ganesh<jaikumar@google.com>

Change-Id: Ie12e56ac41aa01a161d263c7525b6e021d4eeb1f
2011-02-01 16:25:44 -08:00
Jake Hamby
a6d9fce2e1 Don't display extra A2DP profile icon for OPP.
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
2011-01-27 20:32:21 -08:00