Commit Graph

80 Commits

Author SHA1 Message Date
Fabrice Di Meglio
15826d4ea1 Mode code cleaning: remove obsolete references to EXTRA_NO_HEADERS
- the EXTRA_NO_HEADERS flag as no more meaning as we are showing
the Tiles (previously named "Headers") only in the Dashboard
(which is the main Settings screen)

Change-Id: I55656de0d28ca9c84adbe6647d870838b4ac230b
2014-05-13 13:10:34 -07:00
Fabrice Di Meglio
ede1435518 Make all the Settings Switches appear again
- use the ActionBar Theme context when creating the Switch for
getting the correct Theming

Change-Id: Ic3701c53662b0f245c7149b119de8bb5cbaae232
2014-04-18 16:49:35 -07:00
Fabrice Di Meglio
45f754e506 Add Indexable.SearchIndexProvider.getNonIndexableKeys(Context)
- getNonIndexableKeys(Context) allow a SearchIndexProvider to tell which data
he does not want to index by providing a list of the data keys
- use this new API for SoundSettings and removing KEY_EMERGENCY_TONE related
settings if the device is not CDMA
- add a BaseSearchIndexProvider for code simplification

Change-Id: I23633ace1d7e390ee05fac0a5458a33e04e72d8d
2014-04-11 11:16:33 -07:00
Fabrice Di Meglio
86ea97f452 Re-enable on/off switch for Wi-Fi and Bluetooth Settings
- the switch was no more there when launching from an Intent (it was a regression)

Change-Id: I1fc95cad4523a1d3812323fb26908f925a9e623e
2014-04-03 13:57:56 -07:00
Fabrice Di Meglio
d37e0b6a45 Merge "Settings - update for new UI (no more Drawer)" 2014-03-28 23:08:21 +00:00
Fabrice Di Meglio
d25314d330 Settings - update for new UI (no more Drawer)
- follow the UX spec by no more using a Drawer
- the Dashboard is now a Fragment that contains the list of Headers
- the search results are also put into a Fragment that is replacing
the initial one (Dashboard or other) when expanding the SearchView
- use a SearchView for query input
- when tapping on a Header or a Search Result, re-launch Settings as
an Activity so that we are benefiting from the Activity stack for
UP affordance and BACK button
- manage UP affordance to show it only when needed
- move some Actions to the Menu in the ActionBar for allowing space
to the Search action and removing some clutter
- fix an issue with the Index and WiFiEnabler and their cached Context
that was not updated when there was a Configuration change
- simplify the SettingsActivity code by extracting some inner classes

Change-Id: I50b5f77bb44a7fade1886114dbbc820609a5e63d
2014-03-28 15:51:29 -07:00
Nicholas Sauer
cb644cc2e7 Skip bluetooth device iteration if LocalBluetoothManager is null
bug:13653239

Change-Id: I163c47b626825b2f83bb63d9f6900216ce44ae41
2014-03-27 14:28:33 -07:00
Fabrice Di Meglio
51bfee595c Add dynamic Preferences indexing (part 2)
- change the Index SQL model. Add a new "enabled" column.
- use that column for issuing a more restrictive search query
- change the SearchIndexProvider API to pass the "enable" state
- apply it to Bluetooth settings
- refactor the list of indexable resources (SearchIndexableResources)

Change-Id: Ic900fb27cb12a285a80d953aa1aa88f0070cd986
2014-03-20 20:40:04 -07:00
Fabrice Di Meglio
5135dce142 Add indexing for cached Bluetooth (BT) paired devices
- comply to the SEARCH_INDEX_DATA_PROVIDER
- add to the Index the name of previously paired BT devices
(this will work for now only and only if BT has been on during
the indexing)

Change-Id: I00065db0f4e9657cca3578a2fafa0ec39cfaa432
2014-03-20 14:02:42 -07:00
Wei Wang
17d2124c1c Revert "BLE peripheral mode (4/4): Settings change for advertising preference."
This reverts commit eb56b9ccb8.

Conflicts:
	src/com/android/settings/bluetooth/BluetoothDiscoverableEnabler.java
	src/com/android/settings/bluetooth/BluetoothSettings.java
	src/com/android/settings/bluetooth/LocalDeviceProfilesSettings.java

Change-Id: I2ce6b9eb0e335ba1b9aa4e1cb61a041f00d9aa87
2014-03-03 11:18:21 -08:00
Matthew Xie
a504c4dcdf Update context on resume calls for BluetoothAdvertisingEnabler and BluetoothEnabler
The saved context could be invalid if not updated
bug 12991455

Change-Id: I93abb8420d0fa53add1f0e843a5069d59743891c
2014-02-14 17:08:38 -08:00
Fabrice Di Meglio
ce930c15ae Crash in Settings observed while changing the device orientation after renamed tablet
There was a fundamental flow in the BT code. Basically BluetoothSettings is using
a singleton BluetoothDiscoverableEnabler.

BluetoothDiscoverableEnabler is keeping (thru its constructor) a reference on a Context
for registering/unregistering some broadcast receiver. BUMMER! When you change orientation
(or more generally the device Configuration), your Context is no more the same!

Hence the crash as we were  trying to unregister a Receiver on a Context that is no more valid.

Fix that issue by passing an updated Context to the BluetoothDiscoverableEnabler.resume() API.

Bug #12991455
Change-Id: I77db15d2b59b6dd973907e26f9e6bb022202a8b5
2014-02-14 23:53:44 +00:00
Fabrice Di Meglio
263bcc8b73 Use Drawer in Settings app
- get rid of PreferenceActivity as much as we can and use fragments instead
- add Drawer widget
- add Dashboard high level entry into the Drawer (but this is work in progress and would be done in another CL)
- add bypass of fragment's Header  validation when launched from the Drawer but *force* validation if external
call thru an Intent

Be aware that WifiPickerActivity should remain for now a PreferenceActivity. It is used by SetupWizard and should
not trigger running the SettingsActivity's header building code. SetupWizard is a Home during the provisionnig process
and then deactivate itself as a Home but would make the Home header to appear in the Drawer (because momentarily we
would have two Home).

Also, verified that:

- the WiFi settings still work when called from SetupWizard
- when you have multiple Launchers, the Home header will appear in the list of Headers in the Drawer

Change-Id: I407a5e0fdd843ad7615d3d511c416a44e3d97c90
2014-02-03 16:36:46 -08:00
Wei Wang
eb56b9ccb8 BLE peripheral mode (4/4): Settings change for advertising preference.
Change-Id: I5721f136267fe25e55f764bb4a6c53acd45b318b
2014-01-13 17:41:02 -08:00
Geoffrey Borggaard
fe21d9aaa8 Pin protect more screens.
When these screens are locked down with user restrictions,
it should prompt the user for the restrictions pin before allowing
access to the settings screen.

Change-Id: Iadbb087da2d9470b855ea0bea89f2da1ffb9e854
2013-08-06 17:24:37 -04:00
Maggie Benthall
11b69bf86d Implement Settings app UX for when a user has bluetooth config locked down.
When a user has the user restriction DISALLOW_CONFIG_BLUETOOTH
- Remove all the menu items for searching and other config
- Hide "available" but non-paired devices
- Remove settings button from paired devices
- Remove ability to make the device visible to others

Change-Id: Icaebf29d3cce55d924fdd65449447b5b7a438bbe
2013-04-08 16:05:38 -04:00
Fabrice Di Meglio
b27223f139 Fix Switches padding for Settings app
- use setPaddingRelative() instead of setPadding()

Change-Id: Ifd14193a5f60d303035b394616dc65a70e1ef5f9
2013-01-15 18:54:11 -08:00
Jeff Brown
a17a5b814f Fix regression in Bluetooth settings.
Bug: 7207090
Change-Id: Ie14a1d36a61b571766d2025ed7d8079712727690
2012-09-24 20:33:51 -07:00
Jeff Brown
9e143f5e9d First draft of wifi display settings UI.
All of the functionality is in place but the UI is
not fully polished yet.

Bug: 7178216
Change-Id: Id76843bff05cc71e5c02a31bc97c7070d58fff10
2012-09-19 21:37:20 -07:00
Fabrice Di Meglio
79d8e80a30 Make Settings app aware of layout direction
- see bug #5429822 UI should be mirrored for RTL locales (Arabic, Hebrew, farsi)

Change-Id: I696c0f66a16640af767da3c05b5d300fd2284ecb
2012-07-24 15:02:12 -07:00
Amith Yamasani
b0b37ae21c Help menus for several screens.
Bug: 5144896
Change-Id: Ib2f5146f6f62f2a33261bb165c3bf1bf13b22f38
2012-04-23 15:35:36 -07:00
Amith Yamasani
5fb53f36cb Don't crash if there's no bluetooth functionality (such as in an emulator)
Bug: 6079494
Change-Id: I12f729134407eaa719dc6a25e89a3b48476985e2
2012-02-27 17:18:45 -08: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Amith Yamasani
290ba7c1ae Fix NPE in BT Settings launch from a shortcut.
Bug: 3089335
2010-10-13 13:33:32 -07:00
Daisuke Miyakawa
6ebf8619d7 Fragmentize BluetoothSettings.
Add UserLeaveHintListener.java, so that the settings won't use
its implementation around Activity#onUserLeaveHint().

Also fragmentize bluetooth tethering screen.

Change-Id: Id06ae3161fbdb5854ddb7a257f464fb16ea9b089
2010-09-13 16:18:05 -07:00