Commit Graph

25 Commits

Author SHA1 Message Date
hughchen
14e0fe2707 Put newly discovered devices to the bottom of the list
Add two type SortType.TYPE_DEFAULT and SortType.TYPE_FIFO in BluetoothDevicePreference.
It needs to decide the sort type when you create the BluetoothDevicePreference.
TYPE_DEFAULT - According to the CacheBluetoothDevice state to sort
TYPE_FIFO - According to the timestamp to sort

Bug: 112546918
Test: make -j42 RunSettingsRoboTests
Change-Id: Icd25d9b76a44d5a105f8daf64e5bc1f9ead8cd92
2019-07-24 15:27:17 +08:00
jackqdyulei
36948cefe9 Remove unnecessary notify in BT preference
notifyHierarchyChanged() is used before when we have
connected/disconnect deivce in same list. So only use it in
DevicePickerFragment.java, not other normal fragments.

Also that call will rebuild whole preference list, which is heavy.

Bug: 119479725
Test: Manual
Change-Id: I06cf221588001b38634fec9f02dee8bc1e561ea8
2019-04-01 12:39:24 -07:00
jackqdyulei
a2208c008b Fix broken bluetooth robo tests
Bug: 129159331
Test: RunSettingsRoboTests
Change-Id: I3e64659e59fd9b2ac58bf697116e1ee34928a3cd
2019-03-25 13:15:30 -07:00
Amin Shaikh
9391361438 Move SettingsLib icons to android.
Bug: 122263617
Test: make
Change-Id: Ia2ab06561824656951fbd0019e9c921442c714e1
2019-01-28 13:46:54 -05: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
cdf284b732 Make Settings robotest work with tot Robolectric
Bug: 116278591
Test: make -j RunSettingsRoboTests
Change-Id: I32cb2fcf6094675f79d2fc24702ef6298a9691e4
2018-10-31 17:59:17 -07: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
tmfang
5bd7151413 Migrate all AlertDialogs to AndroidX version
- Let test cases can be compatible with AndroidX AlertDialog.
- Theme of Transparent needs to support AndroidX AlertDialog.

Change-Id: I0789b66f52feef30ebab7fb824d0e39d5ae9cc96
Fixes: 111413092
Test: make RunSettingsRoboTests -j56
2018-07-20 13:38:58 +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
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
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
jeffreyhuang
cbfb099a40 Rename SDK_VERSION_O to SDK_VERSION
Test: make RunSettingsRoboTests -j40
Change-Id: I6715062d8addadda441e32809db1af55f15e3a90
2017-12-05 16:43:54 -08:00
Fan Zhang
dff6dd687e Move away from deprecated FakeFeatureFactory.setupForTest()
Test: rerun
Change-Id: I896ba414315ddb1664c0499264f4992f0554ef98
2017-12-05 10:12:10 -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
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
Jack He
5b017f7b05 Bluetooth: add metrics for pairing with devices without names
* Also caches context in onClick() method

Bug: 34685932
Test: make, unit test
Change-Id: I99beab2c85b8e48c4bc41f69146759d4b7c62428
2017-09-07 12:09:00 -07:00
Jack He
19ba320263 Bluetooth: Only show devices when their names are resolved
* Add a developer menu option to allow name-less devices to be shown
  when a Bluetooth developer needs it, but hide it for non-developer
  users.
* Set BluetoothDevicePreference to invisible when CachedBluetoothDevice
  does not have a name besides MAC address and the above developer option
  is false.
* This affects BluetoothPairingDetail and DevicePickerFragment, but does
  not affect BluetoothSettings. BluetoothSettings will show all paired
  devices regardless whether an user friendly name exists.

Bug: 34685932
Test: pair Bluetooth device, send file over Bluetooth, unit tests
Change-Id: Idd7ad4b1671dfdcf3204efb50eddb6dae1065aa5
2017-08-25 16:27:30 -07:00
jackqdyulei
7661137981 Add battery indicator to bluetooth icon
This cl change util method in bluetooth package to return
drawable instead of resId.

If the bt device has battery level, then method return customized
layerDrawable, otherwise return a simple drawable created from
resId.

Bug: 63393322
Test: RunSettingsRoboTests

Change-Id: Ib21822eafda0e8570212ce5cb070478e4f4876a2
Merged-In: Ib21822eafda0e8570212ce5cb070478e4f4876a2
2017-08-24 16:53:01 -07:00
Antony Sargent
64fab6f4cd Switch to using gray icon for Bluetooth imaging devices
All the other Bluetooth icons were switched to gray at some point in the
past, but we must have missed this one.

Bug: 63858978
Test: make RunSettingsRoboTests
Change-Id: I2ebefa42f3ecff8ae6d58f4bdb22dce39ae4dbd4
2017-07-20 09:54:29 -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
Fan Zhang
00d8ff5d6e Revert "Revert "Convert BT preference to use TwoTargetPreference""
This reverts commit 457c3cbec2.

Revert with fix/test.
The fix is that we removed DevicePickerFragment#initDevicePreference(),
which incorrectly set a useless widget on preference, and removes the
gear icon from preference, preventing bind() call to go through

Change-Id: Ia70cdb51d13cca6035a4e7fe8008d195f7f00c6e
Fix: 36511169
Test: runtest --path tests/app/src/com/android/settings/bluetooth/DevicePickerActivityTest.java
2017-04-11 09:45:27 -07:00
Doris Ling
457c3cbec2 Revert "Convert BT preference to use TwoTargetPreference"
This reverts commit 09c7f15b12.

Change-Id: I29aa67f026c0b54da08b19657f9916275e5a3459
2017-03-28 20:03:10 +00:00
Fan Zhang
09c7f15b12 Convert BT preference to use TwoTargetPreference
Change-Id: I0b49af4afb4b782a6057060b2666f6528bc003b2
Fix: 36511169
Test: make RunSettingsRoboTests
2017-03-22 16:03:45 -07: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