Commit Graph

772 Commits

Author SHA1 Message Date
Fan Zhang
906572b127 Change PreferenceController#getSummary return type.
Return CharSequence instead of String.

All user visible string should be modeled as CharSequence.

Bug: 73950519
Test: robotest
Change-Id: I30befef0c33f94351d4a2774e283bd1ed804aa8b
2018-02-27 22:30:12 -08:00
TreeHugger Robot
572efd22dd Merge "More renaming in DashboardFragment" 2018-02-24 02:58:32 +00:00
TreeHugger Robot
a0de28d0de Merge "Update the Bluetooth Active Device state in the Device Manager" 2018-02-24 01:07:45 +00:00
Fan Zhang
f7843adabd More renaming in DashboardFragment
getPreferenceControllers() -> createPreferenceControllers() for the same
reason as in ag/3647936

Bug: 73668763
Test: robotests
Change-Id: I97670a91a2a38d1c844d1b9d37f4222c5e6f45a0
2018-02-23 16:56:30 -08:00
Fan Zhang
917f101899 Instantiate pref controllers from xml if it's defined.
- If a <preference> tag also defines a controller, we will try to
  instantiate it before displaying the UI. The same logic is shared by
  BaseSearchIndexProvider so it also drives search suppression.

- If user also defines a list of controllers programatically, the
  programatically created ones takes precedence.

Bug: 73668763
Test: WIP
Change-Id: I7aecec270bcd3af261e012ef1f6995d2a523cfa1
2018-02-23 14:08:51 -08:00
Pavlin Radoslavov
c7715a5519 Update the Bluetooth Active Device state in the Device Manager
The Bluetooth Active Device state should be updated for all
CachedBluetoothDevice entries.
This should be done inside CachedBluetoothDeviceManager in SettingsLib
instead of BluetoothDeviceUpdater in the Settings app.

Bug: 72316092
Test: Manual - two headsets and switching the active device
Change-Id: If379bb0853dcd78385430cf14192e9adfae4ecd0
2018-02-23 12:32:23 -08:00
Fan Zhang
be45f9c865 Migrate more settings to SubSettingsLauncher
Bug: 73250851
Test: robotests
Change-Id: I4100bef20e2ed477e4e31c9b7816f1b03f3f2809
2018-02-19 13:36:57 -08:00
Fan Zhang
7cf99f5f12 Migrate more settings to use SubSettingsLauncher
Bug: 73250851
Test: robotests
Change-Id: I08f6f380489646231d6d8ceb1488e2efb036bf69
2018-02-18 21:10:03 -08:00
Fan Zhang
615563db0c Migrate more subsetting launching to SubSettingLauncher
Bug: 73250851
Test: robotests
Change-Id: Ic0bf23f6ac6f717bdd3d477fdb84af68badae8e6
2018-02-15 15:39:56 -08:00
Pavlin Radoslavov
8124a32890 Merge "Updated the Bluetooth Settings owners list" am: 5a56c31913 am: b1230be1b8
am: ab399887b9

Change-Id: Ie5a17a94f9221097339eb37c327607a9417c8373
2018-01-27 00:16:29 +00:00
Treehugger Robot
5a56c31913 Merge "Updated the Bluetooth Settings owners list" 2018-01-26 23:01:43 +00:00
Pavlin Radoslavov
221ba22546 Updated the Bluetooth Settings owners list
Test: None
Change-Id: I94a11d51b6c7691f7e84e8afe71c7c8083255ef0
2018-01-26 13:28:29 -08:00
Pavlin Radoslavov
ddf48e3962 Add Settings support for Bluetooth Multi-A2DP and Multi-HFP
Test: Code compilation
Bug: 64767509

[NOTE: The cherry-pick removed changes to non-existent code and log
message description that doesn't apply here.]

Change-Id: Iee76286110ed87703d6a968f50273c22cd7c7086
Merged-In: Iee76286110ed87703d6a968f50273c22cd7c7086
(cherry picked from commit 4b796e5d2e)
2018-01-26 11:16:23 -08:00
Leif Wilden
90d1392e65 Merge "Migrate to use instrumentation classes from settingslib." 2018-01-25 00:35:26 +00:00
Leif Hendrik Wilden
28dee1f086 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: I70a6e76cc8440547746ecc008c32bd06a7de8161
2018-01-24 12:30:39 -08:00
Daniel Nishi
a633b39cfa Add device name to About Phone page.
The device name is reflected in three places: A Settings.Global flag
which can be read by third party apps, the Bluetooth device name, and
the Wi-Fi tethering hotspot name.

The Bluetooth and Wi-Fi names can be changed independently of the device
name, but if the user sets the device name, they are all changed in
parallel.

Due to the naming restrictions of Bluetooth devices and SSIDs, the SSID
naming restrictions apply to the device name.

Bug: 63819909
Test: Robotest
Change-Id: I3a81535fc07d183557a6fa5d54baef3c7868499c
2018-01-24 11:35:30 -08:00
TreeHugger Robot
e3f187a4a9 Merge "Revert "Migrate to use instrumentation classes from settingslib."" 2018-01-23 01:58:18 +00:00
Pavlin Radoslavov
4b796e5d2e Add Settings support for Bluetooth Multi-A2DP and Multi-HFP
When there are multiple connected A2DP/HFP devices, if a connected
device's name is clicked on, that device will be chosen as
Active - i.e., it will be the device chosen for audio out / phone call.

Test: Manual: multiple connected A2DP devices, and selecting each as
      the Active Device.
Bug: 64767509

Change-Id: Iee76286110ed87703d6a968f50273c22cd7c7086
2018-01-22 13:10:50 -08:00
Leif Wilden
cab0ee611d Revert "Migrate to use instrumentation classes from settingslib."
This reverts commit 1546cca529.

Reason for revert: Broke fingerprint setup flow. b/72267201

Change-Id: I8321265ae64732c526325882ddea51080decddf5
2018-01-22 20:57:36 +00:00
Leif Hendrik Wilden
1546cca529 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: Ie5515bb0fe3e621fc7723a9b04ba23e4bfa9c401
2018-01-18 11:13:24 -08:00
jackqdyulei
f2ef447e8e Tweak bluetooth text alignment
1. Remove the placeholder summary so it won't show blank summary
2. Update settings_entity_header to make text center_vertical,
so it could align with the icon.

Bug: 71742145
Test: Screenshot
Change-Id: I185114a4e0c8d996f218075a8633e802fabf3c66
2018-01-17 12:26:21 -08:00
TreeHugger Robot
b8b9b283fe Merge "Merge sub pages for lock/unlock into 1 xml." 2018-01-05 00:36:17 +00:00
Fan Zhang
928ddbe731 Merge sub pages for lock/unlock into 1 xml.
And create PreferenceControllers for each setting

The page is still pretty janky and controllers are invoked manually.
Next CL will clean these up.

Bug: 32953042
Test: TODO
Change-Id: I1d7478324f5de4fdb464d79f89086f7e79c0ee67
2018-01-04 15:02:36 -08:00
Matthew Fritze
c69f73f4d1 Support getDynamicSummary in BasePreferenceController
Adds dynamic summary getter in relevant BasePreferenceControllers.
Preferece controllers that don't have dynamic summaries or which
are not yet BasePreferenceControllers are not changed right now.

Change-Id: I435ccab7758d90515583fd8ca10a9b1ef0c858b9
Fixes: 71514936
Test: robotests
2018-01-04 13:58:01 -08:00
jackqdyulei
6c94769e56 Add summary placeholder for bt preference
Then UI won't be janky(as everything slide down a little bit)

Bug: 63910184
Test: RunSettingsRoboTests
Change-Id: Ie4074694f54af92da52f09d2caaab5490fa73647
2017-12-22 10:25:04 -08:00
Hemant Gupta
6a386dc6c1 Merge "Bluetooth: Add support for PBAP UI preference" am: f689d1aaa7 am: 0b4c0ebbe4
am: 40069b5ee2

Change-Id: I57de94d04d73ed1af24a15b36a73ea0692ad9815
2017-12-13 02:26:01 +00:00
Lei Yu
15b8b27646 Merge changes Ie1f934b4,Ic3b045a6
* changes:
  Create BluetoothSwitchPreference
  Add ConnectedUsbDeviceUpdater
2017-12-13 01:06:14 +00:00
jackqdyulei
be555e2dad Add device name preference in pairing page
Also refactor the preference controller
1. Extend from BasePreferenceController.
2. pass in the preference key. Then it could be reused in different
places with different key.

Bug: 69333961
Test: Screenshot | RunSettingsRoboTests
Change-Id: I773ca022baa326481045c1659565c9a21111200a
2017-12-11 15:52:57 -08:00
jackqdyulei
d055937664 Create BluetoothSwitchPreference
In the new design, bluetooth preference is not MasterSwitchPreference
any more. This cl creates BluetoothSwitchPreference while reuse the
BluetoothEnabler.

Future cl will remove the BluetoothMasterSwitchPreference when P
feature is finalized.

Bug: 69333961
Test: RunSettingsRoboTests
Change-Id: Ie1f934b4e93a6758a1b0cf83bb5098585a635c2a
2017-12-11 13:05:01 -08:00
Hemant Gupta
13197bcc1e Bluetooth: Add support for PBAP UI preference
Usecase:
1) Connect with carkit that supports PBAP/MAP
2) Try to uncheck the checkbox for contact sharing from device sub
   settings menu

Expected Result:
1) DUT should display "Connected (No Media or Phone)"
1) Should be able to disconnect when checkbox moves from selected->unselected,
and carkit should be able to connect when checkbox is selected again

Observation:
1) No UI updates when PBAP/MAP are connected.
2) On unchecking Contact sharing checkbox nothing happens. PBAP connection
   remains active and user is not asked to disconnect profile level connection.

Fix:
Add support for PBAP UI preference in SettingsLib. Also Fix issues related to MAP
profile addition/removal.
Test: Connect from carkit, try disconnecting from sub settings menu by unchecking
Contact Sharing checkbox and check if PBAP is successfully disconnected.

Bug: 35014213
Change-Id: I4981aa063b2541b58ce1d36e3576578cbeb02acc
2017-12-07 09:31:03 +05:30
TreeHugger Robot
b5931a6624 Merge "Add preferences in new connected device page" 2017-12-01 23:00:20 +00:00
jackqdyulei
b79e0d4279 Add preferences in new connected device page
1. Add device preference
2. connection preference

This cl add click action for Add device preference. Action for
connection preference will be added in future cl.

Bug: 69333961
Test: Screenshot | RunSettingsRoboTests
Change-Id: Ifb1afc8371ee45165ea22a7a195a774ba04fdeea
2017-12-01 12:28:15 -08:00
Lei Yu
7e315a937b Merge "Remove the getSwitch() in SwitchWidgetController" 2017-12-01 19:13:56 +00:00
jackqdyulei
9891b74533 Remove the getSwitch() in SwitchWidgetController
IMHO we don't need to expose switch in SwitchWidgetController.
This controller already has enough API to control the switch.

Also rename mSwitchWidget to mSwitchController because it is not a
widget.

Bug: 69973752
Test: test still pass
Change-Id: I0ac247e34468a44109ab26019f1303c814e381f2
2017-11-30 13:58:57 -08:00
Hemant Gupta
0a86571705 Merge "Bluetooth: Give PBAP permission only if device is AUDIO_VIDEO_HANDSFREE" am: b21a10b2ff am: a84a535729
am: cf2557e8f4

Change-Id: I207d63ade137f41a1ac6d6184f019b0a21cffd9d
2017-11-30 17:45:18 +00:00
Hemant Gupta
a84a535729 Merge "Bluetooth: Give PBAP permission only if device is AUDIO_VIDEO_HANDSFREE"
am: b21a10b2ff

Change-Id: Id0378b1c410afcc0566652e3308cd812dcd68470
2017-11-30 17:40:31 +00:00
TreeHugger Robot
4031bc78e4 Merge changes from topic "settings_presubmit_instr_test"
* changes:
  Refactor help menu stuff into a controller
  Fix UniquePreferenceTest
2017-11-30 01:38:33 +00:00
Fan Zhang
e0b0e9f902 Refactor help menu stuff into a controller
This is a clean up to action bar menu item pattern, we will use the same
pattern to build search icon on all pages in a later change.

Bug: 68814716
Test: robotests
Change-Id: Iedd3ec263e8ccb63ed75ec7a95b28c00878b1de4
2017-11-29 15:51:04 -08:00
Hemant Gupta
5b84cfae44 Bluetooth: Give PBAP permission only if device is AUDIO_VIDEO_HANDSFREE
Step by step:
1. Pair and connect with BTHS (e.g. SBH50).
2. Click the settings icon of paired device, and check "Use for" items.
-----------------------------------------------------------------
Expected Result:
After step 2, "Contact sharing" should not be checked.

Actual Result:
After step 2, "Contact sharing" is checked.

Fix:
Set phone book permission as REJECTED if class of Device is
not AUDIO_VIDEO_HANDSFREE

Test: Checked above usecase and issue is not observed

Bug: 64372703
Change-Id: I178a09dd9e76d67c461c4b04d9b2ee0078ed24c9
2017-11-29 20:37:05 +00:00
jackqdyulei
aec5543841 Add preference group for saved devcies.
Currently it only contains bluetooth devices.

Bug: 3240835
Test: RunSettingsRoboTests
Change-Id: Ief102e7174a4c4610dbda6b728419b303ff928f9
2017-11-27 12:56:44 -08:00
jackqdyulei
75ea67c9f4 Update ConnectedDeviceGroupController
Get the PreferenceGroup there and add/remove preference
through the callback

Also add ConnectedBluetoothDeviceUpdater which only filter
the connected device.

Bug: 69333961
Test: RunSettingsRoboTests

Change-Id: Ia2ab6b6708329227929d6fe442df3a8d45bf86f5
2017-11-21 14:44:35 -08:00
jackqdyulei
88579e2558 Add infrastructure for connected device group.
The core thing is to find out a way to update group when devices
(bt device and usb device)are updated.

The infrastructure contains three parts:
1. ConnectedDeviceController
Normal PreferenceController. Get info from sub controller and update
the preferenceGroup.

2. BluetoothDeviceUpdater
Listen to bluetooth callback, decide whether to add/remove devices

3. DevicePreferenceCallback
Interface to add/remove preference. This interface will be used in
ConntectedDeviceController and future SavedDeviceController

Bug: 69333961
Test: RunsettingsRoboTests
Change-Id: I85a9ef216a801d5f0dd1cf0130d53850a68be4bd
2017-11-21 12:46:30 -08:00
jackqdyulei
e6f052e928 Merge "Add owners to setting packages."
am: f82cd59476

Change-Id: Ic7c94f6ba65149cdc799332a0cc5976ff285f16f
2017-11-21 16:41:50 +00:00
jackqdyulei
d6a00cfa3f Add owners to setting packages.
Bug: 65294119
Fixes: 69384604
Test: Build

Change-Id: Ib4fddc1f04087671d8445fd967d4262287e5c4f3
Merged-In: I927052a73f639d0894600611cd5c79293f43ff5e
Merged-In: Ia1eb8155f2d4359d56b0babd474083295ba38a0b
Merged-In: I24ec103ff5013ad416e3dfb1c548acd387b4ba64
Merged-In: If9fddc8b4e2e6d4d7db185ab16063e824323b9a7
Merged-In: I49159950521a013422b1087ea2c3e6cd5151457c
Merged-In: I69af58183c5b89af96c1a8808665fa506a620012
Merged-In: Ie9492f497824cd2b2727dde9d3a48452c72f1084
Merged-In: I2fd0249fd8b555e5ca93c3aec13857e6c74e157c
Merged-In: Id1c2d9233643a18c1e104255a9e2b8b1aaefc44e
Merged-In: Icdcfaaf6cc7a1e1cf77e89a79d0425cab4405ffc
Merged-In: I697528ff260a0f8e54aa1188e35143e668800e7d
Merged-In: I1486782f476acaf1e2e4b66df57869409239986f
Merged-In: I804b50a38c877da80b5ef3251e16029259014152
Merged-In: I39eec9ebc1db2dc14669f27b17624394e25eb47f
Merged-In: I054a6df08046cda1c2f202390ed24839a6b10349
Merged-In: I9da5bd71ed6aa3922a7f2e2ac4729e3247a204ce
Merged-In: I63778c68f1ab9edc36a9e12aa1729f8fd6a5e073
2017-11-20 16:39:59 -08:00
jackqdyulei
76ba0f72e4 Add feature flag for connected device
Add feature flag to toggle connected device between new and old
feature.

ConnectedDeviceDashboardFragment will contain new feature will
ConnectedDeviceDashboardFragment2 will hold old feature.

Bug: 69333961
Test: Build
Change-Id: I0ea932c69dea5242129aab994d5142b1f87fbea0
2017-11-20 15:29:28 -08:00
jackqdyulei
cf1ce05ce5 Decouple BluetoothDevicePreference and DeviceListPreferenceFragment
The BluetoothDevicePreference need to know whether to display with an
invalid name. However pass in the whole fragment is over-killing.

This cl decouple it for several reasons:
1. In P, BluetoothDevicePreference will be used in other fragment.
2. In preference lifecycle from end user side, this flag is constant.

Bug: 69333961
Test: RunSettingsRoboTests
Change-Id: I3dbcd2a4aafa3ead74371534250e5e7c3ee221f7
2017-11-20 10:11:20 -08:00
jeffreyhuang
cb823d5983 Delete DevelopmentSettings.java
- Remove the old DevelopmentSettings
 - Remove references to the feature flag

Fixes: 65522949
Test: make RunSettingsRoboTests -j40
Change-Id: Ie2eb3465127d79a027de6bb58a47bb15e3094f89
2017-11-17 13:52:33 -08:00
Fan Zhang
7020d97545 Fix a NPE when displaying device detail page.
Bug: 68956750
Test: robotests
Change-Id: I1eed4e07ad723ee787a333ae88cd2ced62b3d34f
2017-11-10 17:12:50 -08:00
jackqdyulei
88a4b0b0e5 Move the bluetooth icon logic to settingslib
This cl contains the moving about:
1. Several methods in Bluetooth/Utils.java
2. Bluetooth icon drawables
3. Bluetooth strings
4. Tests

Bug: 65488978
Test: RunSettingslibRoboTests

Change-Id: I682daa3eeb5022beb90a95763c70d19d32d54915
2017-10-25 12:49:59 -07:00
TreeHugger Robot
04d9769c0e Merge "Switch the buttons in bt detail page" 2017-10-20 17:55:37 +00:00