No internet notification may be prompted before partial
connectivity being detected. Partial connectivity status will
be set into NAI and prompted in the Setting. Behavior is not
aligned between Setting and notification. Thus, update
notification again if partial connectivity is detected.
Also, sliently show the updated notification if no internet
notification has already been shown to user to prevent alerting
user in short time.
Bug: 130683832
Test: Verified with simulated partial connectivity
Test: atest FrameworksNetTests
Change-Id: Ie16a8ce6e0fa437048e8c1eea240314ca30e9520
System server | NetworkStack
|
NetworkMonitorCallbacks ←----|--- NetworkMonitorCallbacks$Stub$Proxy
↓ | ↑
NetworkAgentInfo | NetworkMonitor
↓ | ↑
NetworkMonitor$Stub$Proxy ----|---→ NetworkMonitorImpl
Bug: b/133174607
Test: Manual. The simplest artifact is observed by watching the output of
adb shell dumpsys meminfo -d com.android.networkstack | grep 'Proxy Binders'
while connecting and disconnecting multiple times to any network.
This will display the number of binder proxies. Before this, the binder
proxy count increases by 1 with each connection and never goes down (there
is some noise, as proxy objects are sometimes created for other reasons,
and get GC'd eventually). After this, the binder proxy count is always
eventually stable at 27 + connected network count.
See the bug for the complete analysis.
Change-Id: Ide2428dab3fcd6d7cd00aa2a9fd99d6c99b815a4
Split-tunnel VPN (which are the only ones affected by this change)
always fall through to the default network for routes they don't
handle, and even if the underlying network(s) don't provide access
this may be a pinhole that can actually reach the broader network.
In practice this behaves like the original release of P and is the
safest thing to do for Q. In R we should evaluate giving the VPN
app the ability to simply tell the network stack whether it does
provide Internet access or not.
Bug: 119216095
Test: FrameworksNetTests NetworkStackTests
Change-Id: I262ca41fe0225660551c9a421562405366b6acac
am: 43da3dd26b -s ours
am skip reason: change_id I49fbde1fe73b33aadcf8fd23ad224f363b137bf3 with SHA1 d5e7114ee9 is in history
Change-Id: I4492c9d73ffc8c8396649dfe06896f66922404ff
am: a193937849 -s ours
am skip reason: change_id I49fbde1fe73b33aadcf8fd23ad224f363b137bf3 with SHA1 d5e7114ee9 is in history
Change-Id: Icfe0c92b130b7bde5686ec8186d5df0fa16aa126
* changes:
Add one more test for VPN usage stats.
Addressing comments for http://ag/7700679.
NetworkStatsService: Fix getDetailedUidStats to take VPNs into account.
Take all VPN underlying networks into account when migrating traffic for VPN uid.
Covers the case where the majority of traffic through the VPN is
caused by the VPN app itself, and ensures that that traffic is
correctly attributed to the VPN app as opposed to spread between
the other apps that use the VPN.
Bug: 120145746
Test: atest NetworkStatsServiceTest
Change-Id: Iffd3f95fc2e11d311691a797b010edb38d2ef3c6
Note, that its in a separate CL so we could cherry-pick this CL to aosp.
http://ag/7700679 is already in aosp.
Bug: 113122541
Bug: 120145746
Test: atest FrameworksNetTests
Change-Id: I7cfda226b4ed11b67002b83b38fba0f5caf96718
(cherry picked from commit 2af0b66aba)
This API is similar to one provided by NetworkStatsFactory with the
difference that NSS also migrates traffic from VPN UID to other apps.
Since traffic can only be migrated over NetworkStats delta, NSS
therefore maintains NetworkStats snapshot across all UIDs/ifaces/tags.
This snapshot gets updated whenever NSS records a new snapshot
(based on various hooks such as VPN updating its underlying networks,
network getting lost, etc.), or getDetailedUidStats API is invoked by
one of its callers.
Bug: 113122541
Bug: 120145746
Test: atest FrameworksNetTests
Test: manually verified that battery stats are migrating traffic off of
TUN (after patching above CL where we point BatteryStats to use this
API).
Change-Id: I4b8d7c5b6905a4a12c1806dfd35c2c4c63610404
VPN uid.
(cherry picked from commit 612520f544)
Bug: 113122541
Bug: 120145746
Test: atest FrameworksNetTests
Test: Manually verified on device that stats from VPN UID are moved
appropriately based on its declared underlying network set.
Test: vogar --mode app_process --benchmark NetworkStatsBenchmark.java
Change-Id: I7f368c5970b2dcb969fe0daf5ef44edb1f51d09d
am: bc6d9b931a -s ours
am skip reason: change_id I74cf5f0fa17fcf818f1fed78c7e3e4375c20152e with SHA1 b807dd8884 is in history
Change-Id: I422cb4e44af1a10fb4582a61fd76139fc78f54db
am: 9adfabc792 -s ours
am skip reason: change_id I74cf5f0fa17fcf818f1fed78c7e3e4375c20152e with SHA1 b807dd8884 is in history
Change-Id: Ibf67d64718d81583cc9de0f0f5d8bf5b7784e29f
am: d0ee254855 -s ours
am skip reason: change_id I74cf5f0fa17fcf818f1fed78c7e3e4375c20152e with SHA1 b807dd8884 is in history
Change-Id: I3ded47d5eb88d7e666f5444e3072556cb94b064b
Also :
- Fix testUidFilteringDuringVpnConnectDisconnectAndUidUpdates that
was failing on devices with a first released SDK >= Q
- Add a test actually tests that the system has the permission, as
the test was only testing what's in the mock
Bug: 119770201
Test: New test making sure this stays true
Merged-In: I74cf5f0fa17fcf818f1fed78c7e3e4375c20152e
Change-Id: I0daa644fbad8e389ad7cfa66c0e3b3480c8bb50a
(cherry picked from commit 629b49d58fe8d108a3d7d47a21471aff913c6b34)
This is the most common test library for Connectivity tests. It is
meant to be usable in framework tests, network stack tests, CTS,
GTS. To achieve that, it can only depend on framework classes.
Bug: none
Test: NetworkMonitorTest
Test: NsdManagerTest
Test: ConnectivityServiceTest
Test: OffloadControllerTest
Test: NetworkStatsObserversTest
Test: NetworkStatsServiceTest
(all the touched classes)
Change-Id: Ic47cbe7ba0e407145fa6bc49bb2adb3c5937dbc4
am: 3e21934d65 -s ours
am skip reason: change_id I13ad04454e638905b74dd42a1c83266c7c37652f with SHA1 71950d27d8 is in history
Change-Id: Ifc4c2043238ce3179852c5089bcee7e3501a34d1
am: 368c00edf7 -s ours
am skip reason: change_id I13ad04454e638905b74dd42a1c83266c7c37652f with SHA1 71950d27d8 is in history
Change-Id: I3d8fec5e596da38dc1f9df8ccbc3f8a6822a2cc6
am: b2be0361dc -s ours
am skip reason: change_id I13ad04454e638905b74dd42a1c83266c7c37652f with SHA1 71950d27d8 is in history
Change-Id: I3cf152c683a9c09245b05341973e31bd1715668f
am: be66842707 -s ours
am skip reason: change_id I4424663292c5ad29eb7a888fa6975835721a5d2e with SHA1 9ec2c725c8 is in history
Change-Id: Ie90e2d13b68fe37fb608685b82c184b283304715
am: e2aa14774c -s ours
am skip reason: change_id I4424663292c5ad29eb7a888fa6975835721a5d2e with SHA1 9ec2c725c8 is in history
Change-Id: Ic2bf6d593170287595890d7eb70b279d0310aed7
am: 4d6330deae -s ours
am skip reason: change_id I4424663292c5ad29eb7a888fa6975835721a5d2e with SHA1 9ec2c725c8 is in history
Change-Id: I37cc75afcf4c2cfbe86fb5a165073d94e98c6e6d