aosp/2384137 added cronet to framework-tethering.
But framework-connectivity is a better place to put cronet since
cronet does not work on R devices (b/270049141) and
framework-tethering is R+, framework-connectivity is S+.
Followup CLs will move some modules (e.g. CronetJavaPrejarjarDefaults)
that use the branch dependent soong variables to framework/Android.bp
Test: TH
Bug: 278070640
Change-Id: I6bc10116759fb9e083c02147908e53022dab740a
Note: this switches
com_android_networkstack_tethering_util_setupIcmpFilter
over to relative cbpf which in turn is called from:
com_android_networkstack_tethering_util_setupNaSocket
com_android_networkstack_tethering_util_setupNsSocket
and tested by p/m/C's:
TetheringUtilsTest.java - testIcmpSocketFilters()
Test: TreeHugger, atest TetheringUtilsTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I22a5ea8f8e3b879a37fe4acd84f61020661eaa71
There's now a shared defaults module for this kind of filegroup. Use
that and remove the previously duplicated prop.
Bug: 271816210
Test: m
Change-Id: Ia4547984a73179fdfc98c427482dd10246f9722c
This change introduces a limited library for dependencies on
framework-connectivity from Tethering,
connectivity-internal-api-util, where all classes are annotated with
@RequiresApi(S) to ensure proper API checks are done before usage.
Bug: 245972418
Change-Id: I82bafd9063341adc71d07f0858e6d68283d081f0
gen_jarjar supported multi-valued arguments via space-separated lists,
like "--apistubs foo bar". This is unusual, as "bar" would generally be
interpreted as a positional argument instead.
Change the usage to "--apistubs foo --apistubs bar", which is more
conventional. Also remove the "--jars" switch to have the jars be
positional arguments instead, and change the "--unsupportedapi"
arguments to be a column-separated list (like java classpath), instead
of space-separated. For --unsupportedapi, this allows providing a list
of files via minimal modifications in the genrule usage.
Test: m
Change-Id: Id67ad16de2ea6682fee402540f464ed3b5b0cca9
(This rolls forward part of a previous change, now that jarjar was fixed
to not get very slow when the number of rules increases).
Autogenerate connectivity jarjar rules at build time, to avoid issues
with forgotten jarjar rules or hard-to-diagnose errors introduced by
incorrect rules.
This change causes all classes in framework-connectivity(-t) and
service-connectivity to be jarjared into android.net.connectivity, but
still avoids jarjaring classes in com.android.server as before, to keep
it small.
For many classes this differs from the original jarjar rule.
Notes on implementation:
- connectivity-jarjar-rules now has a subset
framework-connectivity-jarjar-rules containing only the rules
necessary for framework-connectivity. This is necessary because
framework-connectivity cannot depend on rules generated based on
service-connectivity, as there would be a dependency cycle
(service-connectivity depends on framework-connectivity); Soong even
crashes with a stack overflow.
- framework-wifi.stubs.module_lib is added to
framework-connectivity-pre-jarjar as it is necessary to build it (it
is already in impl_only_libs in the defaults).
It is unclear why framework-connectivity-pre-jarjar could build
before that (possibly because it was only used as "lib" ?)
- Fix package-private visibility; for example NattSocketKeepalive,
TcpSocketKeepalive are not API so should be jarjared, but are used
by ConnectivityManager which is not jarjared, so they are not in the
same package after the change. Package-private members in the
former 2 need to be public to be accessible. Changes in this commit
are all that is needed, as demonstrated by followup commits that move
the classes to a different package without further changes, and that
enforce that no class in an API package gets jarjared.
- framework-connectivity-internal-test-defaults is separated from
framework-connectivity-test-defaults, for unit tests that need to
access internal jarjared classes. Such tests need to use the jarjar
rules themselves too, so this is only appropriate for connectivity
internal unit tests.
Test: atest ConnectivityCoverageTests CtsNetTestCases
Bug: 217129444
Change-Id: Ib1bd939b71c0171d945fc01b96195d2f620ff13b
Add the required lib to the user of net-utils-framework-common-srcs
which has LocationPermissionChecker.
Bug: 158059172
Test: m
Merged-In: Id54de2bd94e8b5821814715683b5b2520f1f026e
Change-Id: Id54de2bd94e8b5821814715683b5b2520f1f026e
(cherry picked from commit d795228affd7e7ad828adb2bf4fbcb9093c3f377)
The depfile concept in Soong and Ninja isn't applicable in Bazel because
Bazel requires listing the deps explicitly. This CL changes the module
type from gensrcs to java_library with proto.type set to "stream".
The end goal is to eventually deprecate depfile in gensrcs to ensure all
gensrcs modules are convertable to Bazel.
Test: CI
Bug: 179452413
Change-Id: I921324e6260b7de6329a1ff445b6326643a9c526
This reverts commit 53eb35cd82.
Reason for revert: b/233081774, caused long build times in FrameworkNetTests
Change-Id: Ide01c994f694b55fc0e87bb0e81584ac44196e68
Jarjar rules are hard to keep in sync with code, and hard to maintain
manually as the distinction between what should and should not be
jarjared is not always clear. This results in unsafe binaries that are
manually maintained, and developer frustration when something fails due
to incorrect jarjar rules.
Autogenerate jarjar rules at build time instead. This is achieved by
introducing a jarjar-rules-generator python-based library, which scans
pre-jarjar intermediate artifacts, and outputs jarjar rules for every
class to put it in a package specific to the module. The only exceptions
are:
- Classes that are API (module-lib API is the largest API surface of
the module)
- Classes that have unsupportedappusage symbols
- Classes that are excluded manually (for example, because they have
hardcoded external references, like for
ConnectivityServiceInitializer in SystemServer).
This change causes all classes in framework-connectivity(-t) and
service-connectivity to be jarjared into android.net.connectivity, but
still avoids jarjaring classes in com.android.server as before, to keep
it small.
For many classes this differs from the original jarjar rule.
Notes on implementation:
- connectivity-jarjar-rules now has a subset
framework-connectivity-jarjar-rules containing only the rules
necessary for framework-connectivity. This is necessary because
framework-connectivity cannot depend on rules generated based on
service-connectivity, as there would be a dependency cycle
(service-connectivity depends on framework-connectivity); Soong even
crashes with a stack overflow.
- framework-wifi.stubs.module_lib is added to
framework-connectivity-pre-jarjar as it is necessary to build it (it
is already in impl_only_libs in the defaults).
It is unclear why framework-connectivity-pre-jarjar could build
before that (possibly because it was only used as "lib" ?)
- Fix package-private visibility; for example NattSocketKeepalive,
TcpSocketKeepalive are not API so should be jarjared, but are used
by ConnectivityManager which is not jarjared, so they are not in the
same package after the change. Package-private members in the
former 2 need to be public to be accessible. Changes in this commit
are all that is needed, as demonstrated by followup commits that move
the classes to a different package without further changes, and that
enforce that no class in an API package gets jarjared.
- framework-connectivity-internal-test-defaults is separated from
framework-connectivity-test-defaults, for unit tests that need to
access internal jarjared classes. Such tests need to use the jarjar
rules themselves too, so this is only appropriate for connectivity
internal unit tests.
Test: atest ConnectivityCoverageTests CtsNetTestCases
Bug: 217129444
Change-Id: Ied17c3955ea2fda130089265d02908937ad8af1e
Gate presence of excluded routes in LinkProperties on target sdk T.
Bug: 186082280
Test: atest LinkPropertiesTest
Change-Id: If8fdb468a0a4968c5f2a878b7aacfeb4f7d9a9e5
- Have MDnsManager to manage mdns native service binder call.
- Register it as a system service for NsdService.
- NsdService will use aidl to communicate with mdns, so add the
relevant lib to framework-connectivity
- Add jarjar rule for mdns-aidl-interface classes.
Bug: 209894875
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: Ibc8b726c01a15015b450caf94d0afed570117b7f
While dumpProtoLocked is called, InvalidProtocolBufferException
occurred because types are mismatched between platform side and
module side.
netstats.proto was moved into connectivity module, both the
platform(incident.proto) and the module uses protoc-gen-javastream
to generate the Java classes from it. It should be fine since
platform includes the source of the proto, and jarjar the generated
classess in the module to avoid conflict with platform.
Bug: 218566849
Test: adb shell incident 3001
adb shell dumpsys netstats --proto
atest CtsIncidentHostTestCases:IncidentdTest#testIncidentReportDumpAuto
Change-Id: I09cae385050e569b1da98ad7de0e226b13ee6895
Merged-In: I09cae385050e569b1da98ad7de0e226b13ee6895
This CL builds NetworkStats related codes with the
connectivity module instead of platform.
Test: TH
Bug: 197717846
Change-Id: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Allow core tests to use hidden connectivity APIs. Benchmark tests in
particular cannot be run without these.
Ignore-AOSP-First: Avoiding merge conflicts, cherry-pick will follow
Bug: 197717846
Test: m
(cherry-picked from ag/16772124)
Change-Id: Ia01f24317d14b063f9a7e24c3ada11b140641c50
Merged-In: Ia01f24317d14b063f9a7e24c3ada11b140641c50
(cherry picked from commit 7174ac3d86)
Bug: 204153604
Ignore-AOSP-First: part of large topic that only builds internally
Test: build, FrameworksVcnTests, FrameworksIkeTests
Change-Id: I40740200fe4a7476a21bb5330429a11c97e38fb8
Merged-In: I40740200fe4a7476a21bb5330429a11c97e38fb8
NetworkUsageStatsTest is the CTS test for the NetworkStatsManager
public APIs. Rename it to NetworkStatsManagerTest, since that is
a better name for it.
Also move it to the networking CTS tests, where it will run on
presubmit on every supported Android version (S, T), and can
access hidden networking APIs. This is important because
NetworkStatsManager is being mainlined in T.
Bug: 204830222
Test: atest CtsNetTestCases:NetworkStatsManagerTest
Change-Id: Ie0fd267aa8bf94594fcc939a8493bef8ab14d3fe
Allow framework-connectivity to depend on framework-connectivity-t
stubs, and framework-connectivity-t to depend on prebuilt (to avoid
circular dependencies) framework-connectivity stubs to compile its own
stubs, and framework-connectivity.impl to compile its implementation.
Also reorganize jarjar rules so that service and framework jar can use
static libraries in framework-connectivity without packaging their own,
reducing duplicate code.
Bug: 204830222
Test: m
Change-Id: I75c34986e7c479de23cdb2e9b360fa1fede018c9
Connectivity as otherwise method names are not visible in the collected
binder latency data.
Test: N/A
Bug: 208515821
Change-Id: I0e6c6dcd4663f0abe473d39f7de4c718ac3fb66f
When NetworkInfo(null) or setDetailedState(null, any, any) are
called, S used to not crash but plant a null bomb for later
which may explode in some calls (notably, parceling) : see the
bug referenced below for details.
To help catching these errors earlier a patch was made to crash
as soon as one of these methods is called with a null argument,
but this will also crash incorrect use on existing code that
may never actually step on the mine, crashing code that used not
to crash. For safety, implement the new behavior only on T.
Bug: 145972387
Test: NetworkInfoTest
Change-Id: Ib710497d83b2d26439c2bd4d2f572310db97d6fd
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
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
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
Bug: 171540887
Test: m
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: I3db00acc79b11058a1c235916b9bfe6c759afda5
This reverts commit 326f7bb023.
Reason for revert: broke errorprone:
"Error: Call requires API level 31 (current min is 30)"
Bug: 190350403
Change-Id: Ib778ba7a882dabc4d42ab9689e1cc51d09d9be62
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
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
Bug: 171540887
Test: m
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Ied5faa1a370cbc8836f46388fdb9b42d2a263232
Instead of including the whole libc++ library by linking it dynamically,
use the static version so that unused symbols can be stripped.
This allows reducing the APEX size by 1MB (3.7MB -> 2.7MB), as otherwise
libc++ is included twice for 32 and 64 bit variants.
Original change (project moved):
Ia66d795cf23d6f45997278300c103976433f7c5c
Bug: 171540887
Test: Device boots and has connectivity, size reduced
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Ie1c5b2ea274238a226ad2d827148439fd5758bb5
NetworkUtils can just use the NDK to achieve the same.
Also make sure network handles can have the local nameservers flag, for
the JNI API, and create/parse them accordingly in Network.
Original change (project moved):
I2e7b78263f7ca0cab9458854858a7423f6bd2854
Bug: 171540887
Test: atest CtsNetTestCases (in particular MultinetworkApiTest,
DnsResolverTest, NetworkTest)
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: I7a523aac93094beef6ff40d50678c12fe8840940
The API is the getter couterpart for setprocnetwork.
Use it in NetworkUtils so that the NDK API can be the source of truth
for the process network.
Original change (project moved):
Ie8f68cf1fa57deddb63324c1abf3d6fd5b0ef500
Bug: 171540887
Test: atest CtsNetTestCases
Tests in change I311b58585033c2ca50ce5477ea9cd94b6f127507
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Iaf255f4aa29fd2ae02770baea5548ee8d5d407f2
This library can be removed because the annotations are no longer
used out of module.
@RestrictBackgroundStatus and @MultipathPreference are defined
in connectivity mainline module. Annotate these in non-updatable
platform is not going to be manageable long term. For example,
if the module gets updated and the annotation gets more values
then it's a problem in non-updatable platform. So, it should
not have IntDef cross module boundaries.
Ignore-AOSP-First: AOSP doesn't include this change yet
Bug: 183972925
Test: build
Change-Id: I63f1fde73c4ffdaff9fda914e33cbb5a110ba64e
This change is to address API review, add respective
@IntDef for network policy API.
Typedef cannot be exposed as SystemApi so add
ConnectivityAnnotations class and add an annotation library
so that it can be used in module and platform.
Bug: 183972925
Test: m, build doc target framework-doc-stubs_annotations.zip
and check the APIs have an attribute IntDef annotation
Change-Id: Ie3ec40cf48818edd422a4550377774eae387d3b2
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
Ignore-AOSP-First: needs per-branch move for merge conflicts
Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc
Keep the utilities included via a library, but move them out of
core/jni, and prepare a library to package them together with
framework-connectivity.
Also remove unnecessary dependencies in framework-connectivity.
Bug: 171540887
Test: device boots and has connectivity
Merged-In: I0b55dfe92f3cb6e848d79ac7953756f39aaa2597
Change-Id: I0b55dfe92f3cb6e848d79ac7953756f39aaa2597
framework-connectivity needs to build only against stable APIs.
Bug: 171540887
Test: m framework-connectivity.impl
Merged-In: I2d51d37d067bf6fe86e4dedf05855a2dd67ed57c
Change-Id: I2d51d37d067bf6fe86e4dedf05855a2dd67ed57c
Cleanup framework-connectivity to reduce its memory and storage usage:
- Build libframework-connectivity-jni using standard C and removing
dependencies on libc++. This saves about 100kB of storage (40+60kB
on the 32+64 bit variants).
- Remove dependency on protobuffer libraries, as their usage has been
removed. This saves about 15kB of storage.
From local measurements, the reduced code size also improves memory
usage.
This also removes a jarjar workaround for net-utils-device-common, as
the library is no longer used either.
Bug: 184111895
Test: device boots, connectivity working
Change-Id: Ibfbd0fe1098293812ae24812621752a7a44f9130