Commit Graph

28 Commits

Author SHA1 Message Date
Jason Chiu
8ac1e4d49d Update icon tint color when the user toggles Dark theme
- Reload theme in slice provider when Dark theme mode changes for slices
- Reload theme in onCreate of Panel activity for its non-slice header
- Remove applyTheme from individual slices

Test: robotest
Fixes: 153700819
Change-Id: I40a7d2817c4b9100d7b2f2962a69c8a9ce6f7906
2020-05-12 10:58:54 +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
Tim Peng
85055801fe No feedback when attempting to transfer to an unpowered BT device
-Set title and subtitle when connecting state changes
-Add test cases

Bug: 152606143
Test: make -j42 RunSettingsRoboTests
Change-Id: I1c482e8f45752d658d7898de760594fd3ec7164d
2020-04-06 01:19:28 +00: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
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
TreeHugger Robot
1334a7e986 Merge "The text contrast of "disconnected" in Switch media output panel is insufficient." into rvc-dev 2020-03-10 14:45:46 +00:00
Tim Peng
1a5b896dc2 The text contrast of "disconnected" in Switch media output panel is insufficient.
-Apply generic color "textColorSecondary"

Bug: 151050490
Test: manual
Change-Id: Id5e967faab6dedb25607f8afb12acbf338211144
2020-03-10 07:08:24 +00:00
Tim Peng
b4c4c362c5 Add entry point at output switcher to do group operation
-Entry point is available only when there are more than 1 connected device
-Add group Slice item when it is available
-Add intent filter in manifest
-Add test case

Bug: 146813761
Test: make -j42 RunSettingsRoboTests
Change-Id: If398b7a31219fd1910503d96fe7593622528c792
2020-03-10 13:44:09 +08:00
Tim Peng
9c2968ab21 Update rule to display output switcher Slice
-Display when Cast device is available
-Add test case

Bug: 150907688
Test: make -j42 RunSettingsRoboTests
Change-Id: I1aa2fbe7b77a0274816af47bbc372eae9d7944c9
2020-03-09 16:29:53 +08:00
timhypeng
95bd75e97b Append status to title for the disconnected Bluetooth device
-Set gray color for status
-Remove status text in subtitle
-Add test cases

Bug: 149176483
Test: make -j42 RunSettingsRoboTests
Change-Id: I5ebb4e080f43d4c0fc00d87a4732ace76c2d806e
2020-02-27 08:10:51 +00:00
hughchen
9c9d5235e6 Add null check of MediaDevice
Add null check of MediaDevice to avoid some case it would be null.

Bug: 147856563
Test: manually
Change-Id: I86615bb58ccadb8d7741f612ba18afaa178bde6c
2020-02-10 19:19:54 +08:00
hughchen
1ab6dd7a71 Show volume bar if MediaDevice is active device
This CL before, the volume bar will shown on the top device.
In this CL, the volume bar will shown on the active device.

Bug: 148765806
Test: manually
Change-Id: Id261201a4227151667c67ab91864cc349941372e
2020-02-10 02:40:06 +00: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
Raff Tsai
d785e78594 Fix PendingIntent CanceledException exception
- b/142107748 has more context

Fixes: 143267879
Test: manual
Change-Id: I3a5446febc09006fd07986c13e0a150cf89e84fd
2019-11-12 16:13:39 +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
TreeHugger Robot
12dcbe7c71 Merge "Clear media switcher items when in phone call" into qt-dev 2019-05-10 18:14:02 +00:00
hughchen
095c5be448 Clear media switcher items when in phone call
- update test case

Bug: 132385707
Test: make -j42 RunSettingsRoboTests
Change-Id: I2bbd35e869e8ab5596d280d04fddc98f05629190
2019-05-10 10:27:26 +08:00
lindatseng
33c5d72ffe Fix NPE when launching MediaOutput Panel
Add NP check when to avoid NPE when launching MediaOutput Panel

Fixes: 132366620
Test: Manual
Change-Id: I21a481907a5bca83404e59e08ba11ce5c55199a4
2019-05-09 14:03:15 -07:00
hughchen
53eb9eb24d Fix media output slice is empty even BT device is paired
Return the empty ListBuilder instead of return null in
getSlice().

Bug: 131140677
Test: make -j42 RunSettingsRobotests
Change-Id: I2b1a4bc0c6d2017ec85b2e9f8a5bfc08a0eba1b5
2019-04-25 11:05:27 +08:00
hughchen
c11875c0c6 Add FLAG_RECEIVER_FOREGROUND flag
Bug: 129726026
Test: make -j42 RunSettingsRoboTests
Change-Id: Idf994396a5dcf78e520ff3cf7c928d4dd19b606e
2019-04-02 14:22:39 +08:00
hughchen
43fcc7b829 Set accent color to COLOR_NOT_TINTED
Bug: 128570540
Test: Test: make -j42 RunSettingsRoboTests
Change-Id: I483542156bf6cd24ed7080fed45e9f8e4d87a079
2019-03-28 14:30:55 +08:00
hughchen
8f76b44410 Add null check for worker
Add null check to avoid crash when worker cannot get through uri.

Bug: 128492874
Test: make -j42 RunSettingsRoboTests
Change-Id: I789ce0bfa98c0b0b145a8605c58c88a77eeb76a9
2019-03-18 19:12:32 +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
Jason Chiu
c78c54a9c6 Add a util method of creating Icon with Drawable
- Add a util method to help create Icon with Drawable so that
users don't need to handle bitmaps
- Add support for creating with ColorDrawable

Test: robotest
Fixes: 124407373
Change-Id: I1897256821cc804a5e599d967feb84a3bcd689a9
2019-02-19 15:51:38 +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