Commit Graph

71903 Commits

Author SHA1 Message Date
Chiachang Wang
eedfa1d307 Remove hidden connectivity methods access
This commit resolves the hidden methods accesses for
LinkProperties, IpConfiguration and RouteInfo with atlernative
way for the connectivity mainline module preparation.

Bug: 172183305
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.details2.WifiDetailPreferenceController2Test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.details.WifiDetailPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.UtilsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.WifiConfigController2Test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
com.android.settings.wifi.WifiConfigController2Test

Change-Id: Iec4dab5d9fa12dedcf69a1cfe2a8be0956bc0d79
Merged-In: Iec4dab5d9fa12dedcf69a1cfe2a8be0956bc0d79
2021-03-18 22:25:05 +08:00
Chiachang Wang
efa884758b Merge "Update mocking to correct target methods" 2021-03-18 13:16:14 +00:00
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
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
dd61e5d664 Merge "Replace the way to access StaticIpConfiguration" 2021-03-18 00:23:14 +00: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
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
5ee7a7d07d Merge "Change the parameter type from ContentResolver to Context" 2021-03-17 06:35:21 +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
159f261889 Merge "Use getPrivateDnsMode() to get the value of private DNS" 2021-03-16 07:39:35 +00:00
Treehugger Robot
56834d2ce3 Merge "Add OWNER to network/datausage/wifi path" 2021-03-15 11:02:28 +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
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
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
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
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
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
Janis Danisevskis
146a0dab01 Keystore 2.0: Make Legacy VPN settings ready for Keystore 2.0
Keystore 2.0 no longer stores vpn profiles. It still offers a
Legacy VPN profile store, to access existing profiles.

Test: N/A
Bug: 171305607
Bug: 171305388
Merged-In: I40dea0b9c3824b56814ae4c2fb6c7663c7d97af5
Change-Id: I40dea0b9c3824b56814ae4c2fb6c7663c7d97af5
2021-03-03 22:30:48 -08:00
Janis Danisevskis
e92bcb3287 Keystore 2.0: Update Wifi settings to use mostly public keystore API.
Test: N/A
Bug: 171305607
Bug: 171305388
Merged-In: Ib794c5f2d904c2b187d7d5fd00b81afc852d0052
Change-Id: Ib794c5f2d904c2b187d7d5fd00b81afc852d0052
2021-03-03 22:30:35 -08:00
SongFerng Wang
cbc2c4f102 Merge changes I89162011,I110727b6,I1778832b
* changes:
  Settings JUnit test for PreferredNetworkModeContentObserverTest
  [Testing] Use AndroidJUnit4 instead in telephony/cdma/ test files
  [Testing] Use AndroidJUnit4 instead in MobileNetworkUtilsTest
2021-03-04 06:17:31 +00:00
Xin Li
6b94f5ac81 Merge "Merge RQ2A.210305.007" 2021-03-03 21:41:36 +00:00
Xin Li
2aa4fea82d Merge RQ2A.210305.007
Bug: 180401296
Merged-In: I12e20519ac29f802f9983dcf27f313388b33829c
Change-Id: I8ca0bb7173f6abe08596422b281f6913b66ab9b7
2021-03-03 09:12:21 -08:00
Jeremy Goldman
3611c3e22f Settings JUnit test for PreferredNetworkModeContentObserverTest
Biggest difference here: the use of a MockContentProvider

Bug: 175389659
Test: atest -c PreferredNetworkModeContentObserverTest
Change-Id: I891620118f7e84aa1c7f9e0ccdaeb21a225dc31a
Merged-In: I891620118f7e84aa1c7f9e0ccdaeb21a225dc31a
2021-03-03 23:39:07 +08:00
changbetty
fbb61ba4d0 [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
Merged-In: I110727b643a6755ee888708bd1fb2a39cf524a2d
2021-03-03 23:35:43 +08:00
changbetty
2e763e52cf [Testing] Use AndroidJUnit4 instead in MobileNetworkUtilsTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change the Copy Right
4. Create the real object for PhoneAccountHandle and ComponentName

Bug: 164989754
Test: atest -c MobileNetworkUtilsTest
Change-Id: I1778832b0602062adb24928343c0c1d0e525942d
Merged-In: I1778832b0602062adb24928343c0c1d0e525942d
2021-03-03 23:33:00 +08:00
Paul Hu
2b1e3a971f Merge "Update Utils#getTetheringLabel usage on Settings" 2021-03-03 02:15:22 +00:00
Sudheer Shanka
90f59be59a Merge "Update DataSaverBackend to use NetworkPolicyManager.Listener." 2021-03-02 21:55:30 +00:00
Treehugger Robot
9059706e7b Merge "Wellbeing Package needs to be enabled by default" am: b6dc427c50
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1587086

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I12e20519ac29f802f9983dcf27f313388b33829c
2021-03-02 19:05:16 +00:00
Sudheer Shanka
0a476f5f53 Update DataSaverBackend to use NetworkPolicyManager.Listener.
This will avoid having to update this every time we
add a new callback.

Test: treehugger
Change-Id: Ic34e3eac87d207eb2ffff7430fdf3b77871ae812
2021-03-02 13:05:43 +00:00
Treehugger Robot
b6dc427c50 Merge "Wellbeing Package needs to be enabled by default" 2021-03-02 06:09:37 +00:00
paulhu
2a5051e4fd Update Utils#getTetheringLabel usage on Settings
Utils#getTetheringLabel() is using TetheringManger to get
tetherable interface. So update the usage on Settings.

Bug: 180693313
Test: atest SettingsRoboTests
Change-Id: I1907743ed13c333ecbafd25b6dd9276fe692f2ea
2021-03-02 03:57:34 +00:00
Naga Venkata Durga Ashok Mutyala
f76cd69793 Wellbeing Package needs to be enabled by default
Add the wellbeing application to keepEnabledPackages.
so, it will prevent the users to disable explicitly.

Test: NA
Bug: 180078180
Change-Id: I2645f30fac60106410eaf2126c10d8ab804fd1b7
2021-02-26 15:09:55 +00:00
Treehugger Robot
08bea2183d Merge "Keystore 2.0: Update credential settings to use public Keystore API." am: 7086917968
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1569700

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I31b4a6e88530092dc2849dc4fb7e09c0d5463db3
2021-02-26 03:55:00 +00:00
Treehugger Robot
7086917968 Merge "Keystore 2.0: Update credential settings to use public Keystore API." 2021-02-26 01:50:16 +00:00
Janis Danisevskis
a05bd65cb6 Keystore 2.0: Update credential settings to use public Keystore API.
Test: N/A
Bug: 171305607
Bug: 171305388
Change-Id: I377115aca6b2df8052ae118f986c2f713535b6ec
2021-02-25 15:58:22 -08:00