Commit Graph

32 Commits

Author SHA1 Message Date
Haijie Hong
15a9f1437d Clean up legacy bluetooth setting flags
BUG: 359415806
Test: atest SettingsRoboTests
Flag: EXEMPT clean up
Change-Id: I7c47d80e61cfb0e3b473106e0784cc96ba639452
2024-08-20 15:38:32 +08:00
Angela Wang
711d0b269c Rename CachedBluetoothDevice.getConnectableProfiles()
The original method name implied that the returned profiles were guaranteed to be connectable. However, it actually filters profiles based on user can access the profile in the UI and initiate the connection. Change the method name to getUiAccessibleProfiles() aligns the name with the actual behavior.

Flag: EXEMPT simple renaming
Bug: 356530795
Test: m
Change-Id: Ib7d29a4bf9c213ddcecc567864583165ab97a099
2024-08-05 07:14:15 +00:00
Angela Wang
a8297a313b Fix LE Audio toggle missing issue for dual mode hearing device
After the code change of ag/28283226, they hide the LE Audio toggle for
LE Audio only device since turning off the profile may cause this device
no functioning. But the dual mode hearing devices(LE Audio + Asha) are
wrongly recognized as LE Audio only devices since
HearingAidProfile.accessProfileEnabled() return false. This make the
users lost the ability to switch between profiles they preferred.

Make HearingAidProfile.accessProfileEnabled() return true and hide the
Hearing Aid toggle by default since it's also meaningless to turn off
the Asha profile for Asha-only devices.

Flag: com.android.settingslib.flags.asha_profile_access_profile_enabled_true
Bug: 356530795
Test: manual checking the UI
Test: atest BluetoothDetailsProfilesControllerTest
Change-Id: Ica350b4c16c1b07945399bfee1038f7b0824baed
2024-08-02 07:11:25 +00:00
Haijie Hong
bfcd25edca Check all member devices to determine whether it's LeAudio-only device
Bug: 352431349
Test: atest BluetoothDetailsProfilesControllerTest
Flag: com.android.settings.flags.hide_le_audio_toggle_for_le_audio_only_device
Change-Id: I3697b4f3abf5f789100b63f0b7a01c3b78d70a7f
2024-07-12 13:09:36 +08:00
Haijie Hong
0307bbfb1f Hide LeAudio toggle for LeAudio-only device
Bug: 333827147
Test: atest BluetoothDetailsProfilesControllerTest
Change-Id: Ie446d8866fb51972795b66aac2db84703ef51b84
2024-04-17 16:12:42 +08:00
Haijie Hong
82688cc1d3 Add bluetooth profile toggle visibility checker
Bug: 321178209
Test: atest BluetoothDetailsProfilesControllerTest
Change-Id: Ic6c040a5a500d51945893061623526271eba94c7
2024-01-22 17:32:09 +08:00
chelseahao
74b85e4247 Show toggle summary for LE audio toggle only when the device is not in the allowlist.
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDetailsProfilesControllerTest
Change-Id: I68040e7e92630f6efac0e1fb0f35a39ebca3cfad
2023-10-12 09:39:08 +00:00
Chaohui Wang
2541381259 Fix references to resources for Settings
Bug: 293810334
Test: m Settings
Change-Id: Ie140278f492ef7e1c062ec1ecae2866c521a86aa
2023-08-08 01:56:05 +00:00
Tsung-Mao Fang
ff810c3a8a Ignore broken tests
Bug: 216213206
Test: run robo test
Change-Id: I4538465480595524f5d49861f822572842f503ae
2022-01-25 12:21:42 +08:00
hughchen
1df322225b Add bottom padding of profile group on Bluetooth detail page
- This CL add a bottom padding preference to make UI consistency.
- Update test case

Bug: 146522686
Test: make -j42 RunSettingsRoboTests
Change-Id: I525d8a3b71535972755de92924a3c04768f68e63
2020-05-18 13:17:15 +08:00
hughchen
eba97c8ce6 Update profile api
The profile will auto connect / disconnect when set enable / disable
profile. This CL remove connect / disconnect method.

Bug: 141582844
Test: make -j42 RunSettingsRoboTests
Change-Id: Ib875d126be0d8483fb539e7ba950242a4f38cf81
2020-02-05 16:04:36 +08:00
hughchen
cfca56fef1 Update Bluetooth api
This CL is used to update Bluetooth api.

- Use BluetoothProfile.CONNECTION_POLICY_ALLOWED instead of
  BluetoothProfile.PRIORITY_ON
- Use BluetoothProfile.CONNECTION_POLICY_FORBIDDEN instead of
  BluetoothProfile.PRIORITY_OFF

Fixes: 141582844
Test: manually
Change-Id: I527813e38583a4e4a1489090e8a17c6bd50c3e81
2019-12-10 11:21:16 +00:00
jackqdyulei
715408e592 Add intent action for BT device detail page
Also update detail page to accept cold start:
1. Check whether profile is ready
2. When it is ready, refresh UI

Bug: 123665527
Test: SettingsRoboTests
Change-Id: I39382fd97e9da46fca08cd2e4a3ef15d32703664
2019-02-11 13:48:16 -08: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
Leon Liao
1f1671ca28 Merge "Rename isConnectable()" am: ec65174f11 am: 09385137e3
am: af7aed6d79

Change-Id: I5b0a11396ccce092778b6cfda444f52cfd469525
2018-09-26 06:25:41 -07:00
Leon Liao
09385137e3 Merge "Rename isConnectable()"
am: ec65174f11

Change-Id: Ibfc536ba78a118bc33890e52efa6650b21bff62e
2018-09-26 05:59:20 -07:00
Leon Liao
6786e32a73 Rename isConnectable()
LocalBluetoothProfile.isConnectable() checks whether the user can initiate a connection
for a specific profile, not really whether the profile is connectable.

Change-Id: If6c6cd1554acf35db2460ea6ddb65148a7e86e45
Bug: 79982487
Test: atest tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsProfilesControllerTest.java
2018-09-20 09:23:30 +08:00
Fan Zhang
de117046ad DO NOT MERGE Import clean up.
Reordered all imports according to Android codestyle.

Test: rebuild
Change-Id: I750f01f70f2114d51838bf652833aebdc4065c98
2018-09-04 13:54:46 -07:00
Aurimas Liutikas
03fcde338b Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
Merged-In: I941dea40562170649bf056e675cc32e5163c0e39
(cherry picked from commit a290b873d0)
(cherry picked from commit b1af85d155)
2018-08-28 16:35:52 -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
Aurimas Liutikas
b1af85d155 Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
Merged-In: I941dea40562170649bf056e675cc32e5163c0e39
(cherry picked from commit a290b873d0)
2018-08-28 11:48:56 -07:00
hughchen
ab1bc299d8 Use BluetoothDevice.ACCESS_* instead of CachedBluetoothDevice.ACCESS_*
1. Use BluetoothDevice.ACCESS_* instead of CachedBluetoothDevice.ACCESS_*
2. Use BluetoothDevice.setPhonebookAccessPermission() directly.
3. Use BluetoothDevice.setMessageAccessPermission() directly.
4. Use BluetoothDevice.getPhonebookAccessPermission() directly.
5. Use BluetoothDevice.getMessageAccessPermission() directly.
6. Use BluetoothDevice.getSimAccessPermission() directly.

Bug: 112517004
Test: make -j42 RunSettingsRoboTests
Change-Id: Ibe6b207b891b9bd2b328a2e2c7264a9a78cb498f
2018-08-23 11:27:49 +08:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Ryan Lin
440e08faf5 Merge "Implement getProfileId() method in the subclass" into pi-dev am: 0a87e54edb
am: 325b292eb6

Change-Id: Ia68e70ba6ebffa2df20c9b0b909abfaf9d7250e2
2018-05-11 15:25:02 -07:00
ryanywlin
ef301823d3 Implement getProfileId() method in the subclass
Add getProfileId() method in LocalBluetoothProfile interface,
implement this method in subclass.

Bug: 76447449
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDetailsProfilesControllerTest -j28
Change-Id: I8082716b7cdaf7394ee2f8a4b636058716af7bb1
2018-05-11 20:25:13 +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
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
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
Jack He
04f5967c95 Bluetooth: Use string in remote device summary
* Use String in connected device summary instead of resource id
* This allows dynamic strings to be built by CachedBluetoothDevice
  such as ones involve battery level percentages

Bug: 35874078
Test: make, unit test, test with Bluetooth devices
Change-Id: I583eac73280ca17387b215a4e7095e27de399998
2017-07-06 01:22:35 +00: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
Antony Sargent
04a3b2199e Add a new Bluetooth device details page
Bug: 35877479
Test: make RunSettingsRoboTests

The existing behavior is to bring up a dialog with Bluetooth device
details with checkboxes for each supported profile. This adds a new page
that serves the same purpose with a switch for each profile and a footer
containing the MAC address.

Whether to use the new page or old dialog is controlled by a flag
accessible via BluetoothFeatureProvider.

Change-Id: I026c363d4cd33932a84017a67cbef51c258bad10
2017-06-05 11:17:06 -07:00