DeviceConfigUtils has isFeatureEnabled for NetworkStack and Tethering
which were confusing since the difference was only the arguments.
This CL renames isFeatureEnabled for Tethering module to
isTetheringFeatureEnabled to avoid confusion.
Bug: 279108992
Test: m
Change-Id: I16e8e4f6c0080d73533ce8bd36adfa7038347500
NewApi was recently updated to support linting methods in
the system, module_lib, and system_server sdks, and was
demoted to a warning due to the new issues it finds.
Baseline all the new issues that NewApi can be made an error
again.
These cls were generated automatically by a script that
copied the NewApi issues from the reference baselines.
Bug: 268261262
Test: m lint-check
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b6d6bf359ca53d41a08b7e2af86f7a080e2b5741)
Merged-In: I31beadf91173116b9750fe6f132a4f979a2e0d9a
Change-Id: I31beadf91173116b9750fe6f132a4f979a2e0d9a
Expected use case of isTetheringFeatureForceDisabled was
`enabled = !isTetheringFeatureForceDisabled`, which is error prune.
So this CL renames to isTetheringFeatureNotChickenedOut and updates to
return true if the feature is not disabled.
If the feature is enabled by default and disabled by flag push (kill
switch), isTetheringFeatureNotChickenedOut should be used.
Bug: 279108992
Test: m
Change-Id: I5f85c24032bae298831bbf042874a63ea2c9b75f
UnboundedSdkLevel stopped working on Q as it now depends on Set.of,
which is an R+ API. Arguably this should be fixed as its minSdk is still
29, but long-term UnboundedSdkLevel may drop Q support as modules now
only need to support R+.
Avoid using UnboundedSdkLevel on Q- in DevSdkIgnoreRule: this avoids the
above problem, and also makes it compatible with even older builds,
which may happen in GTS.
Bug: 292868272
Test: all tests using this rule
Change-Id: I5e1559d841398a6c6763283f32c9f766a3661e21
This change adds a backtrace() method which returns a list of events
that were received since the last time a user called poll() on a
ReadHead. This is particularly useful for logging observed events while
a poll was in progress that did not end up matching an event.
Test: atest EthernetManagerTest
Change-Id: If019cf9eb5e3e9268c5e6b74edbd8f49959cc71c
NetworkStack module imports RFC7421_PREFIX_LENGTH constant from
filegroup services-connectivity-shared-srcs, to get rid of this
dependency, move the constants to NetworkStackConstants.
Bug: 290885904
Test: TH
Change-Id: I0e8f068856c8843121273e0b598097d82b8465d5
Fix kotlin nullable errors that were exposed by setting the retention
of android.annotation.NonNull and android.annotation.Nullable to
class retention.
Bug: 294110802
Test: builds
Change-Id: I2a2c91188b64619fca190a9bd7812d32f9610abd
Add isFeatureSupported helper method to check whether
a specific feature is supported. This is useful when a specific
module version is required on a cross module feature, e.g.
a connectivity feauture requires to work with a older
networkstack module.
This commit also adds isTetheringFeatureForceDisabled() method
as a method that refers to DeviceConfig which can be controlled
to explicitly disabled.
Bug: 291870956
Test: atest FrameworksNetTests NetworkStaticLibTests
Change-Id: I511d00663e2378c36b4ca017db4b88d88f650852
On devices that do not have always active mobile data, it needs
to be requested for onAvailable to be called.
Change-Id: Ic814684bcd06389c013a6e6636487d9b47627901
Test: TH
This is a no-op refactor change to create resolvePkgPrefix()
helper method to prevent code duplication for the follow up
commit.
Bug: 291870956
Test: atest NetworkStaticLibTests
Change-Id: I8deea97acdb793dfa076ce55f7f2c3eb0b224461
in6_pktinfo structure specifies the source IPv6 address and interface
for an outgoing packet(used with UDP or RAW socket), we can specify the
IPV6_PKTINFO ancillary data on sendmsg() with this structure to set the
source address (e.g. a global IPv6 address).
Bug: 293393743
Test: TH
Change-Id: I2bd8ea6fcdb7398db9b3a54243c81ca27e832e45
This will typically be used in mainline-presubmit TEST_MAPPING
configuration to exclude some tests.
This is necessary as some tests are flaky in mainline configurations
(when running on older devices), and they need to be disabled to meet
SLO requirements, but they are not flaky on presubmit using the latest
platform builds.
Test: m
Change-Id: Ia532d6d3f9833ddec613d79c0eb517d20a1c529a
Both encode and deocde methods support message compression which is
described in RFC1035 section 4.1.4. We can leverage both methods in
a follow-up CL to parse DHCPv4 option 119 and DNSSL RA option.
This cl also adds maxLabelCount argument for DnsRecordParser#parseName
to prevent the potential recursion from overflowing the stack.
Bug: 189865016
Test: atest NetworkStaticLibTests
Change-Id: I90101ecda64bfecb0233e80ea93c91c204fbf176
This structure is useful when building an RA with RIO for integration
tests and verify the device's provisioning behavior, for example, check
if devices in ULA networks can recover its IPv6 connectivity from
receiving a normal RA after losing IPv6 default route (e.g. received RA
with zero router lifetime).
Bug: 183601771
Test: m
Change-Id: I13b85000ea1633f56edc74e3d62b7a38b9a851bf
Example use case:
BPF_LOAD_SKB_PROTOCOL,
BPF2_ACCEPT_IF_EQUAL(ETH_P_ARP),
BPF2_REJECT_IF_NOT_EQUAL(ETH_P_IP),
BPF_LOAD_IPV4_BE16(frag_off),
BPF2_REJECT_IF_ANY_BITS_SET(IP_MF | IP_OFFMASK),
BPF_ACCEPT,
which is a sample program which accepts ARP plus non-fragmented IPv4.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibe6f9f7941f11bc7b767a092d3d108fa0291f360
ticksToMilliSeconds is used to convert the clock ticks to milliseconds,
move it to a common utils class, we can call this method to convert the
rta_cacheinfo.rta_expires in user space as well to get when the default
route will expire.
Bug: 183601771
Test: atest NetworkStaticLibTests
Change-Id: Iabd510fe290f835a8fe690d91921d5b706a23b56
Parse the entire RTM_NEWADDR message instead of only parsing the nlmsg
header and Ifaddr header. Besides, that would be better to know which IP
address will be returned from kernel via netlink message, that's IPv4
and IPv6 loopback addresses.
Test: atest NetworkStaticLibTests
Change-Id: I3a01137db4a7774fa30ebdec5a1711697991b9fe
Both encode and deocde methods support message compression which is
described in RFC1035 section 4.1.4. We can leverage both methods in
a follow-up CL to parse DHCPv4 option 119 and DNSSL RA option.
This cl also adds maxLabelCount argument for DnsRecordParser#parseName
to prevent the potential recursion from overflowing the stack.
Bug: 189865016
Test: atest NetworkStaticLibTests
Change-Id: I624649c224f141848a475ac85c56012d138c5224
This allows other class to refer StructIfaddrMsg constructor as well,
otherwise, the default visibility is private.
Bug: 263222068
Test: atest NetworkStaticLibTests
Change-Id: If571b014ade51e3387748a4df0abcb49b59cb462
This annotation can be used to mark a test case that requires
the latest resolv module. Tests that don't run with the latest
resolv module (for example CtsNetTestCasesLatestSdk) can exclude
the testcases being flaky due to some known issues in old resolv
module.
Bug: 279846955
Test: TreeHugger
Change-Id: Ie19eed1c4aa17645c4eec45493e7999027a01205
Currently, DnsPacket calls DnsRecord constructor to create
DnsRecord instances from a ByteBuffer. However, invoking
DnsRecord constructor cannot create subclass instances of
DnsRecord.
To fix this, use a factory method to parse DnsRecord. This
factory method will peek the nsType field of the DnsRecord
as an argument, and it will use this field to determine which
subclass of DnsRecord to create.
This change is no-op, because it does not change the
functionality of DnsPacket. However, it does allow subsequent
changes to create subclass instances of DnsRecord in the future.
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.DnsPacketTest
Change-Id: Ibbdeaf6e5a844573f393f05609310658d8d225b3