Commit Graph

26 Commits

Author SHA1 Message Date
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Fan Zhang
c21f4a512a Merge "Sort imports" 2018-08-29 00:19:53 +00:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Ash_Chen
8f7092a15e Show bonded devices in "Pair new device"(2/2)
Some users forgot they had paired devices and couldn't see their BT device
when they search device in "Pair new device". (b/80382940, b/80133137).
Need to change the behavior to let paired devices can be shown on "Available devices".

Bug: 111738593
Test: Bluetooth Pairing Test
Change-Id: Ib499785abaa8e4efc1875be113ac87bdbe0c89ba
2018-08-28 11:39:38 +08:00
hughchen
e94b02206e Use BluetoothAdapter instead of LocalBluetoothAdapter
LocalBluetoothAdapter only has a few APIs that is not supported
by BluetoothAdapter, and lots of LocalBluetoothAdapter function
pass parameter to BluetoothAdapter directly.
Do the refactor in Settings, use BluetoothAdapter instead of
LocalBluetoothAdapter.

Bug: 111769754
Test: make -j42 RunSettingsRoboTests
Change-Id: I88e5a8377b5d1106c7679e6a8c3fd1ca1a80ea6f
2018-07-31 11:35:36 +08:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
hughchen
3051845840 Shown toast when BT turned on
* Shown "Bluetooth turned on" toast only when BT turned on in "Pair new device"
* Add test to verify shown toast function can be called when BT turned on.

Bug: 79383997
Test: make -j42 RunSettingsRoboTests ROBOTEST_FILTER=BluetoothPairingDetailTest
Change-Id: I25f75aaa04063d9ef8a0df4bb06aeaa70d7ac146
2018-05-31 11:03:37 +08:00
hughchen
fc6030983f Merge "Add Rename device on Bluetooth screen" into pi-dev am: 667cbc5846
am: 5783578aad

Change-Id: Ibc9a0adc76de9c411391d612238fa39d42d1ddc3
2018-05-17 02:17:55 -07:00
hughchen
211d49f28c Add “Rename device” on Bluetooth screen
* Add BluetoothDeviceRenamePreferenceController in bluetooth_screen.xml
* Refactor BluetoothDeviceRenamePreferenceController and BluetoothDeviceNamePreferenceController.
  Let these controllers can be init in xml.

Bug: 78247352
Test: make -j50 RunSettingsRoboTests
Change-Id: Iddd0cac1e973bbd82cb30fe4c18e8b359ba4ba2b
2018-05-11 16:14:43 +08:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Jyun LuoLai
e05884564e Modify connectivty related strings
Change-Id: I971c5f68ff3d881ad0285f87ab868a204edc9b7f
Fixes: 73960246
Test: Manual test & make RunSettingsRoboTests
2018-03-20 09:45:09 +08:00
Weilun Du
d4e1b94b58 Disable bluetooth controller if unsupported
Only disable the controllers not the whole fragment because
user might need to have entry for other features.

Fixes: 73664409
Merged-In: I98ed248cf33d11715dd523e711cbc68ebf128ef8
Change-Id: I98ed248cf33d11715dd523e711cbc68ebf128ef8
Signed-off-by: Weilun Du <wdu@google.com>
(cherry picked from commit 68a195ae93)
2018-03-09 23:40:40 +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
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
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
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
Antony Sargent
d9456d807b Merge "Stay discoverable in Bluetooth settings and pairing pages" into oc-dr1-dev am: 49cd8f2327
am: 0fe460a8e3

Change-Id: I000eba2d8266b3d86f08c336f4ae3217ae48b8ac
2017-08-10 07:28:51 +00:00
Antony Sargent
c86440538f Stay discoverable in Bluetooth settings and pairing pages
There are two problems with the Bluetooth settings and pairing pages
that are fixed by this CL:

(1) We advertise on the page that the local device is visible to other
devices, but that only lasts for the length of the default timeout (120
seconds) for the local adapter being in discoverable mode.

(2) Both the BluetoothSettings and BluetoothPairingDetail fragments
enter discoverable mode in their onStart handler and exit it in their
onStop handler. Unfortunately when doing a fragment navigation the
onStart and onStop events interleave in a non-intuitive manner. When you
go from BluetoothSettings to BluetoothPairingDetail, we see the onStop
event for BluetoothSettings *after* the onStart event for
BluetoothPairingDetail, and similarly when going back from
BluetoothSettings to BluetoothPairingDetail. What this means in practice
is that if you go to the BluetoothSettings page, the device will be
discoverable, but once you navigate to BluetoothPairingDetail or back
again you won't be discoverable again until you go somewhere else or end
the settings activity.

This CL adds a new object called AlwaysDiscoverable which can be used to
start and stop a mode of "always being discoverable". While started, it
will listen for changes to the discoverable state, and return to
discoverable mode. This fixes (1) by returning to discoverable mode
whenever the normal timeout expires, and (2) similary by returning to
discoverable mode when we accidentally exit it due to the onStop/onStart
mismatch.

A better fix for (2) would be to avoid the "glitch" of briefly exiting
discoverable mode only to re-enter it, but the implementation of that is
a little more complicated so that's being left as future work in order
to keep this CL as small as possible.

Bug: 64130265
Test: make RunSettingsRoboTests
Change-Id: I559dd8187263ea6a0008be1a8abdfffac97cb87a
2017-08-09 22:10:40 -07:00
Fan Zhang
7b9568c10d UI refresh on bluetooth list page
- xml layout clean up
- add "Device name" preference, tapping will bring up rename dialog
- Remove tap target from original device_name pref

Merged-In: I6e9764dbb6c51f94be6d6a61d5a6401141407409
Change-Id: I9cb67cc557a9b932d7cf795a8d4a6fb5215c4365
Fix: 62890841
Fix: 62891178
Test: robotests
2017-07-13 11:08:18 -07:00
Fan Zhang
f57e167375 UI refresh on bluetooth list page
- xml layout clean up
- add "Device name" preference, tapping will bring up rename dialog
- Remove tap target from original device_name pref

Change-Id: I6e9764dbb6c51f94be6d6a61d5a6401141407409
Bug: 62890841
Bug: 62891178
Test: robotests
2017-07-12 13:24:25 -07:00
Jack He
549d864bbf Merge "Bluetooth: mLocalAdapter should never be null" into oc-dr1-dev am: 86fd147ac6
am: 99eab3d5f9

Change-Id: I7c78e818010bb513dd2ac1d65baa00f4159073b1
2017-07-11 21:26:09 +00:00
Jack He
a4503c5b8b Bluetooth: mLocalAdapter should never be null
* mLocalAdapter should never be null
* We should crash if it is ever null

Bug: 63442969
Test: make, pair Bluetooth device
Change-Id: If98f9ea0762927eb57d00224b62abf24bbec69ba
2017-07-11 12:04:01 -07:00
Tony Mantler
1d583e125f Make PreferenceController a mixin
Bug: 62912136
Test: Existing tests in BaseSearchIndexProviderTest
Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
2017-06-26 10:58:36 -07:00
jackqdyulei
9b3d2d3ea4 Use BLUETOOTH_PAIRING metric in pairing page
Bug: 38383542
Test: Build
Change-Id: Ibc8acfa7ad7766b112389509971a36d1a4ce2394
2017-06-19 13:19:23 -07:00
Jack He
c11af01481 Bluetooth: Always scan while on pairing or DevicePicker page
* Modified DeviceListPreferenceFragment to have enable/disable scanning
  methods. In ENABLE state, each onScanningStateChanged(false) will
  restart another round of scanning
* Subclasses of DeviceListPreferenceFragment should call enable/disable
  scanning when scanning is needed for long period of time
* Currently, BluetoothPairingDetail and DevicePickerFragment call
  enableScanning() when Bluetooth is turned ON and call disableScanning
  when some device is picked in their lists
* Both BluetoothPairingDetail and DevicePickerFragment will re-enable
  scanning if pairing failed for selected device
* Added associated unit tests as well

Bug: 32172815
Test: make, pair Bluetooth device, send file over Bluetooth Opp
Change-Id: I99325e06aadd7b00e7a7ba6d6c282a6831859d8b
2017-06-05 12:13:46 -07:00
jackqdyulei
52ccb49fbe Split BluetoothSettings into two pages
This cl splits the BluetoothSettings into paired device page and
pairing page, including small changes about:
1. Refactor the pages so they could get as much as static preference
from xml file rather than dynamically add/remove them everytime.
2. Remove creating method in BluetoothDeviceNamePreferenceController
and add it in xml file
3. Create BluetoothPairingDetail page, basically move the logic from
BluetoothSettings.
4. Make pairing preference clickable and jump to BluetoothPairingDetail
5. Add and update bunch of tests

Bug: 35877041
Test: RunSettingsRoboTests
Change-Id: Ief9e9690c612f7b46c58e866e5cecc511af642c8
2017-05-22 16:57:37 -07:00