- Add mobile internet preference with default data subscription.
- Make prefrence to show dynamically when data subscription changed.
Video exhibition
- http://rcll/gcmsphfhJ1UzfPSvjWOuXK/c1B2CtaFz27rlIQ2LSTJmo
Code difference
- SubscriptionsPreferenceControllerTest.java between robolectric and junit.
- https://diff.googleplex.com/#key=1Zm7JGPhoZwY
Bug: 172229552
Test: atest SubscriptionsPreferenceControllerTest
Change-Id: Ib50c2c51159f60f19631d1a02081eafde3436e94
Implement a slice which can show/update carrier networks.
Before and after: go/b173971144screenshot
Bug: 173971144
Test: atest NetworkProviderWorkerTest (PASS)
atest ProviderModelSliceTest (PASS)
Change-Id: I3f0dab364c88723ef3185a2ff040b1fbd1b099f4
Rather than mocking the PreferenceScreen's getPreference function,
a PreferenceManager has been created, which instantiates the Screen.
The desired Preference is added to the Screen with the testing key.
Rather than using a shadow XML, contexts' resources are mocked.
A mock WifiManager is used instead of a shadow
Duplicate test case removed, and test which succeeds locally but
not on cuttlefish marked as ignored for now.
Bug: 175389659
Test: atest -c DeviceNamePreferenceControllerTest
Change-Id: I643b22993a1d102614fed1883af7f4925947be20
There are couple of newly explored concepts in this CL, which will
hopefully be useful for migrating other tests in the future as well. In
broad strokes, the changes to this file cover:
Android build file species the preferences library, in order to access
PreferenceViewHolder.createInstanceForTests.
Resource ids in JUnit tests differ from the Settings apk. This is true
not only of strings but also views and layouts. Helper functions added
to main class to access the layouts needed by the test.
Shadow activities are not needed to view layouts, the context can be
used.
Context startActivity can be mocked and verified in order to capture and
examine the intent created by the library under test.
Bug: 175389659
Test: atest -c DataUsageSummaryPreferenceTest
Change-Id: Ib8cb87f0299c47a32c3f5d3af7edb20592b727ec
The superclass ContentProvider's "getContext" method is final and
cannot be mocked, so a helper method visible for testing was added
to allow for context injection.
Bug: 175389659
Test: atest -c ModuleLicenseProviderTest
Change-Id: I9e20171340ae0a48d74fae44c7b356ea67dba43b
Connection through new CDS APIs to come once that CL is merged.
Bug: 168065315
Test: atest SettingsUnitTests:com.android.settings.accessibility.ReduceBrightColorsIntensityPreferenceControllerTest
Change-Id: I9cc6a20ea5ea8a11c5fb3ef8a36e372d9c12b4bc
Add goldmanj to tests/unit for junit migration and
utility library creation
Add connectivity settings eng to settings/datausage.
Test: N/A, just owners update
Change-Id: I182ad6093677dc151b171d9e5aaa15cdd353c474
This change do the 2 things:
1. Add new junit tests files which replace robolectric
RobolectricTestRunner & RuntimeEnvironment with
AndroidX objects without problem.
2. Remove the robolectric test files which have it's new junit files.
This change migrate 103 files, there are still 1209
files to go.
Bug: 174728471
Test: atest
make RunSettingsRoboTests
Change-Id: I15ed3f4745b85862f720aabbf710ce1475aced93
- The AirplaneSafeNetworksSliceTest should restore Airplane Mode state
after tear down
- Create AirplaneModeRule to backup/restore Airplane Mode state
automaticlly
- Plan to reuse the AirplaneModeRule for other test case
Bug: 173413889
Test: atest -c AirplaneSafeNetworksSliceTest
Change-Id: Id142cf6302a188e6d82b44fcf29a395dc21f6013
note that this class contains a state machine of the subscription
information cache. The mock subscription manager must present
subscriptions in order for an update intent to result in a change
notifcation.
Bug: 175389659
Test: atest -c ActiveSubsciptionsListenerTest
Change-Id: I8cd2bd5d5b7b1539f421822ba77ed3d8e0ac493b
Biggest difference here: the use of a MockContentProvider
Bug: 175389659
Test: atest -c PreferredNetworkModeContentObserverTest
Change-Id: I891620118f7e84aa1c7f9e0ccdaeb21a225dc31a
Test is currently failing due to no methods present. Since we want
the controller to be unavailable for now, I chose to write a method
verifying that state.
Bug: 174566774
Test: atest -c CrossSimCallingPreferenceControllerTest
Change-Id: Iced0ac7bbd3482907312182a632dcf3215c55391
android.test.UiThreadTest has been deprecated.
This is a change migrate it into androidx.test.annotation.UiThreadTest
Bug: 174832214
Change-Id: I38f35e7602a269a018510723c199a7259d704b4e
Test: atest -c MobileNetworkSwitchControllerTest
- Hide slice when Airplane Mode is off
- Show slice when Airplane Mode is on
- Show "View airplane-safe networks" when Wi-Fi is disabled
- Show "Turn off Airplane Mode" when Wi-Fi is enabled
- Tap "View airplane-safe networks" will set Wi-Fi enabled
- Tap "Turn off Airplane Mode" will set airplane Mode off
- Plan to update the slice to Button style in next cl
- Screenshot
https://screenshot.googleplex.com/7wHoqvTjaScHXVm
Bug: 173413889
Test:
- atest -c AirplaneSafeNetworksSliceTest
- adb shell am start -a
android.settings.panel.action.INTERNET_CONNECTIVITY
Change-Id: Idcd70348728db2da91582697aaeb4bbf4da117c6