after this:
diff system/netd/bpf_progs/bpf_net_helpers.h packages/modules/Connectivity/Tethering/bpf_progs/bpf_net_helpers.h
shows no diff, besides a switch to '#pragma once'
as the include guard.
Test: builds, atest, TreeHugger
Bug: 177884581
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib943321d46254ba64ce206fb9e3b3414d15e4d45
Use shell permissions to obtain CREATE_USERS to call
ActivityManager.getCurrentUser in ConnectivityServiceTest.
This is necessary to allow the tests to run in coverage tests without
the platform certificate.
Bug: 187935317
Test: atest FrameworksNetTests:ConnectivityServiceTest
Change-Id: I5a56ffab4820d351dcdb132046698cd0d3b8bdb1
This is a partial cherry-pick of change:
I894ee66e058b1024a731d3be4b33b69626451f08
The permission is actually not used, but this change aligns the manifest
with contents in downstream branches, so it can be modified (including
removing the permission) without conflicts.
Bug: 157876448
Test: atest FrameworksNetTests
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Id50e41a0ea970350eae0a2afab303c022b452bf9
The following is a list of APIs:
1. NetworkAgent.setLegacySubtype
2. NetworkAgentConfig.Builder.setLegacySubType
3. NetworkAgentConfig.Builder.setLegacySubTypeName
4. NetworkAgentConfig.Builder.setLegacyExtraInfo
Bug: 190413710
Test: atest android.net.cts.NetworkAgentTest
atest CtsNetTestCasesLatestSdk:NetworkAgentTest
Change-Id: Ia67b963b8e18af8440b1b9bd91f53439848bb838
* changes:
Add CTS for NetworkAgentConfig#setSubscriberId
Add CTS for getAllNetworkStateSnapshots
Check NETWORK_SETTINGS permission for getAllNetworkStateSnapshots
When private DNS mode is strict, there should always be a private DNS
specifier with the hostname.
Instead of restoring an invalid strict mode setting when set,
have tests reset private DNS mode to opportunistic and fail.
Bug: 190465704
Test: atest CtsNetTestCases
Change-Id: I45adc527267aa86d52e824f426699c5a7e874f63
This is declared in the API surface, but the implementation
does not match.
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testGetAllNetworkStateSnapshots
Bug: 188140631
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Merged-In: I97aa69651461ebe5c323ec669372f9a61b84e6a6
Change-Id: I97aa69651461ebe5c323ec669372f9a61b84e6a6
(cherry-picked from ag/14601670)
* changes:
Adjust a test for policy scoring
Enable policy ranking
Add CTS to verify NetworkAgent#setLingerDuration
Allow network providers to set the linger duration.
Fix nascent timer never get removed
[NS13] Remove the last usage of the legacy int
Add documentation
Use filter from CollectionUtils.
Fix a bug where updates of offers won't find existing offers
[NS12] Address comments on NS09
[NS11] Fix yieldToBadWifi over the policy scoring
Add doc for NetworkScore#getLegacyInt
Expose sendNetworkScore that takes a NetworkScore
The build file currently holds a single build rule in test/. Move it to
the existing build file in tests/common/Android.bp.
(clean cherry-pick of history in downstream branch)
Test: m
Bug: 186628461
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Ifa32681c0cdd2f6a70cb83a81cd7fec0f91824d1
The defaults follow the same pattern as framework-wifi-test-defaults to
allow unit tests to build against hidden API in Connectivity.
(clean cherry-pick of history in downstream branch)
Bug: 171540887
Test: m
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Ia8531f672820fcc8968f98494903e486c4e42652
When private DNS setting was set to opportunistic (mode) and null
(hostname), CtsNetUtils would not restore it.
Make sure that private DNS settings are restored after every test. Also
fail if restore is called without having saved any setting beforehand.
Bug: 190465704
Test: atest CtsNetTestCases
Change-Id: Ic5d8d8b729469e0eef89a0b53f166e604264c1ee
To allow unit tests to run without platform certificates, remove
signature permission usage in ConnectivityServiceTest.
This mocks permission checks done in ConnectivityService for which the
test assumed that the permission was held, and mocks calls to
BatteryStatsManager. Calls to ActivityManagerService (through
PendingIntent) are done with shell permissions as the test uses real
PendingIntent mechanics.
Bug: 187935317
Test: atest FrameworksNetTests:ConnectivityServiceTest
Change-Id: I80c5cae5fcd3d40be55d1a79a93d614e665fbbf4
This is necessary to mock classes like BatteryStatsManager, which cannot
be used without signature permissions, and to merge the test with other
test suites that use mockito extended.
Bug: 187935317
Test: atest FrameworksNetTests
Change-Id: I5dba65d806c5d06b3ff8f633846edb911a7a44ec
To avoid log flooding, suppress CMD_IPV6_TETHER_UPDATE and
CMD_NEIGHBOR_EVENT message log because they appear frequentlg and
don't have any content which means they are ueseless for debugging.
Also remove logMessage from BaseServingState to fix duplicated
message because all the message already log in TetheredState
and LocalHotspotState which inherit BaseServingState.
Bug: 162920185
Bug: 185649441
Test: atest TetheringCoverageTests
atest MtsTetheringTestLatestSdk
atest CtsTetheringTest
Change-Id: Ib8fe719f3c1c4a65e6b5152df5e5adf33aba2079
Since tethering run in single thread without any synchronized lock,
remove "Locked" wording from the methods which the use lock before.
Bug: 162920185
Test: atest TetheringCoverageTest
Change-Id: Ia8c057800cab30cdcbacae4db2d706b6427e9861
Currently, when a network that uses 464xlat is torn down,
NetworkCallbacks will receive onLinkPropertiesChanged after
onLost. This is confusing and incorrect.
The incorrect callback is sent because handleLinkProperties
checks that the netId of the agent still exists, not that the
NetworkAgent is still registered. This is normally correct,
because the NetworkAgent is removed from mNetworkAgentInfos and
the netId are removed from mNetworkForNetId by the same method,
disconnectAndDestroyNetwork.
In this specific case it's not correct, because the call to
handleUpdateLinkProperties is from disconnectAndDestroyNetwork
itself via nai.clatd.update and calls Nat464Xlat#stop.
No other callers of handleUpdateLinkProperties are affected
because:
- EVENT_NETWORK_PROPERTIES_CHANGED is called only by
maybeHandleNetworkAgentMessage, which first checks that the
NetworkAgent is registered.
- handlePrivateDnsSettingsChanged only looks at registered
NetworkAgents (it loops over mNetworkAgentInfos).
- handlePrivateDnsValidationUpdate, handleNat64PrefixEvent and
handleCapportApiDataUpdate call getNetworkAgentInfoForNetId,
which will correctly determine that the agent is no longer
registered, since they run on the handler thread and thus
cannot run at the same time as disconnectAndDestroyNetwork.
The existing code contains a check for the netId being current.
This is intended to ensure that an update from a NetworkAgent
cannot affect another agent with the same Network. This extra
check is not necessary, because code running on the handler
thread can never observe a NetworkAgent in mNetworkAgentInfos
unless mNetworkForNetId maps that NetworkAgent's Network to that
NetworkAgent. This is because mNetworkForNetId is updated by the
same methods as mNetworkAgentInfos, and those updates occur on
the handler thread. So all code on the handler thread will see
those two as consistent.
Bug: 176496580
Test: atest FrameworksNetTests CtsNetTestCases HostsideVpnTests
Change-Id: I944f4c6ad36206bdccd85a6ea7ef71324a29c685
Ensure that NetworkCallbacks and netd operations are accounted
for. Also add a test for the spurious onLinkPropertiesChanged
callback that is currently send out after onLost.
Bug: 176496580
Test: atest ConnectivityServiceTest
Change-Id: I69cf58bc87dfe55ea359a2cd76167d03fe2c953d
To merge the framework-connectivity and framework-connectivity.impl
targets, framework-connectivity stubs need to be referenced explicitly
in java_sdk_libraries, otherwise the build system will currently see
dependency cycles.
Bug: 183600168
Test: m
Merged-In: I556747f9ba934f8b44b6ea9a518adbccc84ac2a9
Change-Id: I0ff10dcb553115d349e287c9f648d77579158f9d
Instead of using api_only: true, use a single java_sdk_library to
generate both framework-connectivity stubs and
framework-connectivity.impl.
Original change (project moved):
I76d7cf1ba31a3f38ae6b9facbf1b668860c8c165
Bug: 183600168
Test: m
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: I07d8c4c92c91939b8e8890fdb5db517b75faee2c
All targets need min_sdk_version 30 to be included in the tethering
APEX. They will actually never be used on SDK 30 and are only loaded on
31, but this is necessary to be included in com.android.tethering.
Original change (project moved):
I190fd1f3c9fabff057d0a2bd7f45b63a4fe447b3
This also includes changes to the lint baseline to make it match actual
filenames.
Bug: 171540887
Test: m
Test: m lint-check
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: I24198565bc98d85d0c036be02e3a6c311b5bb2a3