Commit Graph

8438 Commits

Author SHA1 Message Date
Chiachang Wang
d91f16f11c Merge "Add more tests for CaptivePortalData" am: 4ae6e556c1
Change-Id: I68aaf60a82227d647dbf3394ae6ec87627426a7e
2020-04-13 10:07:11 +00:00
Chiachang Wang
4ae6e556c1 Merge "Add more tests for CaptivePortalData" 2020-04-13 09:46:20 +00:00
Chiachang Wang
25cf28ca34 Merge "Move CaptivePortalDataTest to common test to support cts" am: 164eea2a4f
Change-Id: If5a2f476285d3e276d6fdbb695514489de18cb50
2020-04-13 09:12:26 +00:00
Chiachang Wang
ac7fe6c583 Add more tests for CaptivePortalData
Add missing tests to cover all system APIs

Bug: 152280218
Bug: 150640683
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalDataTest on
      both Q and R device
Change-Id: I6d3826922f16816d5b18ed3540266442a0ed3e49
2020-04-13 08:58:48 +00:00
Chiachang Wang
164eea2a4f Merge "Move CaptivePortalDataTest to common test to support cts" 2020-04-13 08:56:31 +00:00
Chiachang Wang
d8a33be2e3 Move CaptivePortalDataTest to common test to support cts
Commit has to on top of aosp/1281921 to skip whole test in Q
device since CaptivePortalData class is introduced in R.

Result in Q will be:
[1/1] android.net.CaptivePortalDataTest#skippedClassForDevSdkMismatch: IGNORED

Bug: 152280218
Bug: 150640683
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalDataTest on
      both Q and R device
Change-Id: Iddd00e1c85abe767b1a41a1761d3266ba322dba6
2020-04-13 08:13:04 +00:00
Lorenzo Colitti
2b607c81cc Merge "Set transport types to resolver" am: 3c0c668d87
Change-Id: I26b6e523bbc6ccd6e57a1b30782b74c6c33a7fbb
2020-04-13 07:22:21 +00:00
Lorenzo Colitti
3c0c668d87 Merge "Set transport types to resolver" 2020-04-13 07:03:20 +00:00
chenbruce
2e6b79f3d2 Set transport types to resolver
For a given network, resolver doesn't know what transport types are.
Therefore, when a new network is created or transport types are changed
in a give network, transport types will be updated and sent by calling
setResolverConfiguration(). In the same time, if link properties or
transport types are null, setResolverConfiguration() won't be called.
The original behaviors of setResolverConfiguration() aren't changed.
Only increasing one new behavior that when a given network has transport
type change, calling setResolverConfiguration() directly and resolver
updates the transport types for that given network.

Bug: 143732914
Test: atest FrameworksNetTests
      atest FrameworksNetIntegrationTests
Merged-In: I03fc5c62dfd9a51a78a720860531df282fdecc20
Change-Id: I6527cde0e177ba08c886576131b35fc769c2bb53
2020-04-11 23:00:13 +08:00
Hall Liu
a7d042ad64 Merge changes from topic "phonestatelistener-limit-rvc-dev" am: 0167936be4
Change-Id: I23df0fed3c46b2aeb3bf561e82460ffc41a6928c
2020-04-11 00:56:02 +00:00
Hall Liu
0167936be4 Merge changes from topic "phonestatelistener-limit-rvc-dev"
* changes:
  Add gating, logging for PhoneStateListener's limit
  Institute limit on PhoneStateListener
2020-04-11 00:36:13 +00:00
Xin Li
c03f719e8b Merge "DO NOT MERGE - Merge qt-qpr1-dev-plus-aosp@6382244 into stag-aosp-master" into stage-aosp-master 2020-04-10 18:42:15 +00:00
Treehugger Robot
92c8e43252 Merge "Fix a theoretical NPE" am: 6334d49d44
Change-Id: Idf4cb0acbfb9bc8fef43d42be477778e8ec2fc09
2020-04-10 16:44:25 +00:00
Treehugger Robot
6334d49d44 Merge "Fix a theoretical NPE" 2020-04-10 16:25:07 +00:00
Chalard Jean
5d8bc4b1ac Fix a theoretical NPE
Test: NetworkAgentTests
Bug: 153718627
Change-Id: I08f57cce0cd85d5cd66e9a0ef948224290e9200e
2020-04-10 23:08:00 +09:00
Lucas Lin
96aa080ffe Merge "Set WifiAwareNetworkInfo into setTransportInfo()" am: 6056ec00bf am: 6b21fc4608
Change-Id: I6ca0f9041b3a3b30ee98a00420c08723c8a57be8
2020-04-09 03:12:57 +00:00
Lucas Lin
6b21fc4608 Merge "Set WifiAwareNetworkInfo into setTransportInfo()" am: 6056ec00bf
Change-Id: Ib99da397256138cb16ce7873df50996e1fe8be1a
2020-04-09 02:53:46 +00:00
lucaslin
15586a5bae Set WifiAwareNetworkInfo into setTransportInfo()
Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest CtsNetTestCasesLatestSdk:NetworkCapabilitiesTest
Change-Id: Ibbe1cd126d6538003fbb1e5e85892bfb15a920e8
Merged-In: Ibbe1cd126d6538003fbb1e5e85892bfb15a920e8
2020-04-08 10:09:16 +00:00
Hall Liu
87b8c3304d Add gating, logging for PhoneStateListener's limit
Add gating via PlatformCompat and DeviceConfig and logging via
PlatformCompat to the limit instituted on per-process listeners

Fixes: 152074216
Test: atest CtsTelephonyHostCases
Change-Id: I4d6681d90705b68c3349f4124e434a29b50fd3a2
Merged-In: I4d6681d90705b68c3349f4124e434a29b50fd3a2
2020-04-07 17:13:19 -07:00
Junyu Lai
cfea1b70a0 Merge "Fix NetworkStatsApiTest failed on Q device" am: cd7c6cb6ca am: e1d7d536e3
Change-Id: Icc2e59feaf95ffa002cfbc85f849e87b01af5181
2020-04-07 11:26:44 +00:00
Junyu Lai
e1d7d536e3 Merge "Fix NetworkStatsApiTest failed on Q device" am: cd7c6cb6ca
Change-Id: I3657e473a5c8ba45da7f1845ce860c0a494878f7
2020-04-07 11:04:39 +00:00
Junyu Lai
cd7c6cb6ca Merge "Fix NetworkStatsApiTest failed on Q device" 2020-04-07 10:49:19 +00:00
Treehugger Robot
86432cb260 Merge "Add trivial dependencies tests for the network stack" am: a287e43a36 am: 2adba91843
Change-Id: I63d0f3c8b247b3c30d04013f33f0539fc77d7970
2020-04-07 09:13:28 +00:00
Treehugger Robot
2adba91843 Merge "Add trivial dependencies tests for the network stack" am: a287e43a36
Change-Id: I940782a1ae97759085a4a6f67c0358e6bfdbd328
2020-04-07 08:55:37 +00:00
Treehugger Robot
a287e43a36 Merge "Add trivial dependencies tests for the network stack" 2020-04-07 08:34:44 +00:00
Lucas Lin
464279650f Merge "Add more tests in NetworkCapabilitiesTest.java" am: 60ee9b5a9f am: d9a6a6b8b6
Change-Id: Ibc00ea23f55360ad464ef439d88480354cbf04ae
2020-04-07 07:14:35 +00:00
junyulai
3bf1224afc Fix NetworkStatsApiTest failed on Q device
Currently, the addEntry method is used in constructor of test,
which is not correct since there is no such method in Q devices.

Thus, initialize of NetworkStats variables outside of constructor.

Test: atest NetworkStatsApiTest
Test: atest CtsNetTestCasesLatestSdk:NetworkStatsApiTest on Q device
Bug: 150644692
Change-Id: Ibf2f8118c459a8d7a0992deca8f0f339ccd1bcea
2020-04-07 15:07:16 +08:00
Lucas Lin
d9a6a6b8b6 Merge "Add more tests in NetworkCapabilitiesTest.java" am: 60ee9b5a9f
Change-Id: Ie50a0e4e332dd16c7300efb488f4ac4f25c3b6c9
2020-04-07 06:59:14 +00:00
Lucas Lin
60ee9b5a9f Merge "Add more tests in NetworkCapabilitiesTest.java" 2020-04-07 06:45:09 +00:00
Treehugger Robot
b31253b844 Merge "Fix a stupid NPE" am: 30673a9684 am: fb3e94c8d8
Change-Id: Ic3b10be1bec50271470dfedfa8cb7f8e5ab8f821
2020-04-07 06:19:00 +00:00
Treehugger Robot
fb3e94c8d8 Merge "Fix a stupid NPE" am: 30673a9684
Change-Id: I3a167339e4007e5cb16488e701b9ca16937da265
2020-04-07 06:02:50 +00:00
Treehugger Robot
30673a9684 Merge "Fix a stupid NPE" 2020-04-07 05:53:10 +00:00
Chalard Jean
dcb74c71db Add trivial dependencies tests for the network stack
Test: this
Bug: 153033018
Change-Id: Ie3c15ed25ef3088d3b9b650ffc7f34f49efa6b81
2020-04-07 14:42:00 +09:00
lucaslin
e408eb55dc Add more tests in NetworkCapabilitiesTest.java
Test deduceRestrictedCapability(), getAdministratorUids(),
setAdministratorUids(), getNetworkSpecifier(), getOwnerUid(),
setLinkDownstreamBandwidthKbps(), setLinkUpstreamBandwidthKbps()
and setSignalStrength().

Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkCapabilitiesTest
Change-Id: I90c7a8c47710ea4ad8e8d2682c10440fd7f82270
2020-04-07 11:58:22 +08:00
Lorenzo Colitti
aac5f4ab99 Merge "Refactor the Nat464Xlat function for simplicity." am: 6bc322fc77 am: 818b26f88b
Change-Id: I4ba3a3822efcc1b6787c729d38317fbc5148aca4
2020-04-06 11:34:04 +00:00
Lorenzo Colitti
818b26f88b Merge "Refactor the Nat464Xlat function for simplicity." am: 6bc322fc77
Change-Id: I4947abc132dcd0c83b44f2c23362049ee1073214
2020-04-06 11:01:50 +00:00
Lorenzo Colitti
6bc322fc77 Merge "Refactor the Nat464Xlat function for simplicity." 2020-04-06 10:38:54 +00:00
Chalard Jean
0551a602d9 Merge "Fix a bug where the legacy extra info is reset on connect." am: c0863db980 am: 7eebe72420
Change-Id: Ifa0b2239ccd0c09708085ee68c39454e1eceeffe
2020-04-06 06:34:58 +00:00
Chalard Jean
7eebe72420 Merge "Fix a bug where the legacy extra info is reset on connect." am: c0863db980
Change-Id: Ia0a2afe359cac6adfd33d2f839eddb8bd14b5f43
2020-04-06 06:17:46 +00:00
Chalard Jean
c0863db980 Merge "Fix a bug where the legacy extra info is reset on connect." 2020-04-06 06:04:46 +00:00
Chalard Jean
8e43611e05 Fix a bug where the legacy extra info is reset on connect.
Bug: 149459996
Test: NetworkAgentTest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: I5f8f6d962ee3317e101d19518c767b3c327c0c47
2020-04-06 12:46:19 +09:00
Lorenzo Colitti
3f18aa996d Refactor the Nat464Xlat function for simplicity.
This makes the code easier to understand by making state
transitions more explicit. It also makes it easier to address a
TODO to turn the class into a StateMachine.

This should be an exact no-op refactoring. The current cases
covered by the code (all mutually exclusive) are:

1. requiresClat && !isPrefixDiscoveryStarted
   Action: startPrefixDiscovery()
   Equivalent to IDLE && requiresClat, because
   isPrefixDiscoveryStarted returns true for every state except
   IDLE.

2. requiresClat && isPrefixDiscoveryStarted && shouldStartClat
   Action: start()
   Equivalent to DISCOVERING && shouldStartClat,
   because isPrefixDiscoveryStarted is true in DISCOVERING,
   STARTING, and RUNNING, but start() does nothing if mState is
   STARTING or RUNNING.

3. requiresClat && isPrefixDiscoveryStarted && !shouldStartClat
   Action: stop()
   Equivalent to (STARTING or RUNNING) && !shouldStartClat,
   because isPrefixDiscoveryStarted is true in DISCOVERING,
   STARTING, and RUNNING, but stop() does nothing if mState is
   not STARTING or RUNNING.

4. !requiresClat && isStarted
   Action: stop()
   Equivalent to (STARTING or RUNNING) && !requiresClat,
   because isStarted() is only true in STARTING and RUNNING.

5. !requiresClat && !isStarted && isPrefixDiscoveryStarted
   Action: leaveStartedState()
   Equivalent to DISCOVERING && !requiresClat, because
   the only state with isPrefixDiscoveryStarted and !isStarted
   is DISCOVERING.

Also, simplify case #5. In this case, calling leaveStartedState
is superfluous, because in the DISCOVERING state:
- There is no need to call unregisterObserver, since the observer
  is only registered when entering STARTING and is unregistered
  when going back to DISCOVERING or IDLE.
- mIface and mBaseIface don't need to be set to null because they
  are only set to non-null when entering STARTING and nulled out
  when going back to DISCOVERING or IDLE.

Bug: 126113090
Bug: 150648313
Test: covered by existing ConnectivityServiceTest and Nat464XlatTest
Change-Id: Ice536bcb269cc8b040c6e7a72c15d0bc8b5bd235
2020-04-04 16:24:58 +09:00
Remi NGUYEN VAN
07bc36a061 Merge "Fix setAdministratorUids tests on Q" am: 2497897867 am: 9972a5ac3b
Change-Id: I77012e94e128ec0c88ac8c6c3b316c4b29a3784f
2020-04-03 08:42:26 +00:00
Remi NGUYEN VAN
9972a5ac3b Merge "Fix setAdministratorUids tests on Q" am: 2497897867
Change-Id: I1f9a335e4f7b97d2af47745709d90cfdab353154
2020-04-03 08:17:00 +00:00
Remi NGUYEN VAN
2497897867 Merge "Fix setAdministratorUids tests on Q" 2020-04-03 07:54:59 +00:00
Chalard Jean
c7e1877d1c Fix a stupid NPE
Okay so this is really not a behavior change as it converts an
NPE into an illegal argument exception, but still, that's what
should happen (and that's what the upcoming test actually tests
for).

Test: upcoming NetworkAgentTest
Bug: 139268426
Change-Id: I3e17211c03bc74426bf5e2e414ec322d73b0060b
2020-04-03 07:17:13 +09:00
Lorenzo Colitti
0af8c132e7 Merge "Rename the *Nat64Prefix to *Nat64PrefixFromDns." am: 01314aedbf am: bcb70090e9
Change-Id: Iafcc7caea3ef4b87e2651da8dcbf972704022930
2020-04-02 15:25:30 +00:00
Lorenzo Colitti
bcb70090e9 Merge "Rename the *Nat64Prefix to *Nat64PrefixFromDns." am: 01314aedbf
Change-Id: I542f805511fe770c7869b4ba989416c179d28687
2020-04-02 15:06:25 +00:00
Lorenzo Colitti
01314aedbf Merge "Rename the *Nat64Prefix to *Nat64PrefixFromDns." 2020-04-02 14:45:11 +00:00
Lorenzo Colitti
fff75393c5 Rename the *Nat64Prefix to *Nat64PrefixFromDns.
This just a rename with no functional changes at all. It is
preparation for supporting getting the NAT64 prefix from the
RA.

Bug: 150648313
Test: covered by existing ConnectivityServiceTest and Nat464XlatTest
Change-Id: Ia9a09a708870827b1e4cf068f930fa9542dd116c
2020-04-02 22:48:03 +09:00