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
FrameworksNetTests-jni-defaults lib should only contain jni
dependencies. Remove static_libs/libs from it and update
FrameworksNetTests/FrameworksNetSmokeTests libs as well.
Bug: NA
Test: atest FrameworksNetSmokeTests FrameworksNetTests
Change-Id: I705e949e4c00035c9734b6a240529d1c2216eb6b
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 d209586554.
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
am: 203bde59b4 -s ours
am skip reason: change_id I99be7d312d020d242081971c7e522023bbbab072 with SHA1 844ea18005 is in history
Change-Id: I8ec96985154e8fedc64f6f9233930f2d1a9ee581
am: ce3b7eadad -s ours
am skip reason: change_id I99be7d312d020d242081971c7e522023bbbab072 with SHA1 844ea18005 is in history
Change-Id: I087da26c8b643e8dad055955388c1b032a73f558
am: 09a8de5530 -s ours
am skip reason: change_id I99be7d312d020d242081971c7e522023bbbab072 with SHA1 844ea18005 is in history
Change-Id: I50b62b92261b7386d7a15ab0e876661e8c4b0bac
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
Merged-In: I99be7d312d020d242081971c7e522023bbbab072
Merged-In: I7dc1b3a313b255fe89313efb9117bb160efdb533
(cherry picked from commit 0b5a4d862190320d285413b1feb921144fee8420)
Change-Id: I67c124cc34f09c2f186706b5cec839f60d00a90a
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
am: 693f58c378 -s ours
am skip reason: change_id I5413393529c4bad3a707df229307542486bcff33 with SHA1 336e846779 is in history
Change-Id: I44723afb20ec488e620fe792d7268ba0bcd6de9c
am: ebdd783a9b -s ours
am skip reason: change_id I5413393529c4bad3a707df229307542486bcff33 with SHA1 336e846779 is in history
Change-Id: I116cea63ccbfd5346ca218486671abae5176c273
am: 3547965d2a -s ours
am skip reason: change_id If2ef8d8f038f32c8cf974aa02cfc1dc7e44dbad3 with SHA1 8c9d8c5e05 is in history
Change-Id: I5b525feb1e7df2a89dea4f38b521973ccaac0746
* changes:
Inline readNetworkStatsDetailInternal, make mUseBpfStats final
Remove VPN info arrays from NetworkStats(Observer|Recorder)
NetworkStatsFactory: Take VPNs into account for network/battery stats
Remove duplicate line in clat_simple test file
Remove unused lastStats parameter
Revert "Revert "Take all VPN underlying networks into account when migrating traffic for""
Auto-reconnecting to a network with no or limited Internet
connectivity is not useful. This is because such networks cannot
be used unless the user taps the notification and interacts with
the resulting dialog. But the notification is only shown if the
user manually connects to the network, not if the system
auto-connects to it.
Bug: 130683832
Bug: 130766237
Test: atest FrameworksNetTests
Change-Id: I5413393529c4bad3a707df229307542486bcff33
Merged-In: I5413393529c4bad3a707df229307542486bcff33
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.
Merged-In: Ieb8645acc400fdaeb0df7092c5369b96f9f35af9
Change-Id: I66f263d7e12bce7668901306c0c2ecdda634abaf
(cherry picked from commit 833603caabb1a850a63a970fc285b4c8ed7401f8)