Commit Graph

17 Commits

Author SHA1 Message Date
Frank Li
3103a318bf Merge "Add CTS test for API setLegacyExtraInfo" 2021-06-08 11:15:06 +00:00
lifr
0fd78de2c6 Add CTS test for API setLegacyExtraInfo
Adding in-depth test in NetworkAgentTest
Bug: 187040803
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkAgentConfigTest
      atest CtsNetTestCases:android.net.NetworkAgentConfigTest
Change-Id: Ief14f6de0cb6913da944414f0b134eb04346425f
2021-06-07 20:22:47 +00:00
Chalard Jean
0354d8c7e0 [NS05] Feed network offer callbacks
The design is very simply expressed :
An offer is needed for a request if and only if that offer
might beat the satisfier for that request.

The implementation of "might beat" is NetworkRanker#mightBeat.

Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Bug: 167544279
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Merged-In: I0fe911eef2483ecbac48c733d56283b81538690a
Change-Id: I0fe911eef2483ecbac48c733d56283b81538690a
  (cherry-picked from 7b6a33bd50)
2021-06-07 10:57:48 +00:00
Chiachang Wang
8789adc1cd Merge "Add test for NetworkCapabilities.Builder.withoutDefaultCapabilities" 2021-05-21 03:33:23 +00:00
Chiachang Wang
32bd81d88b Merge "Add test for NetworkCapabilities.Builder.withoutDefaultCapabilities" 2021-05-21 03:33:23 +00:00
Chiachang Wang
b162e0e0a7 Add test for NetworkCapabilities.Builder.withoutDefaultCapabilities
Bug: 186061922
Test: atest CtsNetTestCases:android.net.NetworkCapabilitiesTest
Change-Id: I369e71dd6ae85da78e114ea8377967ab0bde787b
2021-05-21 09:57:42 +08:00
Chiachang Wang
92346fdf33 Add test for NetworkCapabilities.Builder.withoutDefaultCapabilities
Bug: 186061922
Test: atest CtsNetTestCases:android.net.NetworkCapabilitiesTest
Change-Id: I369e71dd6ae85da78e114ea8377967ab0bde787b
2021-05-21 09:57:42 +08:00
Remi NGUYEN VAN
b6f7ca9519 Merge "Move config_apf* resources to NetworkStack" 2021-05-19 00:58:52 +00:00
Remi NGUYEN VAN
999427e138 Merge "Move config_apf* resources to NetworkStack" 2021-05-19 00:58:52 +00:00
Aaron Huang
3c4e669929 Rename *Iface* APIs to *Interface*
Address API review feedback, other APIs have been refering to
these as "interface" instead of "iface" so migrate the APIs named
*Iface* to *Interface*.

(cherry-picked from ag/14326779)
Bug: 183972554
Test: atest android.net.UnderlyingNetworkInfoTest
Merged-In: I38b476e762fb57fa88c4a789092d0af6f5330d80
Change-Id: I38b476e762fb57fa88c4a789092d0af6f5330d80
2021-05-14 11:05:22 +08:00
Aaron Huang
9ff12842da Rename *Iface* APIs to *Interface*
Address API review feedback, other APIs have been refering to
these as "interface" instead of "iface" so migrate the APIs named
*Iface* to *Interface*.

(cherry-picked from ag/14326779)
Bug: 183972554
Test: atest android.net.UnderlyingNetworkInfoTest
Merged-In: I38b476e762fb57fa88c4a789092d0af6f5330d80
Change-Id: I38b476e762fb57fa88c4a789092d0af6f5330d80
2021-05-14 11:05:22 +08:00
Remi NGUYEN VAN
0aa7a4747f Move config_apf* resources to NetworkStack
The resources are only read by NetworkStack through their respective
ApfCapabilities SystemApi methods.
As the resources are being migrated out of frameworks/base resources
anyway, move them directly to NetworkStack instead of moving them to
ServiceConnectivityResources.

Also test that the framework resources are not overlaid or modified.
This should avoid OEM integration errors where the overlays are kept as
in R, without overlaying the resource in the NetworkStack package.

Bug: 185850634
Test: atest CtsNetTestCases
BYPASS_INCLUSIVE_LANGUAGE_REASON=Need to mention legacy APIs

Change-Id: I7a15ddcad5af11fa307d9dbe3a77b31a1179e5b3
2021-05-13 14:40:10 +00:00
Remi NGUYEN VAN
b11ba415f6 Move config_apf* resources to NetworkStack
The resources are only read by NetworkStack through their respective
ApfCapabilities SystemApi methods.
As the resources are being migrated out of frameworks/base resources
anyway, move them directly to NetworkStack instead of moving them to
ServiceConnectivityResources.

Also test that the framework resources are not overlaid or modified.
This should avoid OEM integration errors where the overlays are kept as
in R, without overlaying the resource in the NetworkStack package.

Bug: 185850634
Test: atest CtsNetTestCases
BYPASS_INCLUSIVE_LANGUAGE_REASON=Need to mention legacy APIs

Change-Id: I7a15ddcad5af11fa307d9dbe3a77b31a1179e5b3
2021-05-13 14:40:10 +00:00
Lorenzo Colitti
a869887d4f Do not automatically redact TransportInfo objects.
Currently, NetworkCapabilities always redacts the TransportInfo
objects it contains whenever a defensive copy is made. This makes
it impossible to make a defensive copy on a TransportInfo
parcelled from another process without redacting it.

Stop redacting by default; instead rely on ConnectivityService
explicitly calling NetworkCapabilities' redacting constructor
when it returns a NetworkCapabilities object to an app via a
callback or synchronous call. This is currently done by
- createWithLocationInfoSanitizedIfNecessaryWhenParceled, which
  is called from callCallbackForRequest, getNetworkCapabilities,
  and getDefaultNetworkCapabilitiesForUser.
- getNetworkCapabilitiesWithoutUids, which is used when sending
  ConnectivityDiagnosticsManager callbacks. In this method,
  unconditionally redact all information, which is what the code
  did previously due to the default redaction setting for empty
  NetworkCapabilities objects being REDACT_ALL.

Bug: 183938194
Test: atest NetworkCapabilitiesTest
Test: atest FrameworksNetTests CtsNetTestCases HostsideVpnTests
Change-Id: I3108ee94cb0930958e071ba678c3554525b0db82
2021-05-13 20:24:19 +09:00
Lorenzo Colitti
6424cf294f Do not automatically redact TransportInfo objects.
Currently, NetworkCapabilities always redacts the TransportInfo
objects it contains whenever a defensive copy is made. This makes
it impossible to make a defensive copy on a TransportInfo
parcelled from another process without redacting it.

Stop redacting by default; instead rely on ConnectivityService
explicitly calling NetworkCapabilities' redacting constructor
when it returns a NetworkCapabilities object to an app via a
callback or synchronous call. This is currently done by
- createWithLocationInfoSanitizedIfNecessaryWhenParceled, which
  is called from callCallbackForRequest, getNetworkCapabilities,
  and getDefaultNetworkCapabilitiesForUser.
- getNetworkCapabilitiesWithoutUids, which is used when sending
  ConnectivityDiagnosticsManager callbacks. In this method,
  unconditionally redact all information, which is what the code
  did previously due to the default redaction setting for empty
  NetworkCapabilities objects being REDACT_ALL.

Bug: 183938194
Test: atest NetworkCapabilitiesTest
Test: atest FrameworksNetTests CtsNetTestCases HostsideVpnTests
Change-Id: I3108ee94cb0930958e071ba678c3554525b0db82
2021-05-13 20:24:19 +09:00
Remi NGUYEN VAN
5ed250d90a Move net unit tests to packages/Connectivity
Move the tests together with packages/Connectivity code, so both can be
moved to packages/modules/Connectivity together.

Also reorganize unit tests in a unit/ directory, as other tests
(integration/, common/ etc.) have been added in tests/net since they
were created. This makes the directory structure consistent.

Test: atest FrameworksNetTests
Bug: 187814163
Merged-In: I254ffd1c08ec058d594b4ea55cbae5505f8497cc

Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc
2021-05-13 08:30:33 +00:00
Remi NGUYEN VAN
31022d6cda Move net unit tests to packages/Connectivity
Move the tests together with packages/Connectivity code, so both can be
moved to packages/modules/Connectivity together.

Also reorganize unit tests in a unit/ directory, as other tests
(integration/, common/ etc.) have been added in tests/net since they
were created. This makes the directory structure consistent.

Test: atest FrameworksNetTests
Bug: 187814163
Merged-In: I254ffd1c08ec058d594b4ea55cbae5505f8497cc

Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc
2021-05-13 08:30:33 +00:00