Commit Graph

43114 Commits

Author SHA1 Message Date
Chalard Jean
0aa49aa970 Merge "Replace mDeps with a custom object" am: 31ac212428
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1868567

Change-Id: I3aaea000117e45aa9ff12b408231eae6c52a93cd
2021-11-01 10:43:44 +00:00
Chalard Jean
31ac212428 Merge "Replace mDeps with a custom object" 2021-11-01 10:31:53 +00:00
Lucas Lin
3e7abf056d Merge "Add tests for testing if [start|finish]Op is called or not" am: 5bf4cd9a73
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1853600

Change-Id: Ifa83aca8d550948efd5e4795ca838580b1f9b8b3
2021-11-01 08:46:44 +00:00
Lucas Lin
5bf4cd9a73 Merge "Add tests for testing if [start|finish]Op is called or not" 2021-11-01 08:33:36 +00:00
Mark Chien
67a3201eb7 Merge "Log received wifiP2p intent into dumpsys for debugging" am: 3a5c822ec1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1873891

Change-Id: Icfda99fdbd0544b64733b2865163ce5af86f097f
2021-11-01 08:20:54 +00:00
Mark Chien
3a5c822ec1 Merge "Log received wifiP2p intent into dumpsys for debugging" 2021-11-01 08:04:55 +00:00
Chalard Jean
21f4f70d46 Replace mDeps with a custom object
Mockito's mocks are not thread-safe. The dependencies object
is used both on the test thread (to set it up) and in the CS
handler thread. This can't work with a mock.

Bug: 195626111
Test: ConnectivityServiceTest
Change-Id: Ia989dd71c3133513a90bc1d1957419fb1b74c300
2021-11-01 16:30:56 +09:00
Chalard Jean
d988d2c778 Move to f/l/n instead of RouteUtils am: adcec9ebbe
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1873892

Change-Id: I79801cb08d450eb671af7dc269a0476180c0deaa
2021-10-29 12:00:56 +00:00
Chalard Jean
adcec9ebbe Move to f/l/n instead of RouteUtils
Test: TetheringTests
Change-Id: I35b36538463a7fc2f02e142719c898d1694b2d6b
2021-10-29 16:05:46 +09:00
markchien
eb8599c4e3 Log received wifiP2p intent into dumpsys for debugging
Bug: 201480425
Test: m
Change-Id: I527c894eff3c068080995333ab8b372ab2aa38a0
2021-10-29 14:45:14 +08:00
Treehugger Robot
9b540a80b4 Merge "Improve logs in checkNrisConsistency" am: f58a955b37
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1872875

Change-Id: If7cb572f01551606024c2dbd3e77cb967f5d9ed6
2021-10-28 19:30:47 +00:00
Treehugger Robot
f58a955b37 Merge "Improve logs in checkNrisConsistency" 2021-10-28 19:09:27 +00:00
Remi NGUYEN VAN
b4923dd4e5 Merge "Add RequiresDevice to relevant tests" am: 8e58917bc3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1872873

Change-Id: I024ce824e37d00dea22b607119d87a875759619d
2021-10-28 08:48:32 +00:00
Remi NGUYEN VAN
8e58917bc3 Merge "Add RequiresDevice to relevant tests" 2021-10-28 08:30:44 +00:00
Chalard Jean
750ec86110 Merge "Apply a workaround, and try to detect a system crash" am: 65571769cd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1868846

Change-Id: I0fc4d9408438fa5d0da810ae710e6c92d821b8a5
2021-10-28 03:57:53 +00:00
Chalard Jean
65571769cd Merge "Apply a workaround, and try to detect a system crash" 2021-10-28 03:46:28 +00:00
Chalard Jean
ba551d4dbb Improve logs in checkNrisConsistency
Test: ConnectivityServiceTest
Change-Id: If5235443217ad4abbdd40e89d5721d4f7832d52f
2021-10-28 12:45:12 +09:00
Remi NGUYEN VAN
9a689f81f4 Add RequiresDevice to relevant tests
Replace SkipPresubmit with RequiresDevice on relevant tests, as
RequiresDevices is more standard and more specific.

This allows creating test configurations using virtual devices which are
not necessarily in presubmit.

Bug: 201014262
Test: TH needs to verify test mapping run with new annotation
Change-Id: I6758d2a41a9a987a5244e47e4795bc49889c4d61
2021-10-28 09:49:42 +09:00
Chalard Jean
524f0b1d7f Apply a workaround, and try to detect a system crash
This will prevent the system crash in b/194394697, and on T try to
detect the issue much earlier and crash the system at that time
together with much more expansive logs.

Bug: 194394697
Test: ConnectivityServiceTest
Change-Id: Ia4be82179160216d41bf4d88b896e4814385063a
2021-10-27 16:00:56 +09:00
Aaron Huang
bbb828ef8e Add a test for metered/non-metered mobile network am: 2685c929f4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1779527

Change-Id: I1caa9556315700716e04903a51f42189157b8694
2021-10-26 12:30:01 +00:00
Aaron Huang
1d79f3dd99 Add a test for NetworkIdentity.getMetered() am: eaca5b1982
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1779526

Change-Id: Ia958a25ef14d416dbdf8e26f18c6ab2b785105dd
2021-10-26 12:29:50 +00:00
Aaron Huang
2685c929f4 Add a test for metered/non-metered mobile network
NetworkTemplate.buildTemplateMobileWithRatType() supports
to build a template with metered filter, so a mobile network
is metered or non-metered should be tested.

This commit also rename buildMobile3gState to buildMobileState
because originally this method uses NetworkInfo to simulate the
network type. The NetworkInfo related codes were removed.
Currently, setMobileRatTypeAndWaitForIdle is used to simulate
the network type in test.

Ignore-AOSP-First: The parent of this change contains a CL will
conflict with internal tree so ignore AOSP first.
Bug: 183776809
Test: this
Change-Id: I8e54e2acb06db81fb0eaf330c4fd7cb391b01ff3
2021-10-26 12:16:18 +00:00
Aaron Huang
eaca5b1982 Add a test for NetworkIdentity.getMetered()
NetworkIdentity has adapted NET_CAPABILITY_TEMPORARILY_NOT_METERED
network capability so add a test case for it.

Ignore-AOSP-First: The parent of this change contains a CL will
conflict with internal tree so ignore AOSP first.
Bug: 183776809
Test: this
Change-Id: I2ca2a8b4db664b76a5a5ee82fcff451efd87c8ff
2021-10-26 12:16:03 +00:00
Lucas Lin
af97e30d9f Merge changes Ib2d54e53,Ieb606d2b am: c5e61cc540
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1829936

Change-Id: Idce97c0d4ca8082b8ddafec726a2c3dc07ea4fc6
2021-10-26 06:09:45 +00:00
Aaron Huang
386e1702a5 Merge "Update callers to use buildTemplateMobileWithRatType with metered" am: c5655055a3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1807404

Change-Id: Ic6dbad40d6227a7891b5889c07471d75beea3bcc
2021-10-26 06:09:37 +00:00
Lucas Lin
c5e61cc540 Merge changes Ib2d54e53,Ieb606d2b
* changes:
  Test if underlying networks are the same as what VpnService sets
  Convert VpnTest to JUnit4
2021-10-26 06:07:19 +00:00
Aaron Huang
c5655055a3 Merge "Update callers to use buildTemplateMobileWithRatType with metered" 2021-10-26 05:54:05 +00:00
lucaslin
cacd5b0d2a Test if underlying networks are the same as what VpnService sets
If VpnService set null as the underlying networks, then the
underlying networks will be set as system defeult network.
If VpnService set an empty array as the underlying networks, then
the underlying networks of VPN will not be set to any networks.
If VpnService set a network which is not null or an empty array,
then the underlying networks of VPN should be the same as this
one.

Bug: 191918368
Test: atest CtsHostsideNetworkTests:HostsideVpnTests
Change-Id: Ib2d54e53960e5f899cb8d4cfaa6705ca676354ca
2021-10-26 10:55:41 +08:00
lucaslin
d2de904def Convert VpnTest to JUnit4
This is to fix the error in errorprone target, the error message
is: [JUnit4ClassUsedInJUnit3] Assume cannot be used inside a
JUnit3 class. Convert your class to JUnit4 style.
The error method is: assumeTrue()

Bug: 191918368
Test: atest CtsHostsideNetworkTests:HostsideVpnTests
Change-Id: Ieb606d2ba31cc19510425114c76fd77417227f2c
2021-10-26 10:55:25 +08:00
Chalard Jean
8a867d17a0 Merge "No-op cleanup" am: e88bfbc015
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1868845

Change-Id: I958ba36bc904a5785d5cb071bde0b56613d58dbb
2021-10-26 02:54:57 +00:00
Chalard Jean
e88bfbc015 Merge "No-op cleanup" 2021-10-26 02:39:47 +00:00
lucaslin
d4e7b00b2b Add tests for testing if [start|finish]Op is called or not
Add a test for testing if [start|finish]Op will be called when
[start|stop]VpnProfile is called.
Also add a test to ensure that the startOp will not be called
again when seamless handover is happened.

Bug: 197135981
Test: atest FrameworksNetTests:VpnTest
Change-Id: I778ea4edf7c4a2d20b3b8e1877e7942feac5372a
2021-10-26 03:46:46 +08:00
Aaron Huang
6359ebd099 Update callers to use buildTemplateMobileWithRatType with metered
The method buildTemplateMobileWithRatType is updated to take
metered as a parameter so the callers should be updated to
the new version.

Bug: 183776809
Test: atest FrameworksNetTest
Change-Id: I859514b93705f9ee4f9ae4b0bcddcb61005a78ff
Merged-In: I859514b93705f9ee4f9ae4b0bcddcb61005a78ff
2021-10-25 15:22:59 +00:00
Chalard Jean
a3578a5465 No-op cleanup
Binders from the system server don't help, because if the process
dies there is nobody to listen to its binder deaths.

Test: ConnectivityServiceTest
Change-Id: I993cb9481edfaeb652b875be7f90166db16d0e1d
2021-10-25 19:24:48 +09:00
Anton Hansson
9b5b9409d9 Merge "Qualify references to WifiNetworkSuggestions" am: 7ea2767864
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1863714

Change-Id: Ic9f2c305dddaeaac846bc4b03a4b75d551b01202
2021-10-21 12:08:41 +00:00
Anton Hansson
7ea2767864 Merge "Qualify references to WifiNetworkSuggestions" 2021-10-21 11:53:06 +00:00
Lucas Lin
58f526a27b Merge "Wait for network to be validated when setting a valid private DNS" am: acd3e2be33
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1801947

Change-Id: Id05b103459a8f922c54d46161d1d729d8d980748
2021-10-21 11:48:40 +00:00
Lucas Lin
acd3e2be33 Merge "Wait for network to be validated when setting a valid private DNS" 2021-10-21 11:34:35 +00:00
Lucas Lin
6f824bad06 Merge "Add underlying networks into NetworkAgentInfo if any" am: 9c9850b944
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1829935

Change-Id: Idae6559eea61b5e8f75e5b79f8404430b10ad72f
2021-10-21 08:54:49 +00:00
lucaslin
4d441a9b8d Wait for network to be validated when setting a valid private DNS
The previous design just set a valid private DNS and checked
whether onCapabilitiesChanged() has received and
NetworkCapabilities#isPrivateDnsBroken is false. It cannot ensure
that the private DNS is working until the network is validated.
So change the design to waiting the network to be validated after
setting a valid private DNS.

Bug: 196769780
Test: atest CtsNetTestCases:ConnectivityManagerTest
Change-Id: I9c173a70e2b81788efa2ecbf928acda0379846da
2021-10-21 16:47:26 +08:00
Lucas Lin
9c9850b944 Merge "Add underlying networks into NetworkAgentInfo if any" 2021-10-21 08:33:29 +00:00
Treehugger Robot
43f2693271 Merge "Dependency update for StateMachine" am: 5dc1edd9a8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1800993

Change-Id: Ie9cac9d14275e96affd06335c1236a855f8c7d69
2021-10-20 14:01:45 +00:00
Treehugger Robot
5dc1edd9a8 Merge "Dependency update for StateMachine" 2021-10-20 13:43:58 +00:00
Chalard Jean
9a492016d9 Merge "Cleanup shims usage in Tethering" am: 7949b8c557
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1864041

Change-Id: I84e1892270207230f2dfa5bb6725ad395988ef57
2021-10-20 13:17:29 +00:00
Chalard Jean
7949b8c557 Merge "Cleanup shims usage in Tethering" 2021-10-20 13:06:24 +00:00
Chalard Jean
732ebcbc7f Cleanup shims usage in Tethering
Now that S has gone to AOSP, this dependency is no longer
needed. It is, on the contrary, harmful as it prevents us
from adding shims that depend on T APIs in AOSP.

Test: builds
Change-Id: I64f0f394e826e58a9b7e772043bb6008428892e6
2021-10-20 19:44:09 +09:00
Anton Hansson
df40109271 Qualify references to WifiNetworkSuggestions
Connectivity's metalava invocation does not depend on framework-wifi,
so these references fail to resolve, and as a result metalava currently
removes the import.

Fully qualify the references instead, to avoid both metalava trying
to resolve the dependency, and having to depend on framework-wifi just
for javadoc.

Bug: 186197911
Test: build the sdk (with connectivity module stubs as input)
Change-Id: I7129821b9a0d08d06f8e977a3c17fa5f5f6f9cee
2021-10-20 11:34:48 +01:00
Treehugger Robot
c472eed19a Merge "Unregister the tethering internal callback in finalize" am: f8d1f3d1cd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1838543

Change-Id: I3523da57b7d0feac11b2cdf62f254e694d5b7269
2021-10-20 08:57:57 +00:00
Treehugger Robot
f8d1f3d1cd Merge "Unregister the tethering internal callback in finalize" 2021-10-20 08:40:08 +00:00
Treehugger Robot
695b4c170e Merge "Test TetheringManager could be GC after getting connector" am: 9d0c5419c9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1838542

Change-Id: I3a11200db5de2143bada839d7b4268dc393afab9
2021-10-20 08:01:33 +00:00