The current logging relies on the system log that may rotate. This is a
problem to investigate bugs where the network stack service is not
started. Add a SharedLog to NetworkStackClient and dump it in
ConnectivityService (for lack of a better place to dump it).
Bug: 124307802
Test: Booted, dumpsys connectivity shows the log
Change-Id: If596451d0613645f68a8a32acb032eea76ea506c
The wrong overload of PackageManager is being called, setting
USER_SYSTEM as flag instead of the user to resolve the network stack
UID.
Test: phone boots, WiFi works, additional tests in child CLs
Change-Id: I89b11b38c390d0e77a5917c74daccccd74c2d0a3
Classes that are used in framework.jar cannot be linked in NetworkStack,
as the framework takes precedence in the classpath. This prevents the
networkstack from using these classes due to the hidden API usage
detection.
Do the following:
- jarjar any shared source file between framework and NetworkStack, so
the version in the NetworkStack uses a different package.
- Move any shared class not used in the NetworkStack to services.net
The CL uses jarjar on the app copy and not the framework classes, as
the framework cannot be updated without an OTA, and non-network stack
specific classes should not be renamed because of the network stack.
Test: atest FrameworksNetTests NetworkStackTests
Test: flashed svelte build, WiFi works
Bug: 124033493
Change-Id: I85d888b756adc28c36638913632bfdfdbf0e0486
NetworkStack is only used in services.net or clients of services.net. It
cannot stay in framework.jar because it needs to depend on AIDL
interfaces, which would conflict with app implementations if they were
in framework.jar.
Test: atest FrameworksNetTests NetworkStackTests
Bug: 124033493
Change-Id: Ib1d08a3669983640119d008db7e2990fa798724f
Merged-In: I501b125a388c1100c2182bde4670944c2f0d7a02
Includes various small changes to stop using hidden APIs
Test: make NetworkStack
Test: flashed, booted, WiFi and tethering working
Bug: 112869080
Change-Id: Id2830795a444f484b377ed6437435a1cd833697a
This reverts commit d8bc829a85.
Reason for revert: Refactoring was unnecessary
Merged-In: Ib4e7da3274e49f25676505a08e6ce7e7b0dfdb8d
Change-Id: Iff332c680315b560f0b762c1d7311ec83d539115
Includes @SystemApi for Context.NETD_SERVICE so system apps (including
the network stack) can obtain the service.
Test: m
Bug: 112869080
Change-Id: Ida63747cd30abb7b3c19559803353eb0e42e6efa
The wrapper was useful to help clients migrate out of the old API, but
all clients are now migrated.
It also conflicts with IpClient in the NetworkStack on Go devices.
Test: Flashed, booted, WiFI works
Bug: 123371264
Change-Id: Ibf04ad9371a07d2c66c478547539ba41c540116f
This will allow us to use network observers in the NetworkStack
app without duplicating too much code.
Bug: 112869080
Test: atest FrameworksNetTests
Test: builds, boots, wifi works
Change-Id: If54fa3a88110ffa815899d385dbb0d5770abaead
This avoids the need to expose ConnectivityService implementation
details as @SystemApi and the complexities that would be required
to make NetworkCapabilities parcelable in stable AIDL.
Bug: 112869080
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: Icd5d25b9b8e9b7a7d1899b000c92dc4976c3b3d7
The wrapper allows migrating clients of the IpClient in the NetworkStack
independently.
Test: atest FrameworksNetTests NetworkStackTests FrameworksWifiTests
Bug: 112869080
Change-Id: I1250730c07166298bee2816f05351ba95416994a
This helps remove the dependency on MultinetworkPolicyTracker from
IpClient.
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: If56791dbed564772f25a859f301b8b52d84e38a3
- DhcpClient only shares its handler with IpClient, and NetworkMonitor
has its own handler: remove Protocol.BASE_DHCP,
Protocol.BASE_NETWORK_MONITOR
- Remove dependency on Network.netid in NetworkMonitor
- Remove dependency on Sets.newArraySet in DhcpServingParams
- Remove dependency on formatDuration() in DhcpClient
- Replace isMetered() with hasCapability() in NetworkMonitor
- Use WifiManager.isScanAlwaysAvailable instead of reading setting
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: Ieef54d847ddc081fb33cbad0b050b06d2e52548e
Added methods are used by the NetworkStack.
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: I8822d43c1a4981ca39289525685b3f975fb0e8d5
libcore.io.SizeOf is an internal API and is going away soon.
Note: The files touched by this CL have some other unused
imports which I did not touch. Therefore I had to use
"repo upload --no-verify" to upload this CL to gerrit.
Bug: 123174577
Test: Manually checked that this CL applies cleanly in internal
master and that no other uses of SizeOf then remain in
internal master's frameworks/base
Test: Treehugger
Change-Id: Ib29a195f3dda2f21ebbe2f7073e0af4dbb524b19
The API will be used to interact with IpClient once it is moved to the
NetworkStack process.
This change keeps compatibility with the previous API so that clients
can be migrated independently.
Test: atest FrameworksNetTests NetworkStackTests
Bug: b/112869080
Change-Id: I57d8164afae849230bbc0e25f17859c0b22d0f29
Introduce a stable AIDL parcel class, DhcpServingParamsParcel, and
methods to convert to and from that class to DhcpServingParams.
This will be used to move DhcpServer to the NetworkStack app.
Test: atest FrameworksNetTests
Bug: b/112869080
Change-Id: I276b7affccb938059769c90a53f0f6beb26e6ede
The current code only uses InterfaceParams#name, and InterfaceParams is
defined in services/net which DhcpServer cannot depend on once moved to
a separate app.
Test: atest FrameworksNetTests
Bug: b/112869080
Change-Id: I94c7dce33200c111666a9dddde82ac2e66a6794f
Some network re-writing packet from broadcast MACs to unicast,
result in this kind of packets cannot be dropped by APF filter.
Thus, drop ARP reply if source IP is 0.0.0.0.
Note: Linux kernel always ignores such replies in the function arp_process().
Bug: 118044271
Test: runtest frameworks-net -c android.net.apf.ApfTest
Change-Id: Id293bf231913d9b483ce7d8dd909e05fa927ccd7
Read a pcap file and runs it through APF filter, then checks whether all
packets in the file are dropped.
Test: runtest frameworks-net -c android.net.apf.ApfTest
Change-Id: I7fc59864608762cd2bc84131817183846b0bf5b5
StructGroupReq is imported but not used.
The import can be removed.
Bug: 113148576
Test: build only
Change-Id: I6b2ec5eb3f6c6e298fcde8e47dfd0979f889ca1d