Commit Graph

12573 Commits

Author SHA1 Message Date
Bonian Chen
ccc406381a Merge "[Testing] Remove Robolectric import and use AndroidJUnit4 instead in MobileDataEnabledListenerTest" am: f5fa52884b am: 49936c5eb5
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1427810

Change-Id: Ifa4dc400eb8c87c2514a3629288657520476fbfd
2020-09-15 08:40:08 +00:00
TreeHugger Robot
c21ad3649e Merge "Display "see all" option when bluetooth is off" into rvc-qpr-dev 2020-09-15 08:01:48 +00:00
Betty Chang
195aa70291 Merge "[Testing] Use AndroidJUnit4 instead in DataUsageInfoControllerTest" 2020-09-15 06:17:53 +00:00
TreeHugger Robot
8678e5112a Merge "Fix the ANR in panel when changing volume continuously" 2020-09-15 05:43:09 +00:00
changbetty
8de635ea7b [Testing] Remove Robolectric import and use AndroidJUnit4 instead in MobileDataEnabledListenerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context

Bug: 162048313
Test: atest -c MobileDataEnabledListenerTest
Merged-In: I81b3d6ac075666a45649c8d811832a40bdb1b41b
Change-Id: I34687eb69ef62cd3b6ea6519cee608a7b95f242b
2020-09-15 12:24:10 +08:00
changbetty
5c46c0f881 [Testing] Use AndroidJUnit4 instead in TelephonyTogglePreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change the Copy Right

Bug: 164986958
Test: atest -c TelephonyTogglePreferenceControllerTest
Merged-In: I3d6c39f45cb1efb1742148f20f03372214eb0cbe
Change-Id: Ie7343f8c6dd45add2832679d95372e750ce350ce
2020-09-15 12:20:10 +08:00
changbetty
2817fa8e44 [Testing] Use AndroidJUnit4 instead in TelephonyBasePreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right

Bug: 164986221
Test: atest -c TelephonyBasePreferenceControllerTest
Merged-In: Iabe24aef0b7a5c3aa9d7be275f0c4ed552cdd2e8
Change-Id: I96e99506b534dbe7fc9e66739295e09fc543663f
2020-09-15 12:12:31 +08:00
Jeremy Goldman
0c48f53cfe [Testing] use AndroidJUnit4 in new EuiccPreferenceControllerTest
Test: atest -c EuiccPreferenceControllerTest
Merged-In: I028ca81d38252beb3abccef9e938988510f3f55e
Change-Id: I5fcd2f3e9d2e845ec9e1e2693c10330e4292fb7a
2020-09-15 12:05:44 +08:00
Betty Chang
090f32f03d Merge "[Testing] Use AndroidJUnit4 instead in CarrierSettingsVersionPreferenceControllerTest" 2020-09-15 02:37:19 +00:00
Jeremy Goldman
ca5aa8786d [Testing] use AndroidJUnit4 in new MobileDataPreferenceControllerTest
Diff: https://diff.googleplex.com/#key=OYsSkuGzJNkP
Test: atest -c MobileDataPreferenceControllerTest
Merged-In: I1a2d7b38023681f3db3320aa9f315109280cfbd0
Change-Id: Ica6625bb924ad0e813b4f9cdca62b0126b63214e
2020-09-15 10:36:14 +08:00
Jeremy Goldman
d713cc6873 [Testing] use AndroidJUnit4 in new MultiNetworkHeaderControllerTest
1. Rather than mocking the PreferenceScreen, create an instance via
PreferenceManager. Rather than stubbing PreferenceScreen functions to
return the PreferenceCategory mock, the mock is inserted using public
functions.
2. PreferenceCategory active state is checked rather than verifying the
arguments of function calls.
3. mHeaderController test superclass overrides functions which use the
Lifecycle, because doReturn+when on Spy objects has undesired side
effects.
4. Looper message queue prepared for the PreferenceScreen.

Bug: 168130550
Diff: https://diff.googleplex.com/#key=w7a7L3seOowE
Test: atest -c MultiNetworkHeaderControllerTest
Merged-In: Ic66425aca4047d2eacd04509f3bfb315f6dd57fc
Change-Id: I07925cfbb05636bdf7f0efe1811405a01dcf6523
2020-09-15 10:34:24 +08:00
TreeHugger Robot
34937eb21e Merge "Hide the icon if didn't have media session or album art" 2020-09-15 02:32:08 +00:00
Julia Reynolds
e06050cc63 Fix crash on rotation
by making the information the dialog needs available earlier

Test: manual, with rotation
Fixes: 165889571
Change-Id: I68627d17573a876f8e81cc63ccf74eee0063b63d
2020-09-14 15:27:05 -04:00
changbetty
3644df3a9e [Testing] Use AndroidJUnit4 instead in DataUsageInfoControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. Rename the test case for apply the naming rule

Bug: 167948471
Test: atest -c DataUsageInfoControllerTest
Change-Id: Id8591f77d6ab2840223501962ae19eaa2749f326
2020-09-14 18:31:43 +08:00
Hugh Chen
30805af9de Hide the icon if didn't have media session or album art
- This CL before, output switcher panel will show default
  icon if there are no media session or album art.

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

Bug: 161495909
Test: make -j42 RunSettingsRoboTests
Change-Id: I5f80158b12f89c8499fb97d0b203ebeffefbc18b
2020-09-14 17:17:04 +08:00
Quang Luong
77e32049bd Merge "[Wi-Fi] Show Pie+x Wi-Fi icon when a connected Wi-Fi is not default route" into rvc-qpr-dev am: db667a8971 am: 8704114f02
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12444567

Change-Id: I95ac03dcb6a45fbc8c71aae0d7c9fcae20f36ff2
2020-09-11 23:50:57 +00:00
Quang Luong
8704114f02 Merge "[Wi-Fi] Show Pie+x Wi-Fi icon when a connected Wi-Fi is not default route" into rvc-qpr-dev am: db667a8971
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12444567

Change-Id: I655406b69ef689a1b604ed6fc6c9e4d2bbf8bf82
2020-09-11 18:57:42 +00:00
Quang Luong
db667a8971 Merge "[Wi-Fi] Show Pie+x Wi-Fi icon when a connected Wi-Fi is not default route" into rvc-qpr-dev 2020-09-11 18:30:32 +00:00
Jeremy Goldman
1f718138e5 Merge "[Testing] use AndroidJUnit4 in new MultiNetworkHeaderControllerTest" 2020-09-11 17:38:52 +00:00
Jeremy Goldman
9b8efdbe4c Merge "[Testing] use AndroidJUnit4 in new MobileDataPreferenceControllerTest" 2020-09-11 17:38:18 +00:00
Betty Chang
b5cc1860f3 Merge "[Testing] Use AndroidJUnit4 instead in MmsMessagePreferenceControllerTest" 2020-09-11 09:50:06 +00:00
Ted Wang
3876d72b7c Update state when there is Bluetooth tethering state changed
Monitor Bluetooth Tethering state and update preference when there is
Bluetooth tethering state change.
Add test case to verify when recieve
BluetoothPan.TETHERING_STATE_CHANGED will update bluetooth state

Bug: 138688805
Test: make RunSettingsRoboTests
Merged-Id: I8f468d1d99ed6d87f6cd8305ef56b0d7a5dec95b
Change-Id: I8f468d1d99ed6d87f6cd8305ef56b0d7a5dec95b
2020-09-11 09:09:46 +00:00
changbetty
018ab8e800 [Testing] Use AndroidJUnit4 instead in CarrierSettingsVersionPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Change the Copy Right
3. Remove the shadowCarrierConfigManager to mock the
CarrierConfigManager

Bug: 168281601
Test: atest -c CarrierSettingsVersionPreferenceControllerTest
Change-Id: Id14d103a82d2d2954721624ed7a16204ee0f25b6
2020-09-11 08:45:03 +00:00
Betty Chang
4c8756704c Merge "[Testing] Use AndroidJUnit4 instead in AppPrefLoaderTest" 2020-09-11 08:38:59 +00:00
changbetty
866f40b2f6 [Testing] Use AndroidJUnit4 instead in MmsMessagePreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Change the Copy Right
3. Remove the ShadowSubscriptionManager

Bug: 168278301
Test: atest -c MmsMessagePreferenceControllerTest
Change-Id: Ie2e9c99f9899d422fde41fcd6cf4a918bc0eaf98
2020-09-11 14:52:28 +08:00
changbetty
5a22464bfa [Testing] Use AndroidJUnit4 instead in AppPrefLoaderTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Change the Copy Right

Bug: 168277399
Test: atest -c AppPrefLoaderTest
Change-Id: If4c79ae1831bd531c7e4f0a068f06a592418d7fe
2020-09-11 06:36:54 +00:00
Jeremy Goldman
a1aaccf670 [Testing] use AndroidJUnit4 in new MultiNetworkHeaderControllerTest
1. Rather than mocking the PreferenceScreen, create an instance via
PreferenceManager. Rather than stubbing PreferenceScreen functions to
return the PreferenceCategory mock, the mock is inserted using public
functions.
2. PreferenceCategory active state is checked rather than verifying the
arguments of function calls.
3. mHeaderController test superclass overrides functions which use the
Lifecycle, because doReturn+when on Spy objects has undesired side
effects.
4. Looper message queue prepared for the PreferenceScreen.

Bug: 168130550
Diff: https://diff.googleplex.com/#key=w7a7L3seOowE
Test: atest -c MultiNetworkHeaderControllerTest
Change-Id: Ic66425aca4047d2eacd04509f3bfb315f6dd57fc
2020-09-10 20:10:22 +00:00
Yi Jiang
f7b60ee566 Merge "Disable screen attention when DISALLOW_CONFIG_SCREEN_TIMEOUT" 2020-09-10 17:33:36 +00:00
Jeremy Goldman
4126ec2d32 [Testing] use AndroidJUnit4 in new EuiccPreferenceControllerTest
Test: atest -c EuiccPreferenceControllerTest
Change-Id: I028ca81d38252beb3abccef9e938988510f3f55e
2020-09-10 15:19:01 +00:00
Jeremy Goldman
ff6bc3ce27 [Testing] use AndroidJUnit4 in new MobileDataPreferenceControllerTest
Diff: https://diff.googleplex.com/#key=OYsSkuGzJNkP
Test: atest -c MobileDataPreferenceControllerTest
Change-Id: I1a2d7b38023681f3db3320aa9f315109280cfbd0
2020-09-10 15:15:08 +00:00
Yi Jiang
038d18ff73 Disable screen attention when DISALLOW_CONFIG_SCREEN_TIMEOUT
Test: atest AdaptiveSleepDetailPreferenceControllerTest
Bug: 161938926
Change-Id: I4ed96ad36efe67091a26cbfe2cde16c116f7c8fb
2020-09-10 00:58:03 -07:00
Ted Wang
47f2ebb1af Update state when there is Bluetooth tethering state changed
Monitor Bluetooth Tethering state and update preference when there is
Bluetooth tethering state change.
Add test case to verify when recieve
BluetoothPan.TETHERING_STATE_CHANGED will update bluetooth state

Bug: 138688805
Test: make RunSettingsRoboTests
Change-Id: I8f468d1d99ed6d87f6cd8305ef56b0d7a5dec95b
2020-09-10 06:15:41 +00:00
Arc Wang
746176eb56 Create NetworkProviderSettings for provider model
Provider model is a feature which improves networks
Settings UX.

NetworkProviderSettings is the fragment which allow
users to choose a mobile network or a Wi-Fi network
to connect.

At this change, NetworkProviderSettings is a clone
of WifiSettings, mobile networks will be integrated
at later CLs.

Bug: 167474581
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.network.NetworkProviderSettingsTest
Change-Id: I185639a8f2469e9ec76ad18b6c2bc2e8a4d079e3
2020-09-10 11:03:48 +08:00
Betty Chang
e8b877e3ee Merge "[Testing] Use AndroidJUnit4 instead in NetworkDashboardFragmentTest" 2020-09-10 02:30:24 +00:00
Betty Chang
914fdb6b5f Merge "[Testing] Use AndroidJUnit4 instead in MobilePlanPreferenceControllerTest" 2020-09-10 02:30:09 +00:00
Yanting Yang
7b8b881f8a Merge "Resolve tiles intent before prompting a dialog for profile selection" 2020-09-09 14:44:35 +00:00
Yanting Yang
552f340dda Resolve tiles intent before prompting a dialog for profile selection
Symptom:
Once the work profile component of the tile is disabled after Settings
preloaded tiles, Settings will crash when the user clicks the work
option from the profile selection dialog.

Root cause:
Settings just checks the users from the preloaded tiles to prompt
profile selection dialog. It doesn’t check the activity for the work
profile user before launching.

Solution:
Resolve the activity by intent as users before launching if the work
profile is enabled. Directly start activity if only one user is
resolvable, otherwise prompt a dialog for profile selection.

Fixes: 162227425
Test: make RunSettingsRoboTests
Change-Id: Idcc4e5a266ab2a2252db30bb97d4be002212c677
2020-09-09 18:12:42 +08:00
changbetty
0bf90f7186 [Testing] Use AndroidJUnit4 instead in MobilePlanPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Add @Before setup() for context
3. Change Copy Right
4. Workaround the resource getString to resolve the resource not found

Bug: 167997296
Test: atest -c MobilePlanPreferenceControllerTest
Change-Id: I5f43b6a4d20108195164038c02810b725abbcd06
2020-09-09 15:34:52 +08:00
changbetty
f24a8be2d8 [Testing] Use AndroidJUnit4 instead in NetworkDashboardFragmentTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. Run the NetworkDashboardFragment on the Main thread

Bug: 168000627
Test: atest -c NetworkDashboardFragmentTest
Change-Id: I6d10737b9ac8299f2d7c847a9fdb1c3bdc4e390d
2020-09-09 11:26:42 +08:00
Jason Chiu
630b23b3de Merge "Fix the endless panel loading" 2020-09-08 06:04:23 +00:00
Betty Chang
4badae1a03 Merge "[Testing] Use AndroidJUnit4 instead in DataServiceSetupPreferenceControllerTest" 2020-09-08 01:45:08 +00:00
Betty Chang
b05056bce7 Merge "[Testing] Use AndroidJUnit4 instead in DisableSimFooterPreferenceControllerTest" 2020-09-08 01:44:17 +00:00
Betty Chang
9928db2e7e Merge "[Testing] Use AndroidJUnit4 instead in PreferredNetworkModePreferenceControllerTest test files" 2020-09-08 01:35:45 +00:00
Betty Chang
13aa43c2f8 Merge "[Testing] Use AndroidJUnit4 instead in telephony/gsm/ test files" 2020-09-08 01:33:51 +00:00
Betty Chang
645da1dac4 Merge "[Testing] Use AndroidJUnit4 instead in NrDisabledInDsdsFooterPreferenceControllerTest" 2020-09-07 09:34:56 +00:00
Hugh Chen
194dd88e7d Fix settings crash
- This CL before, "Previously connected device" didn't
  handle dock device. If user have disconnected dock
  device will cause Settings crash.

  This CL add condition to handle dock device to avoid crash.
- Update test case.

Bug: 157653997
Bug: 167054620
Test: make -j42 RunSettingsRoboTests
Change-Id: I769cee3f589e14a993b00a0ae6ec3ddfba8ef281
Merged-In: I769cee3f589e14a993b00a0ae6ec3ddfba8ef281
2020-09-07 02:59:15 +00:00
Hugh Chen
cb057d6e9e Show just disconnected device on previously connected
- This CL before, previously connected devices will show most
  recently connected devices and the maximum is 3.
  In this time, if next most recently connected device is disconnected.
  It's will not show on "previously connected devices", user needs go to
  "see all" page to found that device.
  This CL add rule to compare the priority of most recently connected
  device. If priority of next disconnected device is higher than
  currnect devices that on "previously connected devices".
  Let next disconnected device show on "previously connected devices".
- Update test case.

Bug: 157653997
Test: make -j42 RunSettingsRoboTests
Change-Id: I684501a20a67755b2196ba9d4b5565add01a5d01
Merged-In: I684501a20a67755b2196ba9d4b5565add01a5d01
2020-09-07 02:59:06 +00:00
Hugh Chen
30a97a9cc5 Display "see all" option when bluetooth is off
- This CL before, Bluetooth settings will hide the "see all"
  option when bluetooth is off. For the UX improvement, this
  CL will show the "see all" button when bluetooth is off. And
  turn on the BT when user press "see all" button to let user to
  quick pair their disconnected devices.
- Update and add test case

Bug: 147150367
Test: make -j42 RunSettingsRoboTests
Change-Id: I7a1451a36a31253b6be2203341bea4e59fed7c2b
Merged-In: I7a1451a36a31253b6be2203341bea4e59fed7c2b
(cherry picked from commit bde100849e)
2020-09-07 02:58:39 +00:00
changbetty
bc7475a08f [Testing] Use AndroidJUnit4 instead in telephony/gsm/ test files
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. Workaround the resource getString to resolve the resource not found

Bug:
Test: atest -c AutoSelectPreferenceControllerTest
      atest -c OpenNetworkSelectPagePreferenceControllerTest
Change-Id: Ic80da4fcc6a64e7fde55705dda128741c26ce3cf
2020-09-07 02:31:30 +00:00
changbetty
ca2e8c8250 [Testing] Use AndroidJUnit4 instead in NrDisabledInDsdsFooterPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Remove the @Ignore tag in isAvailable_dataOnAndDsdsAnd5GSupported_Available

Bug: 167933210
Test: atest -c NrDisabledInDsdsFooterPreferenceControllerTest
Change-Id: I455a543d7a006be21523918e48cc77b403f8b56d
2020-09-07 09:27:17 +08:00