Commit Graph

20 Commits

Author SHA1 Message Date
Colin Cross
ece3171cf0 Revert "Autogenerate connectivity jarjar rules"
This reverts commit 53eb35cd82.

Reason for revert: b/233081774, caused long build times in FrameworkNetTests

Change-Id: Ide01c994f694b55fc0e87bb0e81584ac44196e68
2022-05-18 18:30:27 +00:00
Remi NGUYEN VAN
53eb35cd82 Autogenerate connectivity jarjar rules
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
2022-05-13 17:30:06 +09:00
Remi NGUYEN VAN
0395b70000 Use Sources.bp for building
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
2022-03-25 14:58:43 +00:00
Xiao Ma
0a171c006c Build ethernet framework source into framework-connectivity-tiramisu
- 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
Change-Id: I54857b8517649048a343c72797668394d5225766
Merged-In: I54857b8517649048a343c72797668394d5225766
2022-03-14 14:06:35 +00:00
paulhu
537f72061a Rename framework-connectivity-tiramisu to framework-connectivity-t
Bug: 215434166
Test: build, flash, device boot to home.
Merged-In: I9ebedf8813cbfa30d979bc35a3b2306715be682b
Change-Id: I9ebedf8813cbfa30d979bc35a3b2306715be682b
2022-03-01 09:44:21 +08:00
Junyu Lai
eb6f4bef96 [MS54.3] Move NetworkStats to updatable sources
This CL builds NetworkStats related codes with the
connectivity module instead of platform.

Test: TH
Bug: 197717846
Change-Id: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
2022-02-28 03:24:19 +00:00
Aaron Huang
b5af0fe5dc Fix tab by replacing it with spaces
Test: no code changes
Change-Id: I3644c4914486189d58c8e59ac62c6856296cce08
2022-02-11 13:52:29 +08:00
Junyu Lai
d54fcc49a7 Merge "Add visibility for core tests" 2022-02-10 09:23:57 +00:00
Treehugger Robot
a8ae24410d Merge "[MS55.2] Move NetworkStateSnapshot into module folder" 2022-02-10 05:02:45 +00:00
Remi NGUYEN VAN
85a4e07826 Add visibility for core tests
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
2022-02-09 23:08:37 +08:00
Treehugger Robot
0ad3becd60 Merge changes from topic "split-pre-jarjar"
* changes:
  Enable framework-connectivity-t-pre-jarjar for service-t
  Split out connectivity-t-pre-jarjar and tests
2022-02-09 12:54:46 +00:00
Junyu Lai
dc0d521f63 [MS55.2] Move NetworkStateSnapshot into module folder
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
2022-02-09 10:51:37 +00:00
junyulai
91e3dc2fe6 Enable framework-connectivity-t-pre-jarjar for service-t
framework-connectivity-t-pre-jarjar build target is needed
by service-t, thus, enabled this target on sc-mainline-prod
but still keep framework-connectivity-t disabled.

Bug: 204830222
Test: m
Change-Id: I03cbdb57966b746f3c93e989394a4dc999fe863a
2022-02-09 18:29:56 +08:00
Remi NGUYEN VAN
2ba9dbe163 Split out connectivity-t-pre-jarjar and tests
The pre-jarjar variant is necessary so that service-t can depend on
hidden symbols in framework-t that reference (for example as parameter)
classes that are jarjared.
Without this, when depending on framework-connectivity-tiramisu.impl,
service-connectivity-t would see post-jarjar symbols that do not match
the classnames it uses in its code.

Also split FrameworksNetTestsLib so that the same jarjar rules can be
applied between the tests and the module, avoiding different errors
between FrameworksNetTests and ConnectivityCoverageTests.

Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Bug: 204830222
Test: m
Change-Id: I3d0c081c4a7422e128beee11c0156f01b0377c96
Merged-In: I3d0c081c4a7422e128beee11c0156f01b0377c96
2022-02-09 18:29:30 +08:00
Aaron Huang
720ad7c026 Have connectivity targets be visible to Frameworks[Vcn|Ike]Tests
(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
2022-02-08 14:31:27 +00:00
Lorenzo Colitti
eb8d8554bb Rename NetworkUsageStatsTest and move to networking CTS tests.
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
2022-02-01 11:24:39 +00:00
Remi NGUYEN VAN
6a20eeda42 Reorganize connectivity framework dependencies
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
2022-02-01 13:33:48 +09:00
Remi NGUYEN VAN
a2f7b18680 Link empty nearby library into tethering apex
Nearby will be merged together with the tethering/connectivity APEX, so
that module maintenance efforts can be reduced, and the two codebases
can evolve the interfaces that they expose to each other over time.

This is a cherry-pick from downstream branches, with some differences:
 - nearby/Android.bp is added with empty libraries
 - There is no API change, as no API classes are added
 - proguard is not applied, so no proguard rules change
 - HalfSheetUX APK is not added to the APEX

Bug: 189355156
Test: m
Merged-In: If4b40689a257d2806f895cd2dded97fc699adc5f
Change-Id: I2eb965a0965ffce08388278945160e57e8094339
2022-02-01 12:12:53 +09:00
Remi NGUYEN VAN
24b3c37e0a Prepare T build rules for backwards compatibility
- Add a default to framework-connectivity-tiramisu for disabling
  T-only build rules.
- Separate the tiramisu hidden apis from hiddenapi txt files, so
  that the framework-connectivity-tiramisu file can avoid being
  referenced by the APEX when the JAR is not part of it.

Bug: 206893064
Test: m
Merged-In: I37c7385b456e4d71789aafe33cc8375adf40a681
Change-Id: I37c7385b456e4d71789aafe33cc8375adf40a681
2022-01-20 13:57:44 +08:00
paulhu
802ab9760f Build framework-connectivity-tiramisu library
- Move nsd APIs and build framework-connectivity-tiramisu library
- Add nsd associated hidden apis
- Build service-connectivity-tiramisu-pre-jarjar library for
  T+ services.
- Move ConnectivityServiceInitialiizer to service-t directory
  to create S+ service instances which can avoid dependency on
  lower sdk library.

Bug: 206893064
Test: atest FrameworksNetTests CtsNetTestCases
CTS-Coverage-Bug: 207804007
Merged-In: I9628716f5c38047ff4ea2346b27589077259c436
Change-Id: I9628716f5c38047ff4ea2346b27589077259c436
2021-12-17 00:04:24 +08:00