Commit Graph

72063 Commits

Author SHA1 Message Date
Chiachang Wang
6290ad9509 Update mocking to correct target methods
The correct target context should use the mActivity in
MobileNetworkSettingsTest, so that the mocking for
telephony service could correctly applied.

Both AutoTimeZonePreferenceControllerTest and
BasebandVersionPreferenceControllerTest refer to the lib
implemented shadow Connectivitymanager but that does not
the correct reference after utils class being updated.
Update the test logic inside to refer to correct method.
The reference to ShadowConnectivityManager does not needed
anymore so remove it from the test.

Fix: 183068151
Fix: 183067742
Fix: 183068139
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.network.telephony.MobileNetworkSettingsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.datetime.AutoTimeZonePreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings\
.deviceinfo.firmwareversion.BasebandVersionPreferenceControllerTest

Change-Id: I15ecc6aab7d530d20cd23b06267cc184a2c62b40
2021-03-18 14:53:07 +08:00
Treehugger Robot
207fa629bc Merge "Replace hidden CM#isNetworkSupported() usage" am: 959325e88a
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1639940

Change-Id: I7aa0702f04c1f876851661ea54ba289b5eb9234d
2021-03-18 03:25:20 +00:00
Chiachang Wang
3ad73342c7 Merge "Replace the hidden ProxyInfo methods usage" am: 2f66e59e05
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1641827

Change-Id: If019c9b540f58e82b250693ed05dfabcda2c7c66
2021-03-18 03:19:28 +00:00
Treehugger Robot
959325e88a Merge "Replace hidden CM#isNetworkSupported() usage" 2021-03-18 02:39:21 +00:00
Chiachang Wang
2f66e59e05 Merge "Replace the hidden ProxyInfo methods usage" 2021-03-18 02:37:00 +00:00
Chiachang Wang
cda53ebeae Merge "Replace the way to access StaticIpConfiguration" am: dd61e5d664
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1641821

Change-Id: I6794a8d8113b5167b24e875554bc54b9155dd97f
2021-03-18 00:42:40 +00:00
Chiachang Wang
dd61e5d664 Merge "Replace the way to access StaticIpConfiguration" 2021-03-18 00:23:14 +00:00
Peter Wang
66fd9dbad2 Added an option in reset menu in Settings to enable resetting Euicc data
only

Bug: 159650638
Fix: 159650638
Test: Local
Change-Id: Ia260b47a4dd0ddf0363740891b5e1d818c8631b7
Merged-In: Ia260b47a4dd0ddf0363740891b5e1d818c8631b7
2021-03-17 15:47:48 -07:00
Chiachang Wang
d507dc19b1 Replace hidden CM#isNetworkSupported() usage
It's a refactor work for connectivity mainline module. The
hidden methods access is no longer allowed, so the usage for
isNetworkSupported() should be replaced. Settings use it to
check if device support telephony, wifi or ethernet service.
There are alternative methods to check if device supports such
features. Replace as it is.

Bug: 172183305
Test: m ; make RunSettingsRoboTests
Change-Id: I8f1d11558b1be575a0777ed195abe027e838cb74
Merged-In: I8f1d11558b1be575a0777ed195abe027e838cb74
2021-03-17 15:22:40 +00:00
SongFerngWang
2166de23f3 Change the behavior of notifyAllowedNetworkTypesChanged.
Bug: 180903931
Test: atest AllowedNetworkTypesListenerTest.java
Change-Id: Ic94816415920bf25896ef2b198e228f369039c94
Merged-In: Ic94816415920bf25896ef2b198e228f369039c94
2021-03-17 21:20:21 +08:00
Chiachang Wang
eb16ebd14a Replace the hidden ProxyInfo methods usage
The hidden ProxyInfo methods usage should be replaced because
ProxyInfo is moving to connectivity mainline module. Setting
will not be able to access it. Replace the usage with
corresponding APIs.

Bug: 172183305
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
      com.android.settings.wifi.WifiConfigControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
      com.android.settings.wifi.WifiConfigController2Test
Test: manually update proxy from setting and check the result
Change-Id: I59192d0d5d38c833eb83cc930e358a738ebe3d13
2021-03-17 12:47:22 +00:00
Chiachang Wang
b16da1a9ca Replace the way to access StaticIpConfiguration
StaticIpConfiguration is a part of incoming connectivity
mainline module. The hidden variable is not accessible for
module outside. The caller should use getter and builder
to access it. Replace the usage with the formal way.

Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
      com.android.settings.wifi.WifiConfigControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
      com.android.settings.wifi.WifiConfigController2Test
Change-Id: I2ccd427ba19a4ec7df863c38ee0b34cf0be87fa5
2021-03-17 11:30:11 +00:00
Lucas Lin
ddbd32432e Merge "Change the parameter type from ContentResolver to Context" am: 5ee7a7d07d
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1639939

Change-Id: I2492c9b4e7bb5b34ad6b3719525e8b00433d2778
2021-03-17 07:02:17 +00:00
Lucas Lin
5ee7a7d07d Merge "Change the parameter type from ContentResolver to Context" 2021-03-17 06:35:21 +00:00
Bonian Chen
49cdb602ea [Settings] Support getSystemService(Class<T>)
Add getSystemService(Class<T>) to align the capability with framework
part.

Bug: 179640862
Test: local
Change-Id: I278951c2402aa8551cee37923f45626ab1830dd3
2021-03-17 13:32:32 +08:00
Bonian Chen
c27980c1a9 Merge "[Settings] Code refactor - remove unused import lines" am: d248042a02
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1639941

Change-Id: I365757ae7bb17cabb39e377eb23aaf4ac97013b9
2021-03-16 14:09:39 +00:00
Bonian Chen
d248042a02 Merge "[Settings] Code refactor - remove unused import lines" 2021-03-16 13:47:28 +00:00
Bonian Chen
203f0fe89d [Settings] Code refactor - remove unused import lines
Remove some unused import lines within source code based on
https://source.android.com/setup/contribute/code-style

Bug: 182867979
Test: build pass
Change-Id: I76dbcfa9e5b435b2838401dfee15b12f472d07d0
2021-03-16 10:24:24 +00:00
lucaslin
11e738c3a0 Change the parameter type from ContentResolver to Context
Context is more useful than ContentResolver, it can provide more
information if we want to change the behavior in the future.

Bug: 172183305
Test: make RunSettingsRoboTests \
      ROBOTEST_FILTER=PrivateDnsPreferenceControllerTest
Test: make RunSettingsRoboTests \
      ROBOTEST_FILTER=PrivateDnsModeDialogPreferenceTest
Change-Id: I6c06460b67f81112db311f0739457d5f1e2e4554
Merged-In: I6c06460b67f81112db311f0739457d5f1e2e4554
2021-03-16 09:36:12 +00:00
Lucas Lin
73c971a5af Merge "Use getPrivateDnsMode() to get the value of private DNS" am: 159f261889
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1620600

Change-Id: I2ce646a34a7fc521b42c221faadfe6779f1c5ca4
2021-03-16 08:06:34 +00:00
Lucas Lin
159f261889 Merge "Use getPrivateDnsMode() to get the value of private DNS" 2021-03-16 07:39:35 +00:00
Treehugger Robot
c38b502c4a Merge "Add OWNER to network/datausage/wifi path" am: 56834d2ce3
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1635179

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4d177c825df890a2d8947173e85ddd401e9f7361
2021-03-15 11:30:18 +00:00
Treehugger Robot
56834d2ce3 Merge "Add OWNER to network/datausage/wifi path" 2021-03-15 11:02:28 +00:00
Chiachang Wang
201429b683 Merge "Replace the hidden getActiveLinkProperties usage" am: d709b55250
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1635200

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3d7e876c9fb8bf81a300b6b76154672e0d3b04c7
2021-03-15 10:14:46 +00:00
Chiachang Wang
d709b55250 Merge "Replace the hidden getActiveLinkProperties usage" 2021-03-15 09:42:16 +00:00
Chiachang Wang
fd1fa9c0a8 Replace the hidden getActiveLinkProperties usage
It's a refactor work to remove the hidden connectivity method
usages outside the incoming connectivity module.

CM#getActiveLinkProperties is hidden and no longer supported
outside the module. Caller should replace it with
CM#getLinkProperties(Network), so replace the usage as it is.

Bug: 172183305
Test: m
Change-Id: I20bcc9da97113da352e43a87d029596c9729cad8
2021-03-15 09:07:48 +00:00
Betty Chang
ebea5200cb Add OWNER to network/datausage/wifi path
Change-Id: I30ca24ea0823378d18b39a2eae937378662f6c14
2021-03-15 06:39:14 +00:00
Jeremy Goldman
22b94fb3fd Add goldmanj to the Settings' vpn2 directory Owners file
Change-Id: I91f560230a5dde1014a18c3d3bd03d1ed6f91dd6
2021-03-15 03:20:32 +00:00
Treehugger Robot
dac69ccd8f Merge "Update src/com/android/settings/inputmethod/OWNERS" am: e9dff191b0
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1624591

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I74024fbb550f8c405f2850bd20b90599370b0bad
2021-03-11 00:58:01 +00:00
Treehugger Robot
e9dff191b0 Merge "Update src/com/android/settings/inputmethod/OWNERS" 2021-03-10 23:05:57 +00:00
Yohei Yukawa
5878a77218 Update src/com/android/settings/inputmethod/OWNERS
Let's update this legacy OWNERS file based on the current reality.

Hopefully this would make it easier for contributers to find available
owner reviewers.

Fix: 182385491
Test: n/a
Change-Id: If47b5c0b83d561dceacc58c8fbd3643524432d62
2021-03-10 10:37:51 -08:00
Zoey Chen
6003cb977f Merge "[Telephony] Use TelephonyCallback instead of PhoneStateListener part5" am: 9abf2bff3b
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1620520

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I98e70590d8d29451f0906f09e3d90e847e74d9f7
2021-03-09 11:21:49 +00:00
Zoey Chen
9abf2bff3b Merge "[Telephony] Use TelephonyCallback instead of PhoneStateListener part5" 2021-03-09 10:35:53 +00:00
lucaslin
f2e03475b3 Use getPrivateDnsMode() to get the value of private DNS
PRIVATE_DNS_DEFAULT_MODE_FALLBACK has removed, use
ConnectivityManager#getPrivateDnsMode() to get the value of
private DNS instead of querying settings and implementing logic
by itself.

Bug: 172183305
Test: make RunSettingsRoboTests \
      ROBOTEST_FILTER=PrivateDnsPreferenceControllerTest
Test: make RunSettingsRoboTests \
      ROBOTEST_FILTER=PrivateDnsModeDialogPreferenceTest
Change-Id: I024c3ddfb85f4c3d177e2e99294c998d81d4e08d
Merged-In: I024c3ddfb85f4c3d177e2e99294c998d81d4e08d
2021-03-08 08:19:28 +00:00
Ahaan Ugale
6d5dc7b451 Merge "OWNERS for autofill and assist settings." am: 7af352dc73
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1621607

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iba9dab65368e117fded8d1ff93455c274fffcaa0
2021-03-08 06:31:53 +00:00
Ahaan Ugale
7af352dc73 Merge "OWNERS for autofill and assist settings." 2021-03-08 05:47:48 +00:00
Ahaan Ugale
1014194897 OWNERS for autofill and assist settings.
tests/unit/../autofill is empty here; new files are being added in the
internal repo.

Change-Id: Ia4aaa395b01147ee0597cca6075aae0121de7dd9
Test: n/a
2021-03-07 00:40:15 +00:00
Janis Danisevskis
bae6535b75 Merge "Keystore 2.0: Make Legacy VPN settings ready for Keystore 2.0" am: 3c7b085331
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1569702

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0f252dc43dfc8494e7cceb3b559b7252cd99697c
2021-03-05 05:17:11 +00:00
SongFerng Wang
29594edb70 Merge "Replace allowedNetworkTypes with allowedNetworkTypesForReason" am: 6775f40664
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1614990

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ieb1dc1653e5d33d4f21760aabb203cf40adcbdba
2021-03-05 05:00:14 +00:00
Treehugger Robot
c4f1bd9675 Merge "Keystore 2.0: Update Wifi settings to use mostly public keystore API." am: 32d2075fa3
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1569701

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0873d00dc15ffae3ac08ada37986a724bf825780
2021-03-05 04:26:16 +00:00
Zoey Chen
bf1857e4a5 [Telephony] Use TelephonyCallback instead of PhoneStateListener part5
Since the redesign of PhoneStateListener, use TelephonyCallback to get the callback of EVENT_*

Bug: 167684594
Test: make and atest NetworkProviderWorkerTest
Change-Id: I52af54045872bbf13e64d5d94c8b027ec702abb9
Merged-In: I52af54045872bbf13e64d5d94c8b027ec702abb9
2021-03-05 11:46:46 +08:00
Janis Danisevskis
3c7b085331 Merge "Keystore 2.0: Make Legacy VPN settings ready for Keystore 2.0" 2021-03-05 02:57:34 +00:00
SongFerng Wang
6775f40664 Merge "Replace allowedNetworkTypes with allowedNetworkTypesForReason" 2021-03-05 01:59:53 +00:00
Treehugger Robot
32d2075fa3 Merge "Keystore 2.0: Update Wifi settings to use mostly public keystore API." 2021-03-05 00:02:28 +00:00
SongFerng Wang
d5ff766ed8 Merge changes Ia99a4cf4,Ib31e23b8 am: 191136002b
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1618689

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ife74a181399e5c10866b92663f56a2e0077bc9c4
2021-03-04 13:11:01 +00:00
SongFerngWang
18c15a2545 Use SubscriptionManager.getResourcesForSubId to get Resources am: 766f78e8ed
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1618688

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0892ae8b68eff489e2274aad56588d3c918a369e
2021-03-04 13:10:46 +00:00
SongFerngWang
fc435e3736 Replace allowedNetworkTypes with allowedNetworkTypesForReason
- Replace getAllowedNetworkTypes with
getallowedNetworkTypesForReason(ALLOWED_NETWORK_TYPES_REASON_CARRIER)
- Replace "Settings.Global.PREFERRED_NETWORK_MODE" with
"getAllowedNetworkTypesForReason(USER)"
- Move EnabledNetworkModePreferenceControllerTest from robotests to unit
- Replace KEY_NR_ENABLED_BOOL with KEY_CARRIER_NR_AVAILABILITY_INT
- Rename PreferredNetworkModeContentObserver to AllowedNetworkTypesListener
Bug: 161434786
Test: build pass.
(PASS)atest CdmaSystemSelectPreferenceControllerTest
(PASS)atest PreferredNetworkModePreferenceControllerTest
(PASS)atest AllowedNetworkTypesListenerTest
(PASS)atest EnabledNetworkModePreferenceControllerTest
(PASS)atest MobileNetworkUtilsTest

Change-Id: I2b981569ad11cf70a558c1952cc2e077464328d8
Merged-In: I2b981569ad11cf70a558c1952cc2e077464328d8
2021-03-04 19:20:04 +08:00
SongFerng Wang
191136002b Merge changes Ia99a4cf4,Ib31e23b8
* changes:
  [Testcase] To migration DisabledSubscriptionControllerTest
  Use SubscriptionManager.getResourcesForSubId to get Resources
2021-03-04 11:13:08 +00:00
SongFerngWang
1ffba4af4e [Testcase] To migration DisabledSubscriptionControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment
   to get context
3. Change Copy Right
4. remove the mock of PreferenceScreen

Bug: 173003522
Test: atest DisabledSubscriptionControllerTest.java
Change-Id: Ia99a4cf4618fcb32162485e7da5e48e3b313ce67
Merged-In: Ia99a4cf4618fcb32162485e7da5e48e3b313ce67
2021-03-04 09:41:56 +00:00
SongFerngWang
766f78e8ed Use SubscriptionManager.getResourcesForSubId to get Resources
To support multi-SIM card case. The code uses the
SubscriptionManager.getResourcesForSubId to get Resources.

Bug: 171843666
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
EnabledNetworkModePreferenceControllerTest

Change-Id: Ib31e23b81bdbd3b5336b45fc73994f40d021718b
Merged-In: Ib31e23b81bdbd3b5336b45fc73994f40d021718b
2021-03-04 09:41:31 +00:00