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
Have all callers to use the same constructor and remove the
unused constructors.
Bug: 238843364
Test: FrameworksNetTests
Change-Id: Ieb1d0bc4ff8d2238c7a802189f8d91f4a9978eb8
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
Use new Builder API which was introduced in Android T.
Bug: 238843364
Test: FrameworksNetTests
dumpsys netstats --checkin and check the output
Change-Id: Ieb0a2ee04056a1cedb71274ea710ff5153e2d68c
Just include all files with a blob, instead of listing them separately.
All files in the directory were previously referenced by
framework-connectivity-tiramisu-updatable-sources, so this is a no-op.
Bug: 217129444
Test: m
Change-Id: I83415b8f2a5836874c5ea2bffee45c43e03cc139
(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 74607dd786.
Reason for revert: Continue development in T+/U
Bug: 227513829
Test: cts test
Ignore-AOSP-First: nearby_not_in_aosp_yet
Change-Id: Ib648ed7163a2e1f11eeed3d0d3469decf64d9d86
CTS-Coverage-Bug: 205591293
Use Builder API which was provided in Android T to
build a template.
Bug: 238843364
Test: build, FrameworksNetTests:NetworkStatsManagerTest
Change-Id: Ibf1ac16541d6f3ddaf9b241e2f47ae04acbedf93
"{@see" aren't rendered properly. Replace them with "See {@link"
or @see depending on the usage.
Bug: 238753273
Test: make doc-comment-check-docs ; Check the doc result
Change-Id: I70cb2f36e7c5fa8102b5949054df5184d755202c
NetworkStatsHistory internally assumes that bucketStart is
sorted at all times. However, in the fields, we've found there
are some buckets of NetworkStatsHistory do not preserve the
order of timestamp, which is caught by the IAE when addEntry
is called.
In order to provide backward compatibility, return sorted items
instead of throwing IAE when adding entry into
NetworkStatsHistory instance.
Test: atest android.net.netstats.NetworkStatsHistoryTest#testBuilder
Bug: 233825704
Change-Id: If3187384bd1e90770ca5873b8ec73e852fff543d
Merged-In: If3187384bd1e90770ca5873b8ec73e852fff543d
(pure cherry-picked from ag/18581718)
In current design, the interface will be removed from the list if
the network disconnected which will cause getUidStatsForTransport()
returns unexpected snapshot to caller since the list is empty.
This change also remove interface name from all entries before
the method returns the result.
Bug: 231514741
Test: FrameworksNetTests
manual test
Change-Id: Ie60829a65d0d9b5b63ad353695a820c0586e3665
Merged-In: Ie60829a65d0d9b5b63ad353695a820c0586e3665