Commit Graph

21 Commits

Author SHA1 Message Date
jasonwshsu
723c385c18 [Pair hearing devices] Extract common behavior in BluetoothPairingDetail into Base class
* Before adding new hearing device feature, we will extract the common part into Base class first. They will share most of the UI component.

Bug: 237625815
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDevicePairingDetailBaseTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDevicePairingDetailTest
Change-Id: I3a44c4c464d630fdcafa151afc82d3000fd728a3
2023-02-09 10:17:25 +08:00
Chienyuan
84a9b23ba8 Show identity address in the bluetooth details page
Bug: 197044261
Test: build pass
Change-Id: Ic1ef1d575f35c4b37d6f9195ec10dd31ed5bdd5b
2022-02-08 11:29:03 +00:00
Hugh Chen
db53d1c6f8 Fix borken test on Bluetooth and connected package
Bug: 187239965
Test: make RunSettingsRoboTests -j56
Change-Id: Ic0d60a6cd46b1211efb2021f079c0b0a6534b383
2021-05-05 14:31:01 +08:00
hughchen
e45897b462 Fix BTHS is still in pairing list after BTHS is connected
This CL uses onProfileConnectionStateChanged() to handle
the case that bonded device is connected in pairing list.

1. Finish BluetoothPairingDetail page if the bonded device is connected
and selected.
2. Remove the devices in BluetoothPairingDetail page if the device is
connected.

Bug: 142519901
Test: make -j42 RunSettingsRoboTests
Change-Id: I51a9f2ebc0b491edb8ea026ff62ec20ae91eee1d
2019-10-29 02:35:04 +00:00
James Lemieux
f1dade40d2 Use binary resource support in robolectric
The resources available to tests are now exactly the merged resources
located in the APK under test.

Bug: 74359828
Test: make -j56 RunSettingsRoboTests
Change-Id: I050db81a92decefea23314b5ec7a62f77ff4bb2b
2018-12-12 19:53:49 -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
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
James Lemieux
22a39c2b93 Use external/robolectric-shadows/run_robotests.mk
This allows Settings to test against the latest framework changes.

Also replaced TestConfig with traditional robolectric.properties.

Bug: 73173204
Bug: 73892008
Test: make -j56 RunSettingsRoboTests
Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7
2018-03-04 03:50:08 -08:00
jeffreyhuang
cbfb099a40 Rename SDK_VERSION_O to SDK_VERSION
Test: make RunSettingsRoboTests -j40
Change-Id: I6715062d8addadda441e32809db1af55f15e3a90
2017-12-05 16:43:54 -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
jeffreyhuang
4824ff3d00 Move bluetooth test package to sdk 26
Test: make RunSettingsRoboTests -j40
Change-Id: I26e6f437052caafd97f3f164b388d379fc890e7e
2017-11-27 15:42:25 -08: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
Andrew Sapperstein
9f1e911759 Refactor test runner to use static list of resource paths
Previously everything lived in an inner class method of
SettingsRobolectricTestRunner. That method has now been turned into
a static method so that it can be called by other runners.

Bug: 62460102
Test: robotests
Change-Id: I6612b1f26404587301c534c8ba60e39d59d6c840
2017-06-09 09:21:26 -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