This timing issue is happened when test case already verified
NetworkMonitor#setAcceptPartialConnectivity() before
NetworkAgent send the CONNECTED state to ConnectivityService.
This test case expects that the
NetworkMonitor#setAcceptPartialConnectivity() will be invoked
when network state is CONNECTED in
ConnectivityService#updateNetworkInfo().
NetworkAgent communicates with ConnectivityService by
AsyncChannel. Before they connect to each other, the thread of
NetworkAgent is keeping idle, so waitForIdle cannot handle this
kind of case. Although they have connected to each other, but
they don't communicate with each other, waitForIdle() still
cannot handle this case. It means waitForIdle() can only handle
the case that NetworkAgent already connected to
ConnectivityService and NetworkAgent is communicating with
ConnectivityService. So, that's why waitForIdle() sometimes
doesn't work in this case, and the most simplest and right way
to fix this case is to wait the available callback then verify
the method.
Bug: 140306320
Test: atest FrameworksNetTests: \
ConnectivityServiceTest#testPartialConnectivity \
--generate-new-metrics 500
Change-Id: I64bfecbfe3c5776bd5c347a821f9127e79539c48
Add a simple test to verify that IDs loop correctly, that they skip used
IDs correctly, and throw when there is no remaining ID.
Test: atest com.android.server.NetIdManagerTest
Change-Id: I4c9518c725156d743286e062fd2eec1423a0459e
If EVENT_NETWORK_INFO_CHANGED was handled after waitForIdle()
method done, this test will be failed due to
INetd#setTcpRWmemorySize() was not executed yet. Instead of
waiting for idle state, it's better to use NetworkCallback to
ensure events completely on ConnectivityService.
Bug: 140206578
Test: atest ConnectivityServiceTest#testTcpBufferReset\
--generate-new-metrics 500
Change-Id: Iad77415db38038603881d9ebe0e37586b549a45c
When turning on/off SoftAp with high frequency, sometime calling
WifiManager#updateInterfaceIpState with IFACE_IP_MODE_TETHERED
is performed after handling WIFI_AP_STATE_DISABLED event in
WifiServiceImpl while SoftAp is being terminated. This leads to
the issue that SoftAp is unable to start as startSoftAp always
returns "false". This is because mIfaceIpModes in WifiServiceImpl
keeps the mode WifiManager.IFACE_IP_MODE_TETHERED and the CL below
rejects SoftAp start request.
e257c5c9e79e3675375ca20731cfb74df02b1064 @ frameworks/opt/net/wifi
(WifiServiceImpl: Reject startSoftAp when already tethering)
This CL updates the interface ip state upon receiving ap disable
event from Tethering class to set proper state to mIfaceIpModes.
Bug: 134806980
Test: Ran script to turn on/off soft ap frequently
Signed-off-by: Daichi Ueura <daichi.ueura@sony.com>
Change-Id: I2f89214414d93f1aa942fb8a21264a9baae3452a
In case tethering donwstream is setup but don't ask EntitlementManager
to run provisioning. Cellular upstream should not be allowed if
EntilementManager don't have any donwstream record.
Bug: 134649258
Test: -build, flash, boot
-manual test with carrier SIM
Change-Id: I609722c79f0a45a1c2164d39721ef5883e436feb
The utilities help using ConnectivityService in tests, and will be used
to write integration tests for ConnectivityService.
Test: atest FrameworksNetTests
Change-Id: Ie895ad05139cd5768d3d8a9bd5589d72571f47e6
Tethering may use wrong sub id for entitlement when data
subscription is changed from preferred data sub id to CBRS
sub id. Fix by using the active data sub id for tethering.
Bug: 134994718
Test: -build, flash, boot
-FrameworkNetTests
-manual test with carrier SIMs
Change-Id: Icb3f5eeb2319e50b2dc98369ad152988c934da57
Merged-In: Icb3f5eeb2319e50b2dc98369ad152988c934da57
TestableNetworkCallback will become a standard tool. This patch
and its companion in packages/modules/NetworkStack mostly move
it out of ConnectivityServiceTest, but also applies a few
cleanups like reordering arguments for standard order, renaming
...Like to ...That to match Mockito namings, and introduces
stonger static typing on some callbacks, which allows to remove
some unchecked casts.
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I808a95ac33ec0c81a8829cad36a6917524297574
ag/7905088 added the ability to pass in acceptUnvalidated without
passing in explicitlySelected. Add unit tests for that code.
While I'm at it, convert a couple of "== 1"s to toBool(), and
update the comments in NetworkAgent.
Bug: 130766237
Test: atest FrameworksNetTests
Change-Id: I6b550bd621e3596975f83464c7b4b8a14269120b
NetworkStatsFactory is owned by NetworkStatsService, and any
accesses to NSF data should go through NSS.
Test: atest FrameworksNetTests
Change-Id: Idbd0dbbaeb11313f63474e7ec0e01f974349fc89
This reverts commit b92b18b9b9bc90e3734652e5d6c5b217cd31bf39.
Reason for revert: Breaks the build because it removes an unused method that was used by a change intervening in the mean time
Bug: 136143444
Change-Id: Id3a17e0b16ec03276609ca96fb7b582188ed1077
NetworkStatsService is the only consumer of the data coming from
NetworkStatsFactory, but the factory itself is instantiated and
owned by NetworkManagementService.
Move it into NetworkStatsService instead.
Test: atest FrameworksNetTests
Change-Id: I52df1e545c646927952579da22845a12d1d7563b
The "Connected" notification would be shown every time a network
validates after being identified as a captive portal. This causes issues
on networks that have auto-login mechanisms, as a high priority
notification would be shown even though the user was not interacting
with the phone.
The "Connected" notification is intended to confirm to the user that
they successfuly logged in (manually), so only show it after the user
opens the portal on the network.
Bug: 134124044
Test: Flashed, connected to portal: notification shown
Opened portal from command line + revalidate: no notification
Tests passing with change, failing without
Change-Id: I89e7a7f49019bd7e4686712c56e00bd786eb3ef3
NetworkStatsService uses an internal boolean to know when it has
started for the purpose of preventing access to other internal
variables before they are initialized.
However that boolean is set to true in systemReady() non-atomically
with respect to the initialization of the other variables it guards,
which can cause the system server to crash.
This patch fixes this concurrency bug by moving setting the internal
boolean flag and the variable it guards in one atomic synchronized
block.
This patch also removes code checking if bandwidth control is enabled,
because this is now always true.
Bug: 132767673
Test: Compiled.
Change-Id: Ia089b5767ce271d669879c975508654d4dd03429
Also a few utilities that were in the way, and some opportunistic
cleanups.
Test: FrameworksNetTest NetworkStackTest
Change-Id: I385070e2044fd967cb18f1ffea9a86a4627b742e
This change removes the now-unused VPN arrays in the network stats
observer and recorder classes. These are always null values in every
call site.
Bug: 113122541
Bug: 120145746
Bug: 129264869
Bug: 134244752
Test: FrameworksNetTest passing
Test: Manual tests show data usage fixes maintained.
Change-Id: Ieb8645acc400fdaeb0df7092c5369b96f9f35af9