In general, keepalive slots are released after result of
stopping has returned. However, for network disconnect case,
the service side cannot communicate with network agent since
the async channel is broken.
Clean up keepalive slots right after stop in this case.
Bug: 132341736
Test: 1. atest com.android.server.ConnectivityServiceTest \
#testNattSocketKeepalives --generate-new-metrics 100
2. atest FrameworksNetTests --generate-new-metrics 10
Change-Id: Ia30741f71fa72fc117e071976fd73991fa3c9535
This reverts commit bdf7048571.
Reason for revert: Adds dependency between IpSecService and
ConnectivityService may lead to future deadlock
problems. Uses a simpler approach instead,
hence the solution is not needed.
See aosp/954040.
Change-Id: Ibff278a6eee666cd85dba81c2bed94d568679b02
Public APIs for creating unprivileged NATT socket keepalive
might allow users to exhaust resource if malicious apps try
to create keepalives with fd which is not created by
IpSecService through binder call. Thus, this change add
customizable limitation per uid to prevent resource exhaustion
attack.
Bug: 129371366
Bug: 132307230
Test: atest FrameworksNetTests
Change-Id: Ibcb91105e46f7e898b8aa7c2babc3344ef2c6257
This change specifies the required minimum supported keepalives
in SDK, and allows OEMs to customize supported keepalive count
per network through resource overlay.
Bug: 129371366
Test: 1. m -j doc-comment-check-docs
2. atest FrameworksNetTests
Change-Id: I0218f3674628c13ead63fc9a873895ba7f113033
am: 80045d35e7 -s ours
am skip reason: change_id I4c54b003a733eb0b1e4fd8674ed13081b1bef8e3 with SHA1 6cb6599ddd is in history
Change-Id: I3a61f64da1fc5d376da06a81ce8a35bac09d4481
The onUnavailable semantics promise that it is equivalent to calling
the unregister callback method. But - it doesn't unregister the callback
allowing it to be reused. Fixed.
Additionally, modified the unregisterNetworkCallback method to not fail
on duplicate unregistration (since a callback could now self
unregister). Instead simply print a log.
Bug: 130651445
Test: atest ConnectivityServiceTest
Merged-In: I4c54b003a733eb0b1e4fd8674ed13081b1bef8e3
Change-Id: I4c54b003a733eb0b1e4fd8674ed13081b1bef8e3
The onUnavailable semantics promise that it is equivalent to calling
the unregister callback method. But - it doesn't unregister the callback
allowing it to be reused. Fixed.
Additionally, modified the unregisterNetworkCallback method to not fail
on duplicate unregistration (since a callback could now self
unregister). Instead simply print a log.
Bug: 130651445
Test: atest ConnectivityServiceTest
Change-Id: I4c54b003a733eb0b1e4fd8674ed13081b1bef8e3
This reverts commit 2bb85a0bc0.
Reason for revert: Adds dependency between IpSecService and
ConnectivityService may lead to future deadlock
problems. Uses a simpler approach instead,
hence the solution is not needed.
See aosp/954040.
Change-Id: If6d537a39595cf132d3ed81d4eaac6700f5f0ab3
This patch adds checks to ensure that the IPSEC_TUNNEL feature flag is
enabled.
Bug: 117183273
Test: Compiles & tests passing
Change-Id: I2699dda29e1eed139bc6fd1b70071e5ab33cad88
Delete the unused NetworkManagementService API for set/remove
permissions. Use PERMISSION_NONE to replace NO_PERMISSIONS so the
framework now use the same set of permission constant when communicate
with netd.
Bug: 128944261
Test: PermissionMonitorTest.java
Change-Id: I25224c9576f52d2a0a0bd2182325c7aac7b28eb5
Remove definition of TYPE_NATT and TYPE_TCP since the type
can be identified by checking message.obj is an instance of
NattKeepalivePacketData or TcpKeepalivePacketData.
It's more simple and won't have dependency on KeepaliveInfo.
Bug: 33530442
Test: atest FrameworksNetTests
atest NetworkStackTests
Change-Id: Ic97ffe9ff5781778efd264460809f5059f0f4230
am: 44bb6d00a7 -s ours
am skip reason: change_id I9b65a2eef94567d2b79a9955619938e64906080d with SHA1 5bc4f002b0 is in history
Change-Id: I05a3e1b581d287022f9843a07f2ba76609fd663c
am: b418a13a90 -s ours
am skip reason: change_id I49c35541eb21e91f8c36215456df703d2fe70d2c with SHA1 cf54864ccc is in history
Change-Id: Id22f11ec1e377c801ea5b7dd9692c6243907fa9e
am: 78bc2fb752 -s ours
am skip reason: change_id Idaa7238a5c9acdae9f6cff13095ee9436c7c92c8 with SHA1 621463a0c0 is in history
Change-Id: I0db6221a54e4aba83fc792561e48c9d448163239
am: 65caa406e7 -s ours
am skip reason: change_id I9b9a51dc5dc06c90229fb36c34c24258991c4146 with SHA1 47c7eec480 is in history
Change-Id: Ie1cdb9a928f97681ab4083b68db3fd453b0399e5
am: 511a7bf235 -s ours
am skip reason: change_id I9f708a252ab606b782f5f828dce8c1690c3703bf with SHA1 9dc3a9e437 is in history
Change-Id: Ia333cf3cbe2368146ac701bb83e52e131291503c