Limit the amount of parked code built into Connectivity module
Test: built successfully.
Bug: 300522527
Change-Id: I87d7516011c469aa89fc7e67cf03c4ee8aa1bb9b
framework-connectivity-t-mdns-standalone-build-sources should only be
used for building service-connectivity-mdns-standalone-build-test. Added
comment to prevent this filegroup being used in wrong way.
Test: TH
Change-Id: I11dd390967db1a115dcadcdebc20f226ab6c0a51
This will allow using different values for the variables without having
merge conflicts in the dependencies list for each build rule.
Bug: 295788084
Test: m
Change-Id: I7b64a5a01d1f8139e7ce30ce95903d71cb09de9f
Add RemoteAuthService APIs and Stubs (hide) for Settings of D2DA
This CL introduces new SystemApi allow user to discover remote devices
compatible to be registered as remote authenticators via RemoteAuthManager
Design doc: go/remote-auth-manager-fishfood-design
Test: built successfully.
Bug: 290092977
API-Coverage-Bug: 294934095
Change-Id: Iaaae1126065fdc3db469eeb8d85ac654b8199a12
Components that can provide offload like IpClient (packet
filter offloading) can use the API to register a callback to be notified
when offload is necessary.
Bug: 269240366
Test: atest CtsNetTestCases
Change-Id: I8080702f5b530001b88e79e504f4722ac01bc576
HalfSheetUX uses private apis of framework-connectivity-t. It appears
that using just "framework-connectivity-t" will compile against either
the stubs or source of framework-connectivity-t depending on if the
module was included in the same apex as it or not.
aosp/2462194 is adding the ability to compile modules like HalfSheetUX
outside of the context of the apex, at which point it will start
compiling against stubs if we don't explicetly specify to use the
implementation library.
Bug: 254205429
Test: m javac-check with aosp/2462194
Change-Id: I1d41e47aa0e4e3d320b78b28cfc181fc30c4537c
Merged-In: I1d41e47aa0e4e3d320b78b28cfc181fc30c4537c
ConnectivityCompatChanges.java becomes the centralized place for all the
CompatChanges used in the Connectivity module. By putting all the
CompatChanges here, we are able to manage them under a single
platform_compat_config.
Bug: 268440216
Test: atest FrameworksNetTests
Change-Id: I3e17af545718073d7d1c96e27298e7790563fd33
Previously, the hiddenapi*-tiramisu.txt files that were created as part
of the work for creating framework-connecvity-t were just added to the
list of hidden API files on the bootclasspath_fragment. Unfortunately,
that made it impossible to exclude those when generating an sdk
snapshot for S which cannot include framework-connectivity-t.
This change moves those files to be part of framework-connectivity-t
instead of the bcpf so that they will only be used in an sdk snapshot
when the library is part of the snapshot.
Bug: 240406019
Test: packages/modules/common/build/mainline_modules_sdks.sh
# Ran the previous command with and without this change to make
# sure that this change does not change the sdk snapshot
# contents. A follow up change will exclude the
# framework-connectivity-t library from the S sdk snapshot.
Change-Id: Ib5c5c6046d96b911c8e9e5ac3729ce963f1b6907
Do not use framework-connectivity stubs for
framework-connectivity-t-pre-jarjar, as that library can build against
the full framework-connectivity implementation including hidden symbols:
it already builds against framework-connectivity-pre-jarjar.
The stubs are only necessary to build framework-connectivity-t stubs, to
avoid circular dependencies between these and the framework-connectivity
implementation.
This change allows using hidden symbols of framework-connectivity in
framework-connectivity-t-pre-jarjar, but does not fully fix the problem
as framework-connectivity-t will use the framework-connectivity stubs
both to build its own stubs and to build its implementation library, due
to "libs" being used in both cases (and prioritized over
impl_only_libs). As a result, it is still not possible to build
framework-connectivity-t when it references hidden symbols of classes
that are also part of the stubs. Still, this is a first step and
organizes the build rules closer to what they should be.
Bug: 139774492
Test: m
Change-Id: I5e696fa6a7871d048e0ba16442de33b5f139faae
Add back compat config for RUN_NATIVE_NSD_ONLY_IF_LEGACY_APPS, which was
lost when moving NsdManager to framework-connectivity-t.
This causes NsdManager to start mdnsresponder again when used by apps
with target SDK < 31.
The change also changes the compat ID used, to make sure it does not
conflict with the ID already in use in S and below, when the module is
installed on such a platform. This is the only ChangeId used by
framework-t.
Also add a CtsNetTestCasesMaxTargetSdk30 test to verify that behavior.
Bug: 235355681
Test: atest CtsNetTestCasesMaxTargetSdk30
Change-Id: I7ca6051d0a4ba5aff3e44bece2cbac22eb1be32d
R8 emits "missing class" warnings when optimizing service-connectivity
because service-connectivity combines several already built static_libs
(service-connectivity, service-connectivity-t, service-nearby), but does
not specify any classpath library, which are actually needed for R8.
This causes wrong optimizations, where R8 would sometimes strip out code
that it thinks is unused (because it considers it unreachable due to the
missing class, or it does not know the superclass of a callback and
thinks the overridden methods cannot be called).
Add the necessary classpath libraries to remove the warnings.
Bug: 226127213
Bug: 239990030
Test: m service-connectivity, see no "Missing class" warnings
Change-Id: I1eaa39b70da4b540e3a3e8e798bec1359b5bf533
(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
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
Reference Sources.bp from Android.bp, so that they are used as build
files.
Sources.bp is separate from Android.bp as it was migrated from the
Android.bp files in the old code location. They can be merged into the
main Android.bp file (or removed by removing the filegroups) after the
migration is done.
Also remove references to the AIDL filegroups, as files are now merged
into the common framework/aidl-export directory which is used as include
directory for aidl source generation already, so they do not need to be
referenced separately. framework/aidl-export can contain AIDLs for S-
API classes that became updatable API in T (the contents of
framework-t), as they are the same as any other API class for the
purposes of AIDL code generation: it's OK for any S+ code to reference
S+ API classes.
Finally, fix reference to mByteStream in IpConfigStoreTest. It was
already wrong but did not break the build because the test was not being
built in the old location.
Bug: 222234190
Test: TH
Merged-In: I81893df9f327abb84f1561b2b33027a2d23a4d65
Merged-In: I67c703e3f7aa9d5787f032a79ed62e45412baf4f
Change-Id: I9093f9ae2f9d76e597f20de48680e459891755b4
Reference Sources.bp from Android.bp, so that they are used as build
files.
Sources.bp is separate from Android.bp as it was migrated from the
Android.bp files in the old code location. They can be merged into the
main Android.bp file (or removed by removing the filegroups) after the
migration is done.
Also remove references to the AIDL filegroups, as files are now merged
into the common framework/aidl-export directory which is used as include
directory for aidl source generation already, so they do not need to be
referenced separately. framework/aidl-export can contain AIDLs for S-
API classes that became updatable API in T (the contents of
framework-t), as they are the same as any other API class for the
purposes of AIDL code generation: it's OK for any S+ code to reference
S+ API classes.
Finally, fix reference to mByteStream in IpConfigStoreTest. It was
already wrong but did not break the build because the test was not being
built in the old location.
Bug: 222234190
Test: TH
Merged-In: I1fe5091361c7766dc7b6b4fb8c7b62d403e950bb
Change-Id: If738f607be84b3d7e2045a83a4d2976ed0d4e188
- move ethernet APIs, build it into framework-connectivity-tiramisu
- start ethernet service from ConnectivityServiceInitializer
- fix EthernetManager dependnecy in Tethering module
- fix EthernetNetworkSpecifier dependency in framework-connectivity
- fix the ethernet related config resource
Bug: 210586283
Test: m
Test: atest FrameworksNetTests EthernetServiceTests
Ignore-AOSP-First: Topic of Ethernet Mainline has merge conflict with
master, merge this CL first and cherry-pick it back.
Change-Id: I54857b8517649048a343c72797668394d5225766
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
framework-connectivity need to see the aidl files when
compiling IConnectivityManager.aidl, and it can only
include the files by specifying aidl include_dirs.
Thus, move the file into the module since the one outside
of the module is going to be deleted soon.
Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Test: TH
Bug: 197717846
Change-Id: Ide7431d0c98aebd389bee86d13ff44f5ef8b8283
Merged-In: Ide7431d0c98aebd389bee86d13ff44f5ef8b8283