Commit Graph

23 Commits

Author SHA1 Message Date
timhypeng
deb93069c3 Remove MediaOutputPanel and MediaOutputSlice
Bug: 174192979
Test: build pass
Change-Id: Ibbbb9e7865ae991d13cd7a2d4fb9c5c75a689dea
2020-12-17 13:37:39 +08:00
Hugh Chen
e16a8077b5 Fix output switcher will show 2 media session when remote playing
Before this CL, output switcher will show 2 media sessions when
some apps are remote playing. The root cause is some apps will
also create local media sessions when they cast media to remote
playing.

This CL add condition to only show remote sessions on output switcher
if apps both have remote and local sessions.

Bug: 169052790
Test: make -j42 RunSettingsRoboTests
Change-Id: I80479d35b2bb2e353cf41f41f457f2dfd15cadbf
2020-10-14 17:58:47 +08:00
Hugh Chen
c07b475843 Move isMediaOutputDisabled() from Utils to LocalMediaManager
- Move isMediaOutputDisabled() from Utils to LocalMediaManager.
  The isMediaOutputDisabled() is used to check whether should
  disable the entry point of media output, it's not a general
  method for Settings. To reduce the usage of Utils.java,
  it's better to let LocalMediaManager handle this method.
- Add test cases.

Bug: 169378895
Test: make -j42 RunSettingsRoboTests
Change-Id: I5dbed2ad4de6dca8105414f8b7d7ce7141e258bd
2020-09-29 11:27:39 +08:00
Tim Peng
1af5b0cd7b Non-deselectable routes can be deselected
-Check deselectable list
-Add test case

Bug: 157098549
Test: make -j42 RunSettingsRoboTests
Change-Id: I254a9d3825319aa7b262d04e4f4c580f76afe381
2020-05-26 07:25:29 +00:00
Robert Luo
b7d1aa8efa Add data collection and metrics for Media Output Switcher - 2/n
Fixes: 147792668
Test: ./out/host/linux-x86/bin/statsd_testdrive Atom_ID
Change-Id: I1a34228da75c197663bcfe909c961e57665590d4
2020-05-21 18:00:50 +08:00
Tim Peng
17e2e158c4 Talkback focus doesn't move in liner order after tapping selected option in switch device panel
-Not to reflash UI to reset the focus order
-Reflash UI only when connect() is valid

Bug: 156336275
Test: make -j42 RunSettingsRoboTests
Change-Id: Ibb20252167ba13309065e4672f92cdf645661a0e
2020-05-19 10:08:14 +08:00
Tim Peng
77bec31eb5 Output switcher shows the device list by an incorrect package name
-Reset package name when it is different with previous one
-Add test case

Bug: 156561856
Test: make -j50 RunSettingsRoboTests
Change-Id: I7931ebbc59ab404f12473fe29f2735ad3a8197fd
2020-05-15 06:26:03 +00:00
Tim Peng
550fd3ef9a When only one device is selected in dynamic group, the device should be disabled
-Check if device id is in selected group rather than comparing client package name
-Add test cases

Bug: 154916764
Test: make -j50 RunSettingsRoboTests
Change-Id: I7364a9e3d807bbfc6b26b8212ab2da67ea329582
2020-05-12 01:44:56 +00:00
Tim Peng
e9b91f08c4 Modify rule of remote media session UI
-Add preference by remote session in Sound Setting
-Add slice item by remote session in Volume panel
-Replace media device data with media session data
-Add test case

Bug: 154918214
Test: make -j50 RunSettingsRoboTests
Change-Id: Ib1c873c9f99eebcba377f4115c4b9b4297b20c3d
2020-05-04 12:21:20 +08:00
Tim Peng
71dd32ded0 Hide volume slider in Output Switcher when volume adjustment is restricted
-Check UserManager.DISALLOW_ADJUST_VOLUME
-Hide slider when unsupported

Bug: 153922342
Test: 1.Open CTS-V app > Device Owner Tests
2.install CtsEmptyDeviceOwner.apk -"adb install -r -t CtsEmptyDeviceOwner.apk"
3.enter the command "adb shell dpm set-device-owner com.android.cts.emptydeviceowner/.EmptyDeviceAdmin"
4.push Check device owner button
5.open Policy transparency test and go to Disallow adjust volume > Enable the switch > Open settings.

Change-Id: Iac2793ead6d93d4eaada19c4eec33885d4b97138
2020-04-20 09:09:07 +00:00
hughchen
649cddeb15 Get MediaDevice from devices list
The TopDevice that we cached will not update device infomation
when route is changed. We should get TopDevice from devices
list every time to confirm the device infomation is updated.

Bug: 151709228
Test: manual test to see ui is changed
Change-Id: Iede279b424d070dc7a0b30c369bed316e7ac223d
2020-03-25 17:24:26 +08:00
Tim Peng
dd39f44344 Handle ransferring state in output switcher
-Add subtitle on Slice item for transferring and failed case
-Add test cases

Bug: 150903460
Test: make -j50 RunSettingsRoboTests
Change-Id: I45fee20194dc6c9ec86ca88158393dfda455d0c0
2020-03-12 16:29:30 +08:00
Tim Peng
c88dc498e8 Add getSessionName() API for group name in worker
Bug: 150827723
Test: make -j50 RunSettingsRoboTests
Change-Id: Id09cb61b8ce23520761252fbb8ffbe3e323adf8e
2020-03-05 13:49:04 +08:00
timhypeng
7dfd41f6b1 Add slice for dynamic grouping in output switcher
-Add group operation slice to edit the group and do the volume adjustment
-Add grouping API in slice worker
-Add test cases

Bug: 146813761
Test: make -j42 RunSettingsRoboTests
Change-Id: Ide0df5e3934bc8ac68aaa67fcbd6173a4454ac7f
2020-02-27 06:28:15 +00:00
timhypeng
b266fa6029 Add remote media slice in volume panel
-Add test cases

Bug: 142772656
Test: make -j42 RunSettingsRoboTests
Change-Id: I62d3054a4343ed2c7fbb0b4d7aeb5a48da194b02
2020-02-06 14:38:13 +08:00
timhypeng
6fc2f84a4e Apply RichInputRangeBuilder
-Add volume control
-Add test case

Bug: 146813957
Test: make -j42 RunSettingsRoboTests
Change-Id: I250b8447ed133212b6325eff5122ca39069c99d9
2020-02-03 14:17:05 +08:00
hughchen
1045823b3c Fix ConcurrentModificationException
Use CopyOnWriteArrayList instead of Arraylist to
avoid ConcurrentModificationException.

Bug: 147334979
Test: make -j42 RunSettingsRoboTests

Change-Id: I669f379d3eba6a086c6bd97cde2b78d92fb5c481
2020-01-15 09:23:28 +08:00
hughchen
c770c9133a Update output switch UI
This CL include following update:

1. Add onDeviceAttributesChanged() callback to update UI
   when device attributes are changed.
2. Fix the top device when user press device to transfer.
3. Update UI when device is on goning call state and receive
   STREAM_DEVICES_CHANGED_ACTION intent.

Bug: 144535188
Test: make -j42 RunSettingsRoboTests
Change-Id: Idd5fb95054db30f8184faf4f6ab75d0b550907a1
2020-01-14 16:45:28 +08:00
hughchen
6b3856d5de Get package name on worker instead of on slice
Bug: 144535188
Test: make -j42 RunSettingsRoboTests
Change-Id: I3aa9c7ccf8df23527b8d2b79033c96ec1289c7ea
2019-12-23 11:20:13 +08:00
hughchen
059cb397cd Update slice states when on Voip calling
This CL is used to register intent of AudioManager.STREAM_DEVICES_CHANGED_ACTION
to know that phone is on VOIP call. When received this intent, media slice will
to update UI. Then if audio mode is on-going call, we will hide the slice UI.

Bug: 132198606
Test: Test: make -j42 RunSettingsRoboTests
Change-Id: Ic17ebd319b3da8f42089d36ba530cfb57c93c4c6
2019-09-09 11:01:44 +08:00
hughchen
926cb581c1 Make UI smoothly when switch device in MediaOuput slice
Put connect device method to background thread to
avoid blocking UI.

Bug: 130856371
Test: RunSettingsRoboTests
Change-Id: I7638c8cbfdfcc2225ca7a1d9214a28672b1cd7db
2019-04-19 16:17:42 +08:00
hughchen
e13e09d1b4 Update output switcher behavior and UI design
- Remove media stream stuff, use active device info as header.
- Show the sub title of media device.
- Add new requirement, when user click disconnected bluetooth device,
  will auto connceted it.
- When bluetooth state is off, do not showing content of slice.

Bug: 127201385
Test: make -j42 RunSettingsRoboTests
Change-Id: Ie1880ba3ef9910a42caf0cca2b6502e54787f5a0
2019-03-11 11:44:27 +08:00
hughchen
d48be9a51a Implement MediaOutputSlice
Implement MediaOutputSlice that used to show the MediaDevice list and
switch the device to transfer the media.

Bug: 121083246
Test: make -j RunSettingsRoboTests
Change-Id: I0d57cc75ca1fc8eae2d943819f84b1ec8b608255
2019-01-28 12:04:30 +08:00