Commit Graph

521 Commits

Author SHA1 Message Date
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
3b22695670 Fix issue about at which time Bluetooth devices name are indexed
- remembered devices name were only indexed when BT was turned on/off
- allow the same when they are paired
- remove device name from the Index if it is un-paired

Change-Id: I1206a591b0132789c3b003e52c7ffac630e80758
2014-04-08 17:49:01 -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
a95228ff5b am 41f5437d: DO NOT MERGE: Revert "BLE peripheral mode (4/4): Settings change for advertising preference."
* commit '41f5437def4b97581d67b5636ca2dba10f8eb385':
  DO NOT MERGE: Revert "BLE peripheral mode (4/4): Settings change for advertising preference."
2014-03-20 16:24:12 +00:00
Wei Wang
41f5437def DO NOT MERGE: Revert "BLE peripheral mode (4/4): Settings change for advertising preference."
This is cherry pick from master/klp-dev changes.
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

Conflicts:
	src/com/android/settings/bluetooth/BluetoothAdvertisingEnabler.java
	src/com/android/settings/bluetooth/BluetoothDiscoverableEnabler.java
	src/com/android/settings/bluetooth/BluetoothSettings.java
	src/com/android/settings/bluetooth/LocalDeviceProfilesSettings.java
2014-03-19 22:37:27 -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
7f36c272c4 Merge "Update context on resume calls for BluetoothAdvertisingEnabler and BluetoothEnabler" 2014-03-01 22:20:34 +00:00
Matthew Xie
47c5e9c831 am 31df7cdc: am b1140053: am 85fb88ee: Merge "HTML injection fix for bluetooth pairing, issue 65946"
* commit '31df7cdcb31993c4c62bd1995af72fca57946e10':
  HTML injection fix for bluetooth pairing, issue 65946
2014-02-27 21:46:26 +00:00
Matthew Xie
b114005305 am 85fb88ee: Merge "HTML injection fix for bluetooth pairing, issue 65946"
* commit '85fb88ee10c6bb901d30e50038b4a86252ff8c68':
  HTML injection fix for bluetooth pairing, issue 65946
2014-02-27 21:39:34 +00:00
Rob Fletcher
7b0686af2f HTML injection fix for bluetooth pairing, issue 65946
During bluetooth pairing, HTML injection is possible via the device name displayed to the user. This escapes the device name, before creating HTML from it, so it will preserve things like < and > but will not affect rendering of HTML

Bug: 12976386
Change-Id: I8a02d3be8c1a779dc9ed1c9ef8083a1159ab3f2b
2014-02-27 19:46:12 +00:00
Matthew Xie
b0477c3ccc am 8e6a5d31: am 27543d42: am 0223f9c5: Merge "Bluetooth: GAP: Cancel the pairing notification on bond state change"
* commit '8e6a5d31344395ffce77caff217a90f5d0d25ab1':
  Bluetooth: GAP: Cancel the pairing notification on bond state change
2014-02-24 14:32:13 +00:00
Matthew Xie
27543d42ff am 0223f9c5: Merge "Bluetooth: GAP: Cancel the pairing notification on bond state change"
* commit '0223f9c5ddfdbcd2c759d1b0cf289844ca0438c0':
  Bluetooth: GAP: Cancel the pairing notification on bond state change
2014-02-24 14:25:28 +00:00
Srinu Jella
6892691421 Bluetooth: GAP: Cancel the pairing notification on bond state change
Cancel the pairing notification on bond state change happens from
BOND_BONDING to BOND_NONE.  Otherwise it will present in the
notification area until it gets cancelled by opening it and press
cancel on pairing dialog.

Change-Id: I96f673e29e612cd748165a1323a5b4a4276a843c
2014-02-19 15:04:08 +05:30
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
3b52963edf Fix bug #12898564 Settings Crash on Renaming the device.
- remove the call to PreferencesActivity as we are no more using the PreferencesActivity

Also set correct activity title with the new selected BT name for the device.

Change-Id: I03497187e0410ff2bba87bdb04a197938d1ea967
2014-02-05 15:18:18 -08:00
Fabrice Di Meglio
90e9e6cd30 Fix bug #12895706 BT settings crash with java.lang.ClassCastException: com.android.settings.Settings cannot be cast to android.preference.PreferenceActivity
- remove the PreferenceActivity related code as we are no more using PreferenceActivity (and Settings is a derive of
SettingsActivity)

Change-Id: I3c650c03cd205d9c06679974ae4d832ced25459b
2014-02-04 14:38:59 -08: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
f4f8d9f346 BLE peripheral mode (4/4): Settings change for advertising preference.
Change-Id: I5721f136267fe25e55f764bb4a6c53acd45b318b
2014-01-14 18:06:42 -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
Kim Schulz
54313d7d66 BLuetooth Discoverable timer not correctly cleared
Changing the discoverable timer from 2min to infinity before the 2min timer
has passed will not clear the 2min timer.
This fix handles this case.

Bug: 12220031
Change-Id: I8794eda353c74e46b09e15ee9a7a491658e7b5cd
2013-12-19 13:45:11 -08:00
Zhihai Xu
1b5bd091eb need persist adding bluetooth MAP profile to profile list in case the settings process being killed
bug:11303213
Change-Id: I1f227839931872ba6fdca0b5932a24e0b002ec44
2013-10-19 23:37:35 -07:00
Zhihai Xu
1083b4726b BT keeps on asking me if I want to allow car to do stuff
Persist the "no" count
bug:11176511

Change-Id: I39674334fe8bf09d1f3f2b07c12513a6c46f053b
2013-10-17 17:11:38 -07:00
Zhihai Xu
3fd5e2839f BT keeps on asking me if I want to allow car to do stuff
remember how many time the user choose the "no",
if user choose "no" twice, we will make it persist.
bug:11176511

Change-Id: I7234e7b4ba4586065dea462029e2da5ddaf53316
2013-10-15 11:27:54 -07:00
Zhihai Xu
9998639a65 BT keeps on asking me if I want to allow car to do stuff
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
2013-10-11 12:15:19 -07:00
Edward Jee
46c746551f Once the user allows PBAP phonebook access, do not ask again.
Bug: 9876209
Change-Id: I8d9dcfa03e8d85577af4c4664fa34b3830e3d8f6
2013-09-23 15:21:27 -07:00
Kim Schulz
5d2595f051 MAP 1.1 Review fixes
- 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
2013-09-13 15:44:26 -07:00
Andre Eisenbach
79f3384eaa LE: Add support for the HID-over-GATT profile (3/3)
bug:8330048
Change-Id: I0999c3af999939aec88eba4c38bca4358c554e69
2013-08-15 15:21:27 -07:00
Maggie Benthall
cd3eb97ce5 Merge "Fix bug when sharing to bluetooth." into klp-dev 2013-08-13 17:00:25 +00:00
Maggie Benthall
3343d1aabb Fix bug when sharing to bluetooth.
Bug:10259347
Change-Id: I860a758333947c4207d7acda41e43b8bd1d671df
2013-08-12 18:40:45 -04:00
Matthew Xie
5b5b1e39dd Bluetooth MAP profile - sms and mms support initial check-in
bug:10116530

Change-Id: I3f50e66420e53bf21a1ecba06aed6b8261ff3064
2013-08-09 15:47:10 -07: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
Jake Hamby
18c4317b93 Show correct A2DP connection status in Bluetooth settings.
When BluetoothSettings is entered via QuickSettings while an A2DP
device is connected, we aren't showing the device connection
status in the UI, because the device list is created before we've
connected to the A2DP and Headset profile services, and we weren't
refreshing the device list UI after getting the callback for
onServiceConnected() and retrieving the list of connected devices.

Add a line to HeadsetServiceListener.onServiceConnected() to call
device.refresh() after we call device.onProfileStateChanged() to
refresh the device list UI. Also copy the logic into A2dpProfile's
onServiceConnected() callback so it will refresh the UI for any
connected A2DP devices.

The reason this bug doesn't show up when entering BT settings
from the main Settings screen is because the onServiceConnected()
callbacks happen before the device list is initialized, so the
UI items are created with the correct connection status. For the
same reason, the bug doesn't occur if the Settings app is already
running and we re-enter it via Bluetooth QuickSettings.

Bug: 8724247
Change-Id: I1a993636ecab18dd6e980e3b4d2485bbed256d74
2013-04-30 13:51:38 -07:00
Fabrice Di Meglio
ae8d5bdc5b Fix bug #8665924 Native arabic numerals in the bluetooth pairing ui
- force LATIN digits for passkey

Change-Id: Ifc7fc746677df4c1e9013ecfe6e9f4887f2d4f1d
2013-04-19 13:50:59 -07: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
Jake Hamby
95c1003f1c Fix Bluetooth enable dialog to match Android style guide.
When an app requests to enable Bluetooth and/or Bluetooth discovery,
we show a dialog for user confirmation. Remove the dialog title,
update the message text and button labels to be more descriptive,
and use the standard dialog layout instead of a custom layout.

Also fixes the button layout on the Bluetooth permission test app so
that the "Discoverable" button doesn't wrap to two lines.

Bug: 6001468
Change-Id: I731e2f31b4c822395fc3f83584a092550d9ae7d3
2012-11-20 18:21:44 -08:00
Eric Laurent
9f4afb0762 fix dock audio enable dialog
The dock audio enable setting is not saved if the user
dismisses the dialog without checking or unchecking the check box.
The dialog is then displayed each time the device is docked until the
user checks/unchecks the dialog or goes to sound settings to enable
or disable dock audio.

Bug 7518165.

Change-Id: Ifbc6179e78b64b5b7577ac750acf9846525e47c5
2012-11-12 14:29:17 -08:00
Eric Laurent
f892bc856c display audio dialog when connecting low end dock
Display a dialog to enable the use of the dock audio connection
when a low end dock is connected for the first time.

Modify DockService to process docked and undocked messages even if
the device indicated is null (meaning the dock is not a bluetooth dock)
only for low end docks.

Bug 7302106.

Change-Id: I331d83a74fecf5f26b24bfc178342df414bd8153
2012-10-30 10:41:46 -07: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
Jake Hamby
904d3726d4 Allow disconnected BT profiles to be unchecked in Settings.
In the Bluetooth profile list, the checkbox indicates whether the
profile is preferred (we should auto connect). If the profile is
not connected, selecting it will try to connect the profile and set
it to preferred. If the profile can't be connected, then the user
could not turn off the preferred setting for the profile.

Change the behavior so that when a profile is not connected,
but is marked as preferred, selecting the profile will turn off the
preferred setting (no auto connect) instead of trying to connect.
This enables the user to turn off auto connect for a profile when
it can't be connected. Tapping a second time will try to connect
the profile and set it as preferred, as usual.

Also change PanProfile to return the current connection status for
isPreferred() instead of always returning true. Currently, the
PAN profile is always checked, which is confusing because it looks
like PAN is always connected. Also, because of the new behavior
when a profile is selected, it's now necessary to return false for
isPreferred() when PAN isn't connected, so that we will try to
connect when the user selects it, instead of trying to turn off
the preferred setting, which isn't supported for PAN.

Bug: 7007641
Change-Id: Ifb0f51a15379bc254933168c43bdfc8b22f26051
2012-10-04 17:42:38 -07:00