It leads to complexity when Tethering is overridden, because the
required attribute must be duplicated for all the variants.
Require NetworkStack be explicitly installed instead.
Bug: 242509786
Test: m
Change-Id: Ideaecf88418901e2c86271166be24f6b7e498a20
This patch mocks the SDK level and/or change IDs to help
developing functionality that depends on these without
having to flash a new device every time.
Test: TH
Change-Id: I1011193c99e123a0e5501ed313c9cecbceebdae6
NsdManagerTest need to be updated because the older check was incorrect,
the new behavior should be observed on T when the compat flag is enabled
as well.
Test: m
Change-Id: I5d2e87b1ab5a114005a223e7ccd865540c0fdb78
Cronet tests do not use a jarjar prefix, so do not jarjar their J/N
implementation.
Test: atest NetHttpTests
Bug: 278639767
Change-Id: Ie4b8bfa13ecbbca014e22d653fa0d39a5554c10e
Since cronet_java_tests (previously cronet_aml_javatests_sources) is now
an android_library directly in external/cronet (to support "mm" in that
folder), the dependencies can be removed.
A form of android_library is still required to wrap cronet_java_tests,
so the AndroidManifest (in this folder) is forwarded properly to the
common coverage test target.
Test: TH
Bug: 278639767
Change-Id: I25c6371c64e6cfcbb48e9e3f2976d47279791f21
Use type + scope as key to build cached address map so that
SAP (key: TETHERING_WIFI + INTERNET) and LOHS
(key: TETHERING_WIFI + LOCAL) can use different address.
Bug: 233175023
Test: atest TetheringTests
Change-Id: I46a4b3ee919628092b7540202a43d79f407b09b6
This change store localOnly wifi clients in its own field so that
tethered and localOnly hotspot clients can exist at the same time.
Currently, there are no tethered and localOnly hotspot clients at
the same time because PrivateAddressCoordinator does not support
SAP + LOHS. A follow-up change will be made to allow this.
When both SAP and LOHS are enabled, the SAP and LOHS clients from
TetheringEventCallback#onClientsChanged are all TETHERING_WIFI.
Currently, there is no way for the listeners to distinguish between
SAP and LOHS clients.
Bug: 233175023
Test: atest TetheringTests
Change-Id: I01b0a6abb084f7135f7825e0c5303e49c16a4c39
As the suggestion from:
https://android-review.git.corp.google.com/c/platform/packages/modules/Connectivity/+/2489359/9/Tethering/src/android/net/ip/IpServer.java#b1176
Make BaseServingState an abstract class to prevent it from being used
directly. Additionally, move the handleNewPrefixRequest method into
BaseServingState because it is the only class that uses it.
To avoid TetheredState and LocalHotspotState from having to implement
their own enter function, add the mDesiredInterfaceState field to
BaseServingState.
Bug: 233175023
Test: atest TetheringTests
Change-Id: I03269c37e666345efb0c61039a2bb213f223a5a2
Packets received from the "null" networks are packets received from
tethering downstream interfaces. They should not be processed by all
MdnsServiceTypeClients; instead they should be processed by
the MdnsServiceTypeClient for the null network.
Bug: 283708537
Test: atest
Change-Id: Ifef59eca7a24bdfe3650067445d2565869dfa852
When sendMulticastPacket or sendUnicastPacket is called with the null
network, only send the packets to interfaces indexed with null, instead
of all interfaces.
When using MdnsMultinetworkSocketClient sending packets on the null
network means sending on tethered downstream interfaces. When
MdnsSocketClient is used (not used in the Android tree), sending on the
null network sends on all interfaces as MdnsSocketClient does not
support specific networks. This is clarified by explicitly throwing
when a non-null Network is attempted to be used with MdnsSocketClient
(but MdnsSocketClient is only used for tests in the Android tree).
Bug: 283708537
Test: atest
Change-Id: Ia0186bf8aa2e0fc5878d6071fd23599df8488616
• Remove unused private methods
• Build files have this test in FrameworksNetTests, which
by TEST_MAPPING is not run on T and below. It is not in
the targets that do run on T and below like
ConnectivityCoverageTest.
Test: VpnTest
Change-Id: I198e5b3571e34e41611f71d351501d3f98f78caa
This reverts commit 73f6948915.
Reason for revert: The bug that necessitated this workaround has been addressed.
Change-Id: Idac3903df029e841bde6c57c9d453b56760d2553
Test: TH
Recently, new test methods were added to NetworkAgentTest which
fail in instant mode because they are not marked @AppModeFull.
Because instant apps can't use NetworkAgent (it's a system API,
and it needs the NETWORK_FACTORY permission which is signature
only), just mark the whole test @AppModeFull so this cannot
happen again.
Bug: 283897713
Test: test is skipped in instant mode
Change-Id: Ib6ff07d9fdc329d3421a077532b8a434323053f8
There are multiple independent reasons a keepalive can stop. Some
are software (e.g. the app stops the keepalive) and some are hardware
(e.g. the SIM card gets removed). Therefore, there is a very low
probability that both of these happen at the same time, which would
result in the first stop attempt returning SUCCESS and the second
stop attempt returning NO_SUCH_SLOT. Such a race condition can be
ignored with a log, not to crash the system. Change to wtf log so
that the issue could still be visible since this implies possible
bugs in the system.
Also update the javadoc for SocketKeepalive.ERROR_NO_SUCH_SLOT.
Bug: 281484381
Test: atest FrameworksNetTests
Change-Id: I316a2193fc7302b04e074ff0b03dc43946fe5ce6
Observed failure in manual run on aosp/master cuttlefish:
[759/913] android.net.cts.NetworkStatsManagerTest#testUidTagStateDetails: FAILED (710ms)
STACKTRACE:
java.lang.AssertionError: QueryResult(tag=TAG_NONE state=STATE_FOREGROUND total=256756): 256756 not within 10% of 231272
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.assertTrue(Assert.java:42)
at android.net.cts.NetworkStatsManagerTest.assertWithinPercentage(NetworkStatsManagerTest.java:743)
at android.net.cts.NetworkStatsManagerTest.testUidTagStateDetails(NetworkStatsManagerTest.java:802)
256756 / 231272 =~= 1.11019 --> just over 11% deviation.
Test: TreeHugger
Bug: 283166618
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie9af706e4f84065050188b1c9b697cccd8509c32
The addOrUpdateInterfaceAddress() should be called when RTM_NEWADDR
message is received and the address isPreferred. The
deleteInterfaceAddress() should be called when RTM_DELADDR is called.
Bug: 282592527
Test: atest MdnsSocketProviderTest
Change-Id: I06a5940f53d01552f117309b1cc09256a2a9fae7
A utility method should not be responsible for clearing the
caller identity. Clearing caller identity should happen in
methods that process binder IPCs, not general utility methods.
Update it to clear in each method.
Bug: 279381469
Test: atest FrameworksNetTests
Change-Id: I95b520fb0d7851ec3e14fbd16044d5f877c74561
Check that advertised subtypes can be found by matching discoveries and
discoveries for the base type, and that discoveries for different
subtypes do not find the service.
Bug: 266167702
Test: atest
Change-Id: I0a8249cca22c1d30baad12bb4e8351a65ce87cb1
Instead of the network specified in the MdnsSearchOptions, which is
often null to request searching on all networks, use the
MdnsServiceTypeClient Network to build the queries.
When MdnsSearchOptions.network is null, one MdnsServiceTypeClient is
created for each mDNS-compatible Network. Each MdnsServiceTypeClient
schedules queries with a Network selector. If the Network selector is
null, each MdnsServiceTypeClient will post its queries to all networks.
Instead, it should be the Network of the MdnsServiceTypeClient.
There is one remaining problem when a tethered interface is up: in that
case, there will be one MdnsServiceTypeClient for tethered interfaces
with a null network, which will still broadcast its queries to all
networks. This should be addressed in a follow-up by having
MdnsMultinetworkSocketClient only send queries to interfaces that have a
null network, when the network selector is null (and not all
interfaces).
Bug: 283708537
Test: atest
Change-Id: If571d7a59c5e55d809eeb1f3d1c4b58684612cdd