Commit Graph

35 Commits

Author SHA1 Message Date
Chris Wren
9d1bfd1e8d port settings over to new metrics enum
Change-Id: I0b3efd2f4db773ccbc52bfe59ee8eb0dab9584fb
2016-01-27 10:58:58 -05:00
Chris Wren
1b6ffba9e6 log more settings actions
airplane mode
  bluetooth
  cell data
  do not disturb

Bug: 20264417
Change-Id: I726033a126fba9f9dffc916806d636feea04033b
2015-05-08 18:48:24 -04:00
Jason Monk
f2982a9ba1 Move isolatable bluetooth code to SettingsLib
Move the non-ui bluetooth control/tracking code to SettingsLib so
that it can be shared with others.

Mostly just move classes to frameworks/base/packages/SettingsLib,
however a few things had to move around.
 - Dock handling had to move back to code still in settings
 - Local preference related code had to be moved back to settings
 - Added an error flow from SettingsLib to Settings

Depends on I69fd888362c6dbb325f6113b32c4b15cc6a23a41
Bug: 19180466
Change-Id: Ie57fe26a27bbb0adc2ef69e042a05c7290c6a52a
2015-02-05 10:43:57 -05:00
Jason Monk
fc1b00cfe4 Move some wifi tracking code to SettingsLib
Move tracking of which networks are available/saved and their state
over to SettingsLib to share it with Quick Settings.

Bug: 19180466
Change-Id: Iaeef06b26da8cb38e1ba09a7d105d04d499dc181
2015-02-04 20:40:32 +00:00
PauloftheWest
797fc45ff6 Fixed a Setting Bluetooth Airplane mode bug.
+ This patch moves the switch listeners from setup/teardown of the SwitchBar
to pause/resume of Bluetooth Settings.  This prevents Bluetooth from
receiving connect messages while Airplane mode is turning off Bluetooth
(which is what caused Bluetooth to re-enable.)

Bug: 17465951
Change-Id: I4d32fcf5bb3a2241ed03e2295c86390e15743954
2014-10-01 08:23:40 -07:00
Fabrice Di Meglio
138ff8c045 Make the SwitchBar appear immediately
- change the way the SwitchBar is shown and hidden
- save its state
- remove the delay transition code

Change-Id: I07260430e6709b42517ca011f6d3c3446a626731
2014-06-12 11:13:23 -07:00
Fabrice Di Meglio
cf37cb6bbc Use SwitchBar for Bluetooth Settings
- follow up CL to 4193776698

Related to bug #14898161 On/Off switches must move down from Action Bar

Change-Id: Ic04de39599c91388cba8510bfd46d96e7bc30260
2014-05-14 17:05:48 -07:00
Fabrice Di Meglio
131f49feea Better decoupling of Index updates in Bluetooth Settings
- use a Handler
- force rebuilding

Change-Id: I474fa98ea0e0758abcc46d4812f744dff24fd455
2014-04-21 11:32:39 -07:00
Fabrice Di Meglio
490099b135 Allow partial Index rebuilding thru updateFromClassNameResource(...)
- add a new boolean parameter to ask for Index rebuilding:
passing "true" will delete first all the data corresponding to the
"className" and then apply the update.

Change-Id: Ifc42fc560a14f5470b466cf6982915d9207fa3c7
2014-04-14 13:31:14 -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
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
Jeff Sharkey
5a740ab1b9 Merge "More migration to Global settings." into jb-mr1-dev 2012-10-18 23:23:08 -07:00
Jeff Sharkey
860eceba2c More migration to Global settings.
Bug: 7375796
Change-Id: I43079368c32e91e8bb75b00377cd57d1766f15d4
2012-10-18 15:38:42 -07:00
Zhihai Xu
ec16c0ae42 bluetooth won't turn on after turn Airplane mode off on setting screen on manta(tablet)
The root cause is normally when change the airplane mode, the bluetooth setting UI
 will not be foreground. No listener is setup for bluetooth setting UI when it is
 in background. So the onCheckedChanged won't be called and mLocalAdapter.setBluetoothEnabled
 won't be called. But for manta, airplane mode setting and bluetooth setting UI both
 will show on the foreground due to bigger screen size. When we turn ariplane mode on,
 bluetooth manager service will disable bluetooth without changing the persist bluetooth setting.
 But bluetooth setting UI will listen to the bluetooth state change intent, it will receive
 bluetooth state turn-off intent then it will call mSwitch.setChecked(false) in handleStateChanged,
 which cause checked status changed from true to false to trigger the listener (onCheckedChanged)
 being called. The listener will call mAdapter.disable() which will call mManagerService.disable(true)
 to change bluetooth persist state to OFF. So when we turn back airplane more to OFF,
 due to the bluetooth persist state is OFF, we won't turn back bluetooth to ON.
 Don't need to consider thread synchronization, because everything is running on the main thread.

bug 7366814

Change-Id: I138d1904df6cb17c7828295caa51a7d80abf99f2
2012-10-18 13:03:10 -07:00
Irfan Sheriff
4aaebfe591 Revert "bluetooth won't turn on after turn Airplane mode off on setting screen on manta(tablet)"
This reverts commit 0b21b3d725.
Bug: 7366814

Change-Id: I0992e9ca1a6e36ebc3a717137a6c494835fad712
2012-10-17 18:45:42 -07:00
Zhihai Xu
0b21b3d725 bluetooth won't turn on after turn Airplane mode off on setting screen on manta(tablet)
The root cause is normally when change the airplane mode, the bluetooth setting UI
 will not be foreground. No listener is setup for bluetooth setting UI when it is
 in background. So the onCheckedChanged won't be called and mLocalAdapter.setBluetoothEnabled
 won't be called. But for manta, airplane mode setting and bluetooth setting UI both
 will show on the foreground due to bigger screen size. When we turn ariplane mode on,
 bluetooth manager service will disable bluetooth without changing the persist bluetooth setting.
 But bluetooth setting UI will listen to the bluetooth state change intent, it will receive
 bluetooth state turn-off intent then it will call mSwitch.setChecked(false) in handleStateChanged,
 which cause checked status changed from true to false to trigger the listener (onCheckedChanged)
 being called. The listener will call mAdapter.disable() which will call mManagerService.disable(true)
 to change bluetooth persist state to OFF. So when we turn back airplane more to OFF,
 due to the bluetooth persist state is OFF, we won't turn back bluetooth to ON.

bug 7366814
Change-Id: I07d4a2dfe03fc6775cfeabb28cd3a0cc1fded44e
2012-10-17 13:57:43 -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
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
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
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
Chia-chi Yeh
b90452f3d2 Settings: revise WifiEnabler and BluetoothEnabler.
This mainly changes the way both enablers react to the airplane mode. Now
enablers show a toast message instead of disabling the check box directly. This
avoids the inconsistent state introduced by WirelessSettings which controls the
check box using layout dependency.

Related bug: 2053751
2010-01-15 06:12:29 +08:00
Jeff Sharkey
1c4e96864f Allow bluetooth in airplane mode when in "toggleable" list.
Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS is a list of
radios that can be toggled while in airplane mode.  This CL
changes BluetoothEnabler to respect this.

It parallels the logic in WifiEnabler, which enables OEMs
to allow Wifi changes when in airplane mode.

Most existing devices don't include "bluetooth" in the
toggleable list, which means bluetooth will continue to be
disabled when in airplane mode for those devices.

Fixes http://b/2297314
2009-12-22 14:35:44 -08:00
Michael Chan
e6531e253b b/2154978 Show only connectable profiles (Headset and& A2DP but not OPP) in Bluetooth Device Advance Options aka "Connect to..."
Change-Id: I34249a4828707bde491da4a82dca94ecf37cf490
2009-09-30 17:43:12 -07:00
Michael Chan
b662f54542 b/2137747 Fixed the problem where BT is stuck grayed out if you turned off BT, turned on Airplane mode, turn off then on screen, turned off Airplane mode.
Change-Id: I37c628e4a98157ed91d519518773a458dca36c00
2009-09-27 12:46:51 -07:00
Nick Pelly
16cc86315d Update application for Bluetooth API changes.
Change-Id: I8351611f0f0c5eda3e423dbe7e7b53e52d75ac36
2009-09-10 18:44:25 -07:00
Nick Pelly
f4779354b3 Update application for Bluetooth API change: deprecation of BluetoothError. 2009-09-08 17:49:57 -07:00
Nick Pelly
ca564d6bda Update application for Bluetooth API change. 2009-09-08 16:24:03 -07:00
Nick Pelly
d63c011225 Bluetooth: Update Settings.apk to match BT API change.
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).
2009-08-17 17:09:44 -07:00
Michael Chan
f25063aee3 Fixed the Bluetooth On/Off Checkbox in settings so it is enabled/disable properly.
In the BroadcastReceiver, pickup the new bluetooth status from the intent instead
of calling back to LocalBluetoothManager.  There could be race condition since
LocalBluetoothManager itself gets the same info via the BroadcastReceiver mechanism.
Also cleaned up logs.
2009-04-29 14:17:06 -07:00
The Android Open Source Project
e6dd1fa185 auto import from //branches/cupcake_rel/...@140373 2009-03-18 17:39:48 -07:00
The Android Open Source Project
afc4ab2ffb auto import from //depot/cupcake/@135843 2009-03-03 19:32:34 -08:00
The Android Open Source Project
4e14e5ccbf auto import from //depot/cupcake/@135843 2009-03-03 18:28:52 -08:00
The Android Open Source Project
abc48f80d8 Code drop from //branches/cupcake/...@124589 2008-12-17 18:06:01 -08:00