Commit Graph

32 Commits

Author SHA1 Message Date
changbetty
1096417464 [LE Audio] Add LE Audio Devices in Sound Settings
- When connected to the LE Audio Device, it will display "Play XXX on
    LEAduioDeviceName" in Sound Settings.

  - When connected to the LE Audio Device, it will display the LE Audio
    device name in the "Take call on" list for you having a active call(Hands Free).

  - Remove the @Ignore annotation for all the tests and make test
    cases pass.

Bug: 240911615
Bug: 243494881
Test: manual test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AudioOutputSwitchPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=HandsFreeProfileOutputPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=MediaOutputPreferenceControllerTest
Change-Id: I10db59b33623495a9e9933556c78e20d81e405ea
2022-10-14 06:10:52 +00:00
Rahul Sabnis
55b80392e6 Merge "Remove hidden Bluetooth dependencies" am: 2e6f2dcfff am: 19d5264723 am: 99e2c9f2f2
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1989146

Change-Id: I8f23fc7fce504cf863b35d86fa59a2f732ab7fcd
2022-02-16 23:38:17 +00:00
William Escande
a95180f228 Remove hidden Bluetooth dependencies
Bug: 217736913
Test: pre-submit
Change-Id: Ib4e12e8e350ffa08b48f58e8256991d7ed4fa013
2022-02-16 20:00:59 +01: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
timhypeng
a7a73c4c92 Rename MediaOutputSliceConstants to MediaOutputConstants
-Slice is not used and it is better to remove the slice string

Bug: 165772904
Test: build pass
Change-Id: I38b26187f03509d0d9f5cdb8ef30f3f3ef8779d8
2020-12-24 01:07:24 +00:00
timhypeng
3084d063f3 Update OutputSwitcher from MediaOutputSlice to MediaOutputDialog in Settings
-Update entry point at media indicator in volume panel
-Update entry point at remote media slice in volume panel
-Update entry point at remote volume group in Sound Settings
-Update entry point at media output preference in Sound Settings
-Hide Media output dialog when the caller is not active

Bug: 155822415
Test: make -j50 RunSettingsRoboTests
Change-Id: Ib6c86067522925c439f336644e4d027dbae3379c
2020-10-08 16:18:43 +08:00
timhypeng
b5527e329b Fix test case fail
Bug: 160956047
Test: make -j50 RunSettingsRoboTests
Change-Id: Ib975e906aefc44c59a8465a586832d92664f5147
2020-07-13 10:29:11 +08:00
Tim Peng
f392eae213 Update "Play media to" in Sound Settings
-Change string to "Play <APP Label> on"
-Hide it when there is no local playback
-Disable search index
-Add test cases

Bug: 155720628
Test: make -j50 RunSettingsRoboTests
Change-Id: Id104d5b49c069a761e4cf82385bf1225d494c95e
2020-05-08 12:15:11 +08:00
Tim Peng
9d3092cb7f Add zero state in output switcher
-Update visibility of switcher preference in SoundSetting
-Update visibility of indicator slice in Volume Panel
-Add test case

Bug: 152357002
Test: make -j50 RunSettingsRoboTests
Change-Id: I8aa4e960b72f2c3c26ced78153c4ff620a123f40
2020-03-27 12:31:26 +00:00
Tsung-Mao Fang
6a2d48d158 Ignore all failed test cases
Test: Run all robo test
Bug: 144405844
Bug: 144407418
Bug: 144407438
Fix: 144406422
Bug: 144405885
Bug: 144408475

Change-Id: Ia94636632106206b062d35b2ca53a028d0cbc35d
2019-11-13 20:31:01 +08:00
Tim Peng
7b0f887000 Update "Play media to" display rule in SoundSetting
- show under Casting mode
- hide under no connected Bluetooth devices
- update test case

Bug: 131143025
Test: make -j42 RunSettingsRoboTests
Change-Id: I0eac856970043ecd9a1975fbe382241078ece924
2019-04-24 04:23:44 +00:00
timhypeng
abdf739071 Sound + Output Switcher on Sound Setting
1. Show "play media to" item when Previously Connected device is available
2. Click "Play media to" to launch output slice
3. Update test case

Bug: 126475101
Test: make -j50 RunSettingsRoboTests
Change-Id: Id8afd1a2407acb78c11e81d2420ae8c16130a321
2019-03-12 03:07:36 +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
James Lemieux
3a55de44c5 Prepare tests for impending robolectric merge
Some ShadowUserManager function moved into the basic shadow in
robolectric proper and has been removed from the Settings
ShadowUserManager.

Test: make -j56 RunSettingsRoboTests
Change-Id: I38647dae5d16bc79bc7925ca139c9362a2035393
2018-11-20 16:40:57 -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
jackqdyulei
1bf730093c Fix incorrect API invoke for BT profiles
When hearing aid device has been set active, we shouldn't invoke
1. a2dpProfile.setActiveDevice()
2. hfpProfile.setActiveDevice()

Change-Id: Ie13dea041dd98d0cb9d913e1f28574b300095db9
Fixes: 113625278
Test: RunSettingsRoboTests
2018-09-18 15:19:32 -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
hughchen
244c7586f9 Use corresponding profile to get active bluetooth device
- Do not use streamType to decide which active device should return.
  Base on b/80453878 comment#6, the steamType intent will only be sent
  if an action is made on stream volume or a media route is changed:
  For instance when a call to setStreamVolume() or getDeviceForStream() is made.
  It is not broadcast on actual routing changes.
  It should not be used as an indicator that the route changed during a call.
  There is no callback API and the only option is polling with getDeviceForStream().
- Use corresponding profile to get active bluetooth device
  instead of streamType
- Add test to verify the result of findActiveDevice()
  eg:
  1. A2dp device active, hearing aid device not active : return a2dp device
  2. A2dp device not active, hearing aid device not active : return null
  3. hfp device active, hearing aid device not active : return hfp device
  4. hfp device not active, hearing aid device not active : return null

Bug: 80453878
Test: make -j42 RunSettingsRoboTests
Change-Id: I5bd94899a5d508e60ce911da9689b727ad1fc20c
2018-07-13 09:11:04 +00:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
hughchen
a2a26442eb Merge "Update UI when BT device is rename" into pi-dev am: 77d218ab72
am: 3053922340

Change-Id: I86bd3be4f017f5bd80a2308a5b1e99366027a476
2018-05-18 12:27:08 -07:00
TreeHugger Robot
77d218ab72 Merge "Update UI when BT device is rename" into pi-dev 2018-05-18 18:06:17 +00:00
hughchen
b6ac12eed4 Update DialogFragment UI when BT device is add/remove/rename
* Add AudioSwitchCallback() in AudioSwitchPreferenceController.
  This callback is used to notify SoudSettings to update the dialogFragment UI.
* Add UpdatableListPreferenceDialogFragment that updates the available
  options when dialog is shown
* Add test to verify the adapter count when
  onListPreferenceUpdated() is called.

Bug: 77783217
Test: make -j50 RunSettingsRoboTests
Change-Id: I8cac1b30ec50df026f4b7722dd1cd2f69e77a4cb
Merged-In: I8cac1b30ec50df026f4b7722dd1cd2f69e77a4cb
2018-05-17 07:40:52 +00:00
hughchen
615becb392 Update UI when BT device is rename
* Using getAliasName() instead of getName()
* Add BluetoothDevice isConnected check, when BluetoothDevice is
  disconnected. Do not add to the show list.

Bug: 77783217
Test: make -j50 RunSettingsRoboTests
Change-Id: I183fc693eaefd690568ba2f1ec740258b2bb62c8
2018-05-17 11:29:54 +08:00
hughchen
acb6e89c52 Update DialogFragment UI when BT device is add/remove/rename
* For fix the "Automatic merge failed" in pi-dev, cherry pick the ag/3937781 in
  master. Change android.support.* to androidx.*
* Add AudioSwitchCallback() in AudioSwitchPreferenceController.
  This callback is used to notify SoudSettings to update the dialogFragment UI.
* Add UpdatableListPreferenceDialogFragment that updates the available
  options when dialog is shown
* Add test to verify the adapter count when
  onListPreferenceUpdated() is called.

Bug: 77783217
Test: make -j50 RunSettingsRoboTests
Change-Id: I8cac1b30ec50df026f4b7722dd1cd2f69e77a4cb
2018-05-16 22:13:24 +08:00
ryanywlin
f95ed0925b Merge changes from topic "add-hearing-aid-device-in-audio-switch" into pi-dev am: 7e31e22f57
am: 82db752ef0

Change-Id: I7e9a40b08afebedb7b44a6345cda8b2564db315d
2018-05-09 20:46:27 -07:00
ryanywlin
8276d966e9 Add hearing aid device in audio switch
- Add connected hearing aid device to MediaOutputPreferenceController
and HandsFreeProfileOutputPreferenceController

- Set active device to different profile depend on HisyncId

Bug: 78142719
Test: make RunSettingsRoboTests ROBOTEST_FILTER="MediaOutputPreferenceControllerTest" -j28
Test: make RunSettingsRoboTests ROBOTEST_FILTER="HandsFreeProfileOutputPreferenceControllerTest" -j28
Test: make RunSettingsRoboTests ROBOTEST_FILTER="AudioOutputSwitchPreferenceControllerTest" -j28
Change-Id: Ib8fe4f06f8564572dffdce6fcc3f29578bf91bd9
2018-05-10 10:28:20 +08:00
caxtonchan
8118c8d7d0 Merge "Hide the audio switcher if it is not relevant" into pi-dev am: 3f5444b9e4
am: 67d44d9d61

Change-Id: I36b249159ef8d0a6d099ba776c5d682ea596e5e3
2018-04-24 21:04:45 -07:00
caxtonchan
458fb2319f Hide the audio switcher if it is not relevant
Bug: 78317337
Test: make RunSettingsRoboTests
ROBOTEST_FILTER="AudioOutputSwitchPreferenceControllerTest" -j28
ROBOTEST_FILTER="MediaOutputPreferenceControllerTest" -j28
ROBOTEST_FILTER="HandsFreeProfileOutputPreferenceControllerTest" -j28

Change-Id: I9824941cf410b26ad166aa163d7cccd3bfc31a06
2018-04-25 01:34:42 +00:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
ryanywlin
7be15cdd23 Identify cast mode properly in audio switch
- Use STREAM_MUSIC to idetify cast mode

- Use STREAM_MUSIC to detect wired headset

Bug: 78141750
Test: make RunSettingsRoboTests
ROBOTEST_FILTER="MediaOutputPreferenceControllerTest" -j40

Change-Id: I92273d41d3debfc3d6327c4ca09143a2dd9b1cb6
2018-04-17 23:47:42 +00:00
ryanywlin
dca308e56d Replace deprecated APIs in audio switcher.
- Remove isWiredHeadsetOn() and isBluetoothA2dpOn()
in MediaOutputPreferenceController.

- Remove isWiredHeadsetOn() and isBluetoothScoOn()
in HandsFreeProfileOutputPreferenceController.

- Replace with AudioManager.getDevicesForStream().

- Update test cases.

Bug: 78141441
Test: make RunSettingsRoboTests ROBOTEST_FILTER="MediaOutputPreferenceControllerTest" -j40
Test: make RunSettingsRoboTests ROBOTEST_FILTER="HandsFreeProfileOutputPreferenceControllerTest" -j40
Test: make RunSettingsRoboTests ROBOTEST_FILTER="AudioOutputSwitchPreferenceControllerTest" -j40
Change-Id: Ic57c40badf0fd5633f1b7412d63a0b5417d0f47a
2018-04-18 05:57:27 +08:00
ryanywlin
63bdfa8998 Add audio switch UI in sound settings
- Build two controller to control list preferences.

- MediaOutputPreferenceController which allows switching
the media output between current device and connected
BT device supporting A2DP. It also controls disabling
media output switching during a call or cast mode.

- HandsFreeProfilePreferenceController which allows
switching between HFP-connected BT devices while in
on-call state.

- Add test cases for controllers.

Bug: 74130772
Test: make RunSettingsRoboTests ROBOTEST_FILTER="MediaOutputPreferenceControllerTest" -j56
Test: make RunSettingsRoboTests ROBOTEST_FILTER="HandsFreeProfileOutputPreferenceControllerTest" -j56
Test: make RunSettingsRoboTests ROBOTEST_FILTER="AudioOutputSwitchPreferenceControllerTest" -j56

Change-Id: I37f5418442ce77e72cdff07f071ea519ab1047f3
2018-04-16 11:52:44 +08:00