Commit Graph

7 Commits

Author SHA1 Message Date
jeffreyhuang
4824ff3d00 Move bluetooth test package to sdk 26
Test: make RunSettingsRoboTests -j40
Change-Id: I26e6f437052caafd97f3f164b388d379fc890e7e
2017-11-27 15:42:25 -08:00
Maurice Lam
e18902ec67 Update Robolectric to 3.4.2
Bug: 66693279
Test: m RunSettingsRoboTests
      m RunSettingsRoboTests-jacoco
Change-Id: I9df619c3d68f0af2ee2ae944a15998275129f7c2
2017-09-22 18:34:00 +00:00
Antony Sargent
c626fcc028 Fix Bluetooth switch status in Connected devices screen
The symptom observed is that the Bluetooth master switch on the
Connected devices page doesn't properly respond to Bluetooth turning off
via quicksettings - either turning on airplane mode or just toggling
Bluetooth.

The root cause was that MasterSwitchPreference's isChecked method would
not return the true value of whether the switch was checked - if the
control is disabled, it always just returns false. This interacts badly
with code in BluetoothEnabler - we disable the switch when the Bluetooth
state is in transition (eg becomes STATE_TURNING_OFF), and we also
attempt to avoid calling setChecked if the switch is already in the
desired state. So the switch would be checked but disabled, and we'd
avoid ever calling setChecked(false) on it.

A thorough fix would be to remove the code from MasterSwitchPreference's
isChecked method that looks at the enabled state, since enabled and
checked really should be treated as separate concerns. But given the
timeframe of MR1, we're opting for a more conservative fix of directly
accessing the switch and checking it's state, to avoid introducing bugs
in other consumers that might be depending on the current
behavior. We'll then do the thorough fix on the master branch which will
give a lot more time for any unexpected issues to be found (I audited
other usages and none seemed likely to be a problem, but it's better to
be safe than sorry).

Change-Id: I19a6c6b71e74595be3ef32a9718a430b67a89d53
Bug: 64940731
Test: make RunSettingsRoboTests
2017-09-05 17:10:30 +00:00
phweiss
df4bb2a84f Bluetooth Settings Policy Transparency
If handleStateChanged() is called after
maybeEnforceRestriction, the disabled switch will be
enabled again, only to be disabled when the user touches it.

Bug: 37737621
Test: make RunSettingsRoboTests -j40 ROBOTEST_FILTER=*BluetoothEnablerTest

Change-Id: I3086806dfd6d911d6d7fca1f1d30fa7d8b8757d1
2017-07-13 18:47:30 +02: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
Lenka Trochtova
479d197196 Check for user restrictions disallowing BT in BluetoothEnabler.
Test: make RunSettingsRoboTests -j40
Test: manual

BUG: 35596982
BUG: 32895313

Change-Id: Ie8f53b665a4aad4e6b17b20602cbe5502998d7a2
2017-04-13 10:52:26 +02:00
Doris Ling
133b096288 Add logging to Bluetooth settings.
- Add logging when users selects the listed devices to connect or
disconnect, and when connection error is shown
- Update the event for the top level bluetooth master switch toggle to
have its own event.

Change-Id: I58f21256fdd07fad9d733ff987ff38df1148f4f8
Fix: 35065258
Test: make RunSettingsRoboTests
2017-03-09 18:14:30 -08:00