Commit Graph

12540 Commits

Author SHA1 Message Date
Peter_Liang
96ea49a38b Add test cases for legacy components.
Bug: 168567356
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AnimatedImagePreferenceTest
&& make RunSettingsRoboTests ROBOTEST_FILTER=DividerAllowedBelowPreferenceTest
&& make RunSettingsRoboTests ROBOTEST_FILTER=DividerSwitchPreference

Change-Id: Ibe1add4ac6509f456ea76a6053f43c894e410eeb
2020-09-26 11:03:13 +08:00
TreeHugger Robot
e71dc5640e Merge "Disable entry point of output switcher" into rvc-qpr-dev am: faf7a2ad78
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12686593

Change-Id: I981a5fdc4356e41ceaf353b005077765568c6944
2020-09-25 09:31:06 +00:00
TreeHugger Robot
faf7a2ad78 Merge "Disable entry point of output switcher" into rvc-qpr-dev 2020-09-25 09:04:36 +00:00
Jason Chiu
cad3c395da [DO NOT MERGE] Fix the blank space on contextual card loading timeout am: 4753adfb52
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12533604

Change-Id: I974883a20ebcac94cf72ccbfdd9cab18b23d1690
2020-09-25 07:18:13 +00:00
Jason Chiu
e8b34c64f4 Merge "[DO NOT MERGE] Fix the blank space on contextual card loading timeout" into rvc-qpr-dev 2020-09-25 07:05:25 +00:00
Hugh Chen
455a0a3186 Disable entry point of output switcher
It adds a minimum value if it shows only one available
cast device in the output switcher. Because users can only
change the volume slider or stop control in the output switcher.
It's too hidden to have the user stop cast in the UI.

- This CL will disable the entry point of the output switcher
  if there is only one available cast device in the list.
- Update test cases.

Bug: 163095048
Test: make -j42 RunSettingsRoboTests
Change-Id: I8906878e1ba769d6940041f17d83b5de6b2a32c0
Merged-In: I8906878e1ba769d6940041f17d83b5de6b2a32c0
(cherry picked from commit b6840ced0d)
2020-09-25 03:18:05 +00:00
TreeHugger Robot
bbdb762140 Merge "Disable entry point of output switcher" 2020-09-25 03:13:55 +00:00
Hugh Chen
b6840ced0d Disable entry point of output switcher
It adds a minimum value if it shows only one available
cast device in the output switcher. Because users can only
change the volume slider or stop control in the output switcher.
It's too hidden to have the user stop cast in the UI.

- This CL will disable the entry point of the output switcher
  if there is only one available cast device in the list.
- Update test cases.

Bug: 163095048
Test: make -j42 RunSettingsRoboTests
Change-Id: I8906878e1ba769d6940041f17d83b5de6b2a32c0
2020-09-25 02:38:19 +00:00
Alexander Dorokhine
46e85a2fad Migrate away from deprecated Truth APIs.
This is a transitional step towards truth 1.0.1, where these APIs have
been completely removed.

Bug: 168765701
Test: m checkbuild
Change-Id: I76f9c37cb699ce6ab8715ffe35d11668ccbceea1
2020-09-24 23:09:41 +00:00
Jeremy Goldman
29dda35456 Merge "create junit MobileNetworkPreferenceControllerTest." 2020-09-24 14:42:15 +00:00
tim peng
0c786c8321 Merge "Set highest priority as default value to Bluetooth codec" am: 594849082b am: d3a9f472a2 am: f01d260512 am: 3501adcc86
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1435258

Change-Id: I336bae8e93101a682eea6b51f08c52fb83cc1fc9
2020-09-24 13:21:55 +00:00
tim peng
3501adcc86 Merge "Set highest priority as default value to Bluetooth codec" am: 594849082b am: d3a9f472a2 am: f01d260512
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1435258

Change-Id: Iaaef48f2af763fb1905596205bedd6b33574750e
2020-09-24 13:05:41 +00:00
tim peng
f01d260512 Merge "Set highest priority as default value to Bluetooth codec" am: 594849082b am: d3a9f472a2
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1435258

Change-Id: I92cf2605c1e9ee48abedc483a1e461d196b09ef2
2020-09-24 12:39:06 +00:00
timhypeng
a45a0e8980 Set highest priority as default value to Bluetooth codec
-To set highest priority when codec modification comes from development setting

Bug: 165442632
Test: make -j42 RunSettingsRoboTests
Change-Id: I8cfbaa276f3b3e269f4a80e8aae987fbb90f646e
2020-09-24 12:01:01 +08:00
Kevin Chyn
9096f09405 Merge "Update settings together with frameworks/base" 2020-09-23 21:33:35 +00:00
Jeremy Goldman
6620c84d89 create junit MobileNetworkPreferenceControllerTest.
1. androidx lifecycle used rather than settingslib wrapper. This allows
us to handle lifecycle events from junit tests as well.
2. Use Mocks or get/set functions rather than robolectric shadows.

MobileNetworkPreferenceControllerTest Diff:
    https://diff.googleplex.com/#key=5P0b2G4iYmcz
Test: atest -c MobileNetworkPreferenceControllerTest
Change-Id: If49fe64e5db89a0cdcac7d26329b8c18626a00de
2020-09-23 17:26:14 +00:00
changbetty
c707b90d0a [Testing] Use AndroidJUnit4 instead in telephony/cdma/ test files
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. To get the original value and add @After to restore the data

Bug:
Test: atest -c CdmaListPreferenceTest
      atest -c CdmaSubscriptionPreferenceControllerTest
      atest -c CdmaSystemSelectPreferenceControllerTest
Change-Id: I110727b643a6755ee888708bd1fb2a39cf524a2d
2020-09-23 17:46:30 +08:00
changbetty
9e78b620d3 [Testing] Use AndroidJUnit4 instead in CellDataPreferenceTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. Remove the PreferenceViewHolder that not used in test
5. Remove the ProxySubscriptionManager that can get the real object by
context

Bug: 168767478
Test: atest -c CellDataPreferenceTest
Change-Id: I1fa5747c8c6d224d6b13f1a693ff88e57fd150d3
2020-09-23 16:30:59 +08:00
Wesley.CW Wang
ff0e65c7f7 Add intent extra when launching WallpaperPicker from SUW and Settings
- Add extra to these intents to help WallpaperPicker log the launch
 source

Bug: 154781896
Test: make SettingsRoboTests
Change-Id: Ifb0ed22ab8ebfbb3c2ad24e9b7bad80007162b6e
2020-09-23 08:06:52 +00:00
Kevin Chyn
8d63b98272 Update settings together with frameworks/base
Bug: 169195610
Test: Builds
Change-Id: I2c732dba78eb8c90ef71351562415e06949b31bb
2020-09-23 00:17:56 -07:00
Jason Chiu
8c26c4f2f7 Merge "Fix the ANR in panel when changing volume continuously" into rvc-qpr-dev am: c3ed62e3ae
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12652533

Change-Id: I72df2a31695885198f89d1406d31f6e434a827c1
2020-09-23 03:27:48 +00:00
Jason Chiu
c0468c4814 Merge "Fix the endless panel loading" into rvc-qpr-dev am: a78af692c6
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12652532

Change-Id: Iad7b84e6fe3a5c3d19048b5d0c9daf95c26465ec
2020-09-23 03:27:33 +00:00
Jason Chiu
c3ed62e3ae Merge "Fix the ANR in panel when changing volume continuously" into rvc-qpr-dev 2020-09-23 03:01:56 +00:00
Jason Chiu
a78af692c6 Merge "Fix the endless panel loading" into rvc-qpr-dev 2020-09-23 03:01:53 +00:00
TreeHugger Robot
89cc479bd8 Merge "Disable bubbles for low ram devices" into rvc-qpr-dev am: f9469f109a am: 3bce073370
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12620222

Change-Id: I3485643cce554f1b028ed35d20b9ea4ed500cc73
2020-09-22 17:56:32 +00:00
TreeHugger Robot
3bce073370 Merge "Disable bubbles for low ram devices" into rvc-qpr-dev am: f9469f109a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12620222

Change-Id: I90731be022b3bc354cc1cb00e1b23a4cd1dd791f
2020-09-22 17:36:40 +00:00
TreeHugger Robot
f9469f109a Merge "Disable bubbles for low ram devices" into rvc-qpr-dev 2020-09-22 17:11:41 +00:00
PETER LIANG
ed3944ae64 Merge "Fix the Real Time Text option was shown in accessibility settings under active Fi." 2020-09-22 13:08:01 +00:00
TreeHugger Robot
e02dda0aab Merge "Hide the icon if there is no media session or album art." into rvc-qpr-dev am: e9d4e584d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12613116

Change-Id: Id1ecd31b8ad1b6290ad7fda12a7752f55655ad2b
2020-09-22 03:50:01 +00:00
TreeHugger Robot
e9d4e584d5 Merge "Hide the icon if there is no media session or album art." into rvc-qpr-dev 2020-09-22 03:24:09 +00:00
TreeHugger Robot
a581b932c7 Merge "Update state when there is Bluetooth tethering state changed" into rvc-qpr-dev am: e0e283cb4c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12559490

Change-Id: If762b9aadc9f69e55a9e58400e6b92f44ba6a491
2020-09-22 03:22:13 +00:00
TreeHugger Robot
e0e283cb4c Merge "Update state when there is Bluetooth tethering state changed" into rvc-qpr-dev 2020-09-22 03:16:37 +00:00
Jason Chiu
f447cbbcb5 Fix the ANR in panel when changing volume continuously
When users open volume panel and keep on changing the volume slider for
a while, the panel starts to defer the slider updating, and finally gets
stuck and causes an ANR.

Root cause:
Volume panel has four volume adjusting slices. Each of them registers
a broadcast receiver to listen to the volume changed and muted events.
However, when the media volume changes, AudioManager will send four
broadcasts (music, assistant, accessibility, tts) to every receiver, and
each of them will reload slice four times. Thus, one media volume
changed event will lead to 16 (4*4) UI updates. Consequently, keeping on
sliding the volume bar will trigger hundreds of broadcasts and UI
updates, which makes the system busy and getting stuck.

Solution:
Introduce a VolumeSliceHelper to integrate the broadcasts of the volume
slices specifically.
1. Only register one broadcast receiver to reduce the broadcast loading
   since the four slices are listening to the same signal.
2. Filter the only one eligible broadcast among the multiple concurrent
   ones, and then relay it to the registered slice.
3. Listen to one more action STREAM_DEVICES_CHANGED_ACTION to update the
   volume panel when audio output device changes.

Test: robotest, visual
Fixes: 144134209
Fixes: 160489394
Change-Id: I780b9eee35802b19a5f0ab0a7d07bd3e081f5556
Merged-In: I780b9eee35802b19a5f0ab0a7d07bd3e081f5556
(cherry picked from commit 2c7b77dad7)
2020-09-22 02:58:01 +00:00
Jason Chiu
7db71ac87a Fix the endless panel loading
Re-launching volume panel continuously will trigger an endless panel
loading, show a transparent unfinished UI, and then block the user's
screen.

Root cause:
When the activity receives a new intent from user's clicking, it will
call PanelFragment#createPanelContent to update the current fragment.
The method triggers an animation and then loads the panel content. If
multiple invocations run concurrently before the animation or the
loading finish, the loader's countdown latch will be increased
abnormally and lead to the endless loading.

Solution:
1. Since the invocations are in UI thread, simply add a flag to avoid
reentrance when the panel is animating or loading.
2. Filter out the same panel's creation request when the panel is still
visible.
3. Do not force a panel's recreation when it's under construction.

Fixes: 143889510
Fixes: 160491854
Test: robotest, manual
Change-Id: I821faedeb62354929f3af9804cbbe44ee5bb8a53
Merged-In: I821faedeb62354929f3af9804cbbe44ee5bb8a53
(cherry picked from commit 6a8d2c5e55)
2020-09-22 02:55:22 +00:00
TreeHugger Robot
bea5bfe1ce Merge "Fix usb menu not switch to "File Transfer/Android Auto" right after connected to car unit" 2020-09-22 02:55:15 +00:00
Lyn Han
29559b1645 Disable bubbles for low ram devices
Fixes: 167677013
Test: set low ram true => bubble settings hidden
Test: make -j80 RunSettingsRoboTests ROBOTEST_FILTER="Bubble"

Change-Id: I1c40a05404ea7c78cc82102b33e4bc3cb3528075
2020-09-21 15:11:07 -07:00
TreeHugger Robot
101308bc39 Merge "Fix the device on "Media devices" not updated issue" into rvc-qpr-dev am: ca04ccd911
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12634109

Change-Id: I5efb4653490d20f3c3fafd69ac1c3e7373921774
2020-09-21 10:17:24 +00:00
Hugh Chen
ec597c220e Fix the device on "Media devices" not updated issue
- This CL uses new CachedBluetoothDevice callback instance
  in construct to avoid unregister wrong callback.
- This CL uses flag to make sure preference will register callback
  on onAttached() when preference remove callback on
  onPrepareForRemoval() or onDetached().
- Update test case

Bug: 168682778
Bug: 157653997
Test: make -j42 RunSettingsRoboTests
Change-Id: I7a0d9f5332153ee80634e191847b84cd7c380b7d
Merged-In: I7a0d9f5332153ee80634e191847b84cd7c380b7d
(cherry picked from commit cafeab2813)
2020-09-21 09:58:33 +00:00
Hugh Chen
db0aa6541a Hide the icon if there is no media session or album art.
- Before this CL, the output switch panel will show a default
  icon if there is no media session or album art.

  This CL will hide the icon if there is no media session
  or album art.
- Add test case

Bug: 161495909
Test: make -j42 RunSettingsRoboTests
Change-Id: I5f80158b12f89c8499fb97d0b203ebeffefbc18b
Merged-In: I5f80158b12f89c8499fb97d0b203ebeffefbc18b
(cherry picked from commit 30805af9de)
2020-09-21 09:48:46 +00:00
Jason Chiu
4753adfb52 [DO NOT MERGE] Fix the blank space on contextual card loading timeout
Root cause:
Sometimes loading contextual cards exceeds 1 second and a timeout
expires. In the past, we used the timeout in order not to update
homepage UI and to avoid screen scrolling. But we've introduced a
mechanism of card space pre-allocation to avoid flickering, so when the
timeout expires, the pre-allocated space will be always blank.

Solution:
Display a card on timeout if the one-card space is pre-allocated.

Fixes: 165886791
Test: robotest
Change-Id: I79b29c5fd6d9c4fe6b53dd4f5eab4cd3a606d76d
2020-09-21 09:47:19 +00:00
Jeremy Goldman
37cfec7ac2 Merge "[Testing] AndroidJunit Enhanced4gLteSliceHelperTest" 2020-09-21 03:46:18 +00:00
TreeHugger Robot
660b17c7cb Merge "Update state when there is Bluetooth tethering state changed" 2020-09-21 03:24:38 +00:00
Jeremy
1885f027d8 [Testing] AndroidJunit Enhanced4gLteSliceHelperTest
Test: atest -c Enhanced4gLteSliceHelperTest
Change-Id: I548ffe60f00cea76d0c4af33ca4ec6f38cbf6247
2020-09-18 15:30:41 -04:00
Peter_Liang
d43fcdaf49 Fix the Real Time Text option was shown in accessibility settings under active Fi.
Root cause:
Only using and querying the dialer intent can't be represented for supporting RTT.

Next action:
Add one checker for carrier config.

Bug: 159242323
Test: manual test for AT&T, Google Fi, chunghwa sim
& make RunSettingsRoboTests ROBOTEST_FILTER=RTTSettingPreferenceControllerTest

Change-Id: I8e85b9fdfc658ea6855a4041691efdbfd07c62d6
2020-09-18 17:57:30 +08:00
Hugh Chen
af0a45bb7a Fix usb menu not switch to "File Transfer/Android Auto" right after connected to car unit
- This CL before usb receiver didn't check the extra
  information of the accessory. It will cause the usb
  menu not to be aware that the usb port is switched
  to accessory mode.

  This CL usb receiver will check intent whether to have
  accessory extra. If the usb port is switched to accessory
  mode the usb menu will switch to "File Transfer/Android Auto".
- Update test case

Bug: 162451162
Test: make -j42 RunSettingsRoboTests
Change-Id: I0eca89a23670c674b74753fc526256cc1d52e759
2020-09-18 15:45:37 +08:00
TreeHugger Robot
b7d5c72d0f Merge "Create NetworkProviderSettings for provider model" 2020-09-18 05:08:08 +00:00
Beth Thibodeau
51499b2f51 [DO NOT MERGE] Revert "Allow user to block individual apps from resuming." am: 70920bd9ff
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12597795

Change-Id: I4019b79c2ee725d518ff9c7b6714bda772133d47
2020-09-17 19:12:14 +00:00
Jeremy Goldman
d620baa3d7 Merge "[Testing] AndroidJUnit4 NetworkSelectSettingsTest" 2020-09-17 18:58:36 +00:00
Beth Thibodeau
7ca988cab1 Merge "[DO NOT MERGE] Revert "Allow user to block individual apps from resuming."" into rvc-qpr-dev 2020-09-17 17:56:29 +00:00
Beth Thibodeau
70920bd9ff [DO NOT MERGE] Revert "Allow user to block individual apps from resuming."
Revert submission 12392268-cherrypick-mediaappsettings-5fxuo164a2

Bug: 161813143

Reason for revert: no longer want change in QPR
Reverted Changes:
Id3de52419:Allow user to block individual apps from resuming....
I8c85bc937:Allow user to block individual apps from resuming

Change-Id: Ieacef217587476532246b466d680219351bc1657
2020-09-17 17:55:56 +00:00