Around 10% of the traces with Nettrace have "traced_final_flush_failed"
errors. It is believed that Network Tracing isn't writing enough data to
fill one "Chunk" in Perfetto's buffer. Although this should still be
saved by Perfetto, it doesn't seem to be.
This change records the number of packets read from the ring buffer to
understand whether the error coincided with low-data cases. It also
tries to flush the data OnStop to potentially fix the issue.
Bug: 285411033
Test: flash and run trace
(cherry picked from https://android-review.googlesource.com/q/commit:80d705566be6ea8a822eebd088c1f37758fdf0f6)
Merged-In: I92c8d2d8d47d1ed123585e1cfdde802d286f120f
Change-Id: I92c8d2d8d47d1ed123585e1cfdde802d286f120f
* changes:
Pass NsdService thread looper to MdnsDiscoveryManager
Do not process null network packets on all clients
Only send to downstream ifaces for null network
Use the ServiceTypeClient network for queries
Add test for subtype discovery/advertising
Ensure MdnsDiscoveryManager calls to ServiceTypeClients on looper thread
In some use cases for the MdnsDiscoveryManager, providing looper as an
argument to the MdnsDiscoveryManager constructor is not feasible. Adding
a constructor without looper can help to match those use cases. If
constructor without looper is used. The shutDown() must be called as a
part of cleanup process.
Original change: https://r.android.com/2600006
Change-Id: I412157f184decd8af8343977d59a2215fe8ca51e
Fixes: 283914408
Test: atest FrameworksNetTests
Merged-In: I0ab04d67bae127628c6d67c4b8c109201612a54b
MdnsDiscoveryManager should use the same thread that create on
NsdService that is used on other mDns components. Thus, pass that
thread loop to MdnsDiscoveryManager.
Bug: 265787401
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:7f0af78c5ee0b783faec38ab4dd7afe0f8a393ec)
Merged-In: Icc23994c3ebc99da6043ed2d93540c44f53a150b
Change-Id: Icc23994c3ebc99da6043ed2d93540c44f53a150b
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
(cherry picked from https://android-review.googlesource.com/q/commit:0ba206cbd168f5627da84911c0d7e5307e55c431)
Merged-In: Ifef59eca7a24bdfe3650067445d2565869dfa852
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
(cherry picked from https://android-review.googlesource.com/q/commit:87c374a37ac8698a98d0c35a3196922c69549cc7)
Merged-In: Ia0186bf8aa2e0fc5878d6071fd23599df8488616
Change-Id: Ia0186bf8aa2e0fc5878d6071fd23599df8488616
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
(cherry picked from https://android-review.googlesource.com/q/commit:404c1bf7877316df27389aa8a1ac855a25a86c20)
Merged-In: If571d7a59c5e55d809eeb1f3d1c4b58684612cdd
Change-Id: If571d7a59c5e55d809eeb1f3d1c4b58684612cdd
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
(cherry picked from https://android-review.googlesource.com/q/commit:eae8529fc6542691ba2f0c1262f3ab8732e4434b)
Merged-In: I0a8249cca22c1d30baad12bb4e8351a65ce87cb1
Change-Id: I0a8249cca22c1d30baad12bb4e8351a65ce87cb1
ServiceTypeClients will store/access services on MdnsServiceCache
in subsequent changes. And MdnsServiceCache can be accessed from
looper thread only. So ensure MdnsDiscoveryManager calls to
ServiceTypeClients on the looper thread.
Bug: 265787401
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:bd4140ea913ad031057ff37bea8c2556b4970463)
Merged-In: I05e73140da58c029b49057bb0ccfdb8ed7818dfc
Change-Id: I05e73140da58c029b49057bb0ccfdb8ed7818dfc
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
(cherry picked from https://android-review.googlesource.com/q/commit:cc2e2dcb4411e8ae07cede2da27bf5bd6e5505c5)
Merged-In: I25c6371c64e6cfcbb48e9e3f2976d47279791f21
Change-Id: I25c6371c64e6cfcbb48e9e3f2976d47279791f21
With the release cut of the July train and the recent automerger
cutover, tm-mainline-prod is now officially an abandoned branch.
This change deletes (most) infrastructure that was put in place to
disable cronet on tm-mainline-prod.
Test: builds
Bug: 278639767
(cherry picked from https://android-review.googlesource.com/q/commit:2e3e2955b8cf7ba181788140dd62b2dd20e7b600)
Merged-In: I078f2114b736a634f08d8f704c19beb2224ef645
Change-Id: I078f2114b736a634f08d8f704c19beb2224ef645
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
(cherry picked from https://android-review.googlesource.com/q/commit:49649c9aeac709abaeb345f89b6a3a0e5a279435)
Merged-In: I46a4b3ee919628092b7540202a43d79f407b09b6
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
(cherry picked from https://android-review.googlesource.com/q/commit:ae3abdfa4be2e4867d4cad70be15f90ad36a0b32)
Merged-In: I01b0a6abb084f7135f7825e0c5303e49c16a4c39
Change-Id: I01b0a6abb084f7135f7825e0c5303e49c16a4c39
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
(cherry picked from https://android-review.googlesource.com/q/commit:f1a61ad83de462dcd149ca53f0d417486ca1aec0)
Merged-In: Ib6ff07d9fdc329d3421a077532b8a434323053f8
Change-Id: Ib6ff07d9fdc329d3421a077532b8a434323053f8
Skip all of NetworkAgentTest in instant mode.
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.
Fix: 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
(cherry picked from https://android-review.googlesource.com/q/commit:75673ba5025faa191ae188100b117a4095fab8ab)
Merged-In: I316a2193fc7302b04e074ff0b03dc43946fe5ce6
Change-Id: I316a2193fc7302b04e074ff0b03dc43946fe5ce6
Starting with U, only explicit intents will be allowed to
launch non-exported internal components. Set package name
to entitlement recheck intent so that the intent could be
delivered to tethering itself successfully.
Bug: 278482046
Test: atest TetheringTests
manual verify entitlement recheck work in U
(cherry picked from https://android-review.googlesource.com/q/commit:e86fb5ef56be064839a639702bbe376448f08bed)
Merged-In: Ife30eee13fe39509ccb5786d2a76fbb7baa022a8
Change-Id: Ife30eee13fe39509ccb5786d2a76fbb7baa022a8
Wifi remembers the wifi enabled state under airplane mode in the
Settings.Secure.WIFI_APM_STATE setting for the airplane mode
enhancement. Wifi will not be disconnected if user enables
the wifi under airplane mode. This behavior breaks the
assumption in testSetAirplaneMode. The test expects to always
receive the WiFi network disconnect after turning airplane
mode on.
The wifi enhancement was done with hidden method which should not
be referred in the cts. The intention of testSetAirplaneMode was
to verify the permission required for setting ariplane mode.
This change should be no harm for original intention.
Bug: 282436851
Test: atest CtsNetTestCases
(cherry picked from https://android-review.googlesource.com/q/commit:c346fc8a0d8330aa7cf033a8554233a90e683164)
Merged-In: I3458679378f0c12c26051f3dac7fcf155c1f469c
Change-Id: I3458679378f0c12c26051f3dac7fcf155c1f469c
Network state is not changed to disconnected when a networkagent
is disconnected and network state is SUSPENDED.
So the function requiresClat return true. Clat is not stoped.
Bug: 277682237
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:fd5d3d90e1da7411104902ddfe859ebd0e4a02fb)
Merged-In: I5edfcf64aca5d2d34325d722dd29fab41bcf2600
Change-Id: I5edfcf64aca5d2d34325d722dd29fab41bcf2600
Currently, clatd is not stopped when suspended network is disconnected
and aosp/2583410 fixes this issue.
This CL adds test for current behavior, aosp/2583410 can update
testDisconnectSuspendedNetworkStopClatd to call verifyClatdStop instead
of verifyNeverClatdStop
Test: atest FrameworksNetTests
Bug: 277682237
(cherry picked from https://android-review.googlesource.com/q/commit:4a5b06559fc276a06f53134694a0a6548b36b026)
Merged-In: I345e097ce8e114800d77c5f44d38d7ae4938935c
Change-Id: I345e097ce8e114800d77c5f44d38d7ae4938935c