Commit Graph

783 Commits

Author SHA1 Message Date
TreeHugger Robot
b7076d5d5e Merge "[Provider Model] Implement the carrner network selection settings" 2021-01-06 14:25:46 +00:00
Julia Reynolds
d41f2db9ec Migrate NLS access to preferencecontrollers
In preparation for some new settings

Test: RoboTests
Bug: 173052211
Change-Id: I57c692d7ff0a1a8e36fb9e3f6c159263997fdc71
2021-01-06 14:23:59 +00:00
Weng Su
e9f4928ef1 [Provider Model] Internet Panel UI update
- Add gear icon to connected non-carrier network

- Update "View airplane mode networks" wording

- Update "Turn off airplane mode" wording

- Check WiFi disable to show airplane mode message

- Screenshot
  https://screenshot.googleplex.com/BRjcKyMaMS4ujYN

Bug: 173413889
Test:
- Manual Test
- adb shell am start -a
android.settings.panel.action.INTERNET_CONNECTIVITY

Change-Id: Icf7b77e514cffa68cf103dbc9e7df93d58f9f762
2021-01-06 02:11:46 +00:00
Weng Su
5e76c02d82 [Provider Model] Implement the carrner network selection settings
- Add WifiPickerTrackerHelper to reuse the library

- User taps on carrier network preference
  - Calls MergedCarrierEntry#connect()

- User toggles mobile data On/Off
  - Calls MergedCarrierEntry#setEnabled(true/false)

Bug: 175761096
Test:
- Manual Test
- atest NetworkMobileProviderControllerTest \
        SubscriptionsPreferenceControllerTest \
        WifiPickerTrackerHelperTest

Change-Id: Ia311b10ca7a44a536556c1889ee65743af379822
2021-01-05 15:05:24 +00:00
TreeHugger Robot
6653b25aaa Merge "Revert "Add Hotspot WPA3 Settings"" 2021-01-01 00:00:47 +00:00
bsears
598ab32345 Revert "Add Hotspot WPA3 Settings"
This reverts commit e0062af10c.

Reason for revert: Bug 176569060 - Droidfood blocking crash in Settings app.

Change-Id: Id50c96e8ce704b19e5ffb9b9a9fcbb0db2d81aee
2020-12-31 21:16:51 +00:00
Weng Su
b6a5141953 Merge "Add Hotspot WPA3 Settings" 2020-12-30 03:09:00 +00:00
Tom Hsu
36ecdd496c Merge "[Provider model] Internet picker Part II" 2020-12-29 14:23:14 +00:00
tom hsu
65f8aa2f7b [Provider model] Internet picker Part II
- 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
2020-12-29 19:48:21 +08:00
Weng Su
e0062af10c Add Hotspot WPA3 Settings
- Add WPA3 SAE security types
  - "WPA3-Personal"
  - "WPA2/WPA3-Personal"

- Verify valid WPA3 password

- Enable QR code scanner for Hotspot WPA3

- Screenshot
  https://screenshot.googleplex.com/B6u54wh8w35Xnyf
  https://screenshot.googleplex.com/8hWHHUTb6UaS9vB

Bug: 167968488
Test:
- Manual Test
- atest WifiTetherSecurityPreferenceControllerTest
- atest WifiUtilsTest

Change-Id: I155ed0bfd187d27ba864f9fb1b78d08c437740f3
2020-12-29 08:04:10 +00:00
Weng Su
74b18587fb [Provider Model] Implement the carrner network selection
- Add primaryAction for connecting carrier network

- User toggles carrier network On/Off
  - Calls MergedCarrierEntry#setEnabled(true/false)

- User taps on carrier network
  - Calls MergedCarrierEntry#connect()

Bug: 175761096
Test:
- Manual Test
- atest ProviderModelSliceTest
- atest ProviderModelSliceHelperTest
- make RunSettingsRoboTests ROBOTEST_FILTER=WifiScanWorkerTest

Change-Id: I07cb6c142a2f4e9cbdbab1f77afdc367728b4e3f
2020-12-28 13:23:24 +00:00
SongFerng Wang
a12003a9ac Merge changes from topic "Slice of Provider Model"
* changes:
  Slice of Provider Model: add slice structure
  The helper for slice of carrier and non-Carrier, used by ProviderModelSlice.
2020-12-23 18:47:15 +00:00
SongFerngWang
8cad0197bd Slice of Provider Model: add slice structure
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
2020-12-23 17:47:45 +08:00
SongFerngWang
a97b4faa67 The helper for slice of carrier and non-Carrier, used by ProviderModelSlice.
create a helper file.
create a res/drawable/ic_signal_strength_zero_bar_no_internet.xml
create string at res/values/strings.xml

Bug: 173971144
Test: atest ProviderModelSliceHelperTest
Change-Id: I7f63a6b04784325989e776cb140017314ebde4ce
2020-12-22 21:50:40 +08:00
Jeremy Goldman
6625f03eca DeviceNamePreferenceControllerTest converted to JUnit
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
2020-12-22 00:38:33 +00:00
Jeremy Goldman
04eeb1e5e3 Merge "ModuleLicenseProviderTest converted to JUnit" 2020-12-21 07:38:51 +00:00
Jeremy Goldman
7d5483f6d7 Merge "Enhanced4gLteSliceHelper specifies immutable intent" 2020-12-21 07:25:30 +00:00
Jeremy Goldman
8320f7459b Merge "DataUsageSummaryPreferenceTest converted to JUnit" 2020-12-21 06:21:22 +00:00
Jeremy Goldman
50dd14d111 Enhanced4gLteSliceHelper specifies immutable intent
Bug: 172812686
Fixes: 172207848
Test: atest -c Enhanced4gLteSliceHelperTest
Change-Id: I1bfac82e3ce5c66639465befb0517839fb55415e
2020-12-21 05:41:01 +00:00
Jeremy Goldman
e068542f53 SimStatusDialogControllerTest converted to JUnit
Bug: 175389659
Test: atest -c SimStatusDialogControllerTest
Change-Id: Id2cfb01714f1756f9251b2319d83a1609488b0f6
2020-12-21 04:45:13 +00:00
Jeremy Goldman
ae03dd39da DataUsageSummaryPreferenceTest converted to JUnit
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
2020-12-21 12:39:02 +08:00
Jeremy Goldman
471659f30d ModuleLicenseProviderTest converted to JUnit
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
2020-12-18 12:06:16 +00:00
Christine Franks
007e0a8e69 Merge "Connect reduce bright colors settings" 2020-12-17 17:55:17 +00:00
Jeremy Goldman
bcca2b19dd Merge "Owners updates" am: 59465ee9d3 am: 2b1b458f1a am: e6765a0dc8
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1531440

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3aef110b7826093819576162c37974426afdb8a9
2020-12-17 13:28:41 +00:00
Jeremy Goldman
e6765a0dc8 Merge "Owners updates" am: 59465ee9d3 am: 2b1b458f1a
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1531440

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I308590ad0678932d17660264de8f7a81918bd371
2020-12-17 13:16:21 +00:00
Christine Franks
94f3cb0f2d Connect reduce bright colors settings
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
2020-12-17 01:06:36 -08:00
Peter Wang
5eb94b4a00 Merge "Added an option in reset menu in Settings to enable resetting Euicc data only" 2020-12-16 20:03:25 +00:00
Jeremy Goldman
6efeeaafec Owners updates
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
2020-12-16 10:40:49 +00:00
Arc Wang
62c78ff3fa Migrate robolectric tests to junit tests
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
2020-12-16 11:17:57 +08:00
Peter Wang
ecd856eeeb Added an option in reset menu in Settings to enable resetting Euicc data
only

Bug: 159650638
Fix: 159650638
Test: Local
Change-Id: Ia260b47a4dd0ddf0363740891b5e1d818c8631b7
2020-12-15 18:27:34 -08:00
TreeHugger Robot
d05ee585dc Merge "[Provider Model] Refactor AirplaneSafeNetworksSliceTest" 2020-12-14 10:31:45 +00:00
Weng Su
732cdb42b2 [Provider Model] Refactor AirplaneSafeNetworksSliceTest
- 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
2020-12-14 07:20:32 +00:00
Jeremy Goldman
11f91e47ea Merge "Enhanced4gBasePreferenceControllerTest migrated to junit" 2020-12-14 02:58:24 +00:00
Jeremy Goldman
f36154fe6c Merge "ActiveSubsciptionsListenerTest converted to junit" 2020-12-14 02:52:33 +00:00
Jeremy Goldman
f36d82f5fe Merge "Settings JUnit test for PreferredNetworkModeContentObserverTest" 2020-12-14 02:52:16 +00:00
Bonian Chen
c3d818653a Merge "Add test case for CrossSimCallingPreferenceControllerTest" 2020-12-12 11:31:16 +00:00
Jeremy Goldman
4348c2c826 Enhanced4gBasePreferenceControllerTest migrated to junit
Bug: 175389659
Test: atest -c Enhanced4gBasePreferenceControllerTest
Change-Id: I7ebcb303eb74168b81dd650fe78f3988647aa64d
2020-12-12 01:11:13 +08:00
Jeremy Goldman
bb811a5aff ActiveSubsciptionsListenerTest converted to junit
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
2020-12-11 16:23:40 +00:00
Jeremy Goldman
e18207b951 Settings JUnit test for PreferredNetworkModeContentObserverTest
Biggest difference here: the use of a MockContentProvider

Bug: 175389659
Test: atest -c PreferredNetworkModeContentObserverTest
Change-Id: I891620118f7e84aa1c7f9e0ccdaeb21a225dc31a
2020-12-11 16:23:33 +00:00
Jeremy Goldman
1e87a55215 Add test case for CrossSimCallingPreferenceControllerTest
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
2020-12-12 00:22:45 +08:00
Zoey Chen
44559badaf [Provider Model] Should show "No SIM" if there is no SIM in the device.
Bug: 172053880
Test: atest NetworkProviderCallsSmsControllerTest#getSummary_noSim_returnNoSim
Change-Id: I31fd8b4b6928ef8aa7c45ac7651fa26e0b08446e
2020-12-11 20:29:13 +08:00
Jiashen Wang
ea5ef92219 Merge "[SIM Dialog Migration] Enable SIM operation dialog in Settings" 2020-12-07 18:31:02 +00:00
Weng Su
cdb843d932 Merge "[Provider Model] Add Airplane-safe networks slice" 2020-12-07 06:23:55 +00:00
Jiashen Wang
8271561a76 [SIM Dialog Migration] Enable SIM operation dialog in Settings
Change Settings to not call SubscriptionManager#setSubscriptionEnabled.
Instead, make Settings call EuiccManager APIs directly.
Design: https://docs.google.com/document/d/1wb5_hoBkZVbkXGNWHbx4Jf61swjfxsJzkytiTzJosYo/edit?usp=sharing
Bug: 160819390
Test: Manually tested eSIM profile enabling.

Change-Id: I56bbcbb9ccb886b0f9249e67c5a6a6444bb7dd45
2020-12-05 21:48:09 -08:00
Bonian Chen
eaabc5969e [Settings][Test] Fix Junit test failure - MobileNetworkSwitchControllerTest
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
2020-12-04 12:51:10 +00:00
Weng Su
96af1674f8 [Provider Model] Add Airplane-safe networks slice
- 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
2020-12-03 13:29:56 +00:00
Tom Hsu
011aeced5b Merge "Internet Picker implementation." 2020-11-30 03:01:09 +00:00
Weng Su
b263d3a136 Merge "[Provider Model] Add Airplane-safe Networks preference" 2020-11-30 02:14:34 +00:00
Weng Su
845db3499d [Provider Model] Add Airplane-safe Networks preference
- Hide the preference when airplane mode is off.

- Reuse PrimarySwitchPreference for RestrictedSwitchPreference

- Screenshot
  https://screenshot.googleplex.com/8HiC5sc8xaqnhz5

Bug: 174022082
Test: atest -c AirplaneSafeNetworksPreferenceControllerTest
Change-Id: I06a56e8e815778cebf200c4a486c414e92f4cb87
2020-11-28 16:22:10 +00:00
tom hsu
95b1d7cbbd Internet Picker implementation.
This version is to resolve the Reverted CL, ag/13127781
and make NetworkProviderSettingsTest passed

 Show mobile network on internet page

 With mobile network
  - https://screenshot.googleplex.com/7HzGhnbpitErynY

 Without mobile network
  - https://screenshot.googleplex.com/8sNVggTpKEhKeRh

Class diff: https://diff.googleplex.com/#key=WosyTF0ANVMf

Doc: https://docs.google.com/presentation/d/1azrZVS54pxM2lt9LkZHtFh_6W3fyDw_kTTPVQ_mJCi4/edit#slide=id.g9c7123c172_0_448

Bug: 173105859
Test: atest NetworkMobileProviderControllerTest passed
Test: make RunSettingsRoboTests ROBOTEST_FILTER=SubscriptionsPreferenceControllerTest passed
Test: make RunSettingsRoboTests ROBOTEST_FILTER=NetworkProviderSettingsTest passed

Change-Id: Ib0bdd148424881353f18307cb83798b4217060fc
2020-11-27 14:20:03 +00:00