Commit Graph

7376 Commits

Author SHA1 Message Date
Lorenzo Colitti
336e846779 Don't auto-connect to networks that have no/limited connectivity.
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
2019-05-30 16:33:42 +09:00
Chalard Jean
318feaf1ed Always give VPN the INTERNET capability.
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
2019-05-30 16:11:14 +09:00
Luke Huang
be164b2db8 Fix issue for DnsResolver#query
1. Previously, getDnsNetId doesn't handle all the cases.
Fix it with cosidering bypass private DNS flag.
2. Make getDnsNetId return Network instead of netId,
and change name from getDnsNetId to getDnsNetwork

Bug: 129530368
Test: atest DnsResolverTest DnsUtilsTest
Change-Id: Ic8d45b802d72a266f9ec97bfea620c1ede6967e5
2019-05-30 06:34:03 +00:00
chen xu
90558326cb [automerger skipped] Merge "NetworkStatAccess Should checkCarrierPrivileges cross all subscriptions" into qt-dev am: a193937849 -s ours
am: 43da3dd26b -s ours
am skip reason: change_id I49fbde1fe73b33aadcf8fd23ad224f363b137bf3 with SHA1 d5e7114ee9 is in history

Change-Id: I4492c9d73ffc8c8396649dfe06896f66922404ff
2019-05-29 18:22:36 -07:00
chen xu
43da3dd26b [automerger skipped] Merge "NetworkStatAccess Should checkCarrierPrivileges cross all subscriptions" into qt-dev
am: a193937849 -s ours
am skip reason: change_id I49fbde1fe73b33aadcf8fd23ad224f363b137bf3 with SHA1 d5e7114ee9 is in history

Change-Id: Icfe0c92b130b7bde5686ec8186d5df0fa16aa126
2019-05-29 18:14:18 -07:00
TreeHugger Robot
a193937849 Merge "NetworkStatAccess Should checkCarrierPrivileges cross all subscriptions" into qt-dev 2019-05-30 01:00:44 +00:00
Chen Xu
26a15e9727 Merge "NetworkStatAccess Should checkCarrierPrivileges cross all subscriptions" am: 74f0698ce6 am: 4d206af049
am: 7c88e8a93c

Change-Id: I216863d5b68fed9dab8f0400f05da38ec82f3d25
2019-05-29 10:49:50 -07:00
Chen Xu
7c88e8a93c Merge "NetworkStatAccess Should checkCarrierPrivileges cross all subscriptions" am: 74f0698ce6
am: 4d206af049

Change-Id: Ib2d02bd3936ae112f62861c301d99582e0b998b0
2019-05-29 10:43:06 -07:00
chen xu
381513f5e1 NetworkStatAccess Should checkCarrierPrivileges cross all subscriptions
Bug: 133236378
Test: Manual
Change-Id: I49fbde1fe73b33aadcf8fd23ad224f363b137bf3
Merged-in: I49fbde1fe73b33aadcf8fd23ad224f363b137bf3
2019-05-29 17:16:54 +00:00
Chen Xu
74f0698ce6 Merge "NetworkStatAccess Should checkCarrierPrivileges cross all subscriptions" 2019-05-29 17:15:41 +00:00
Varun Anand
b12b74571e Merge changes from topic "vpn_data_accounting" into qt-dev am: 071c178990
am: 141246d873

Change-Id: If6da5cd1c88b57dd0331f704025109f419c9ea21
2019-05-29 09:55:36 -07:00
Varun Anand
141246d873 Merge changes from topic "vpn_data_accounting" into qt-dev
am: 071c178990

Change-Id: I234eb2b20f47bde94b4aba89867e9d1c7e9ee7d5
2019-05-29 09:44:04 -07:00
Varun Anand
071c178990 Merge changes from topic "vpn_data_accounting" into qt-dev
* 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.
2019-05-29 16:34:14 +00:00
Chalard Jean
dc63eea4f2 Merge "Add a common test library." am: 126a957df5 am: 4343cf32aa
am: cb5344664b

Change-Id: I9ff0818cac0f65d0e456f27558595a52835e89ab
2019-05-29 05:42:15 -07:00
Chalard Jean
cb5344664b Merge "Add a common test library." am: 126a957df5
am: 4343cf32aa

Change-Id: I6104a1a677cb2e4978f11be32dfc604ee431d009
2019-05-29 05:38:21 -07:00
Chalard Jean
126a957df5 Merge "Add a common test library." 2019-05-29 12:16:08 +00:00
Lorenzo Colitti
20204cdf6a Add one more test for VPN usage stats.
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
2019-05-29 19:57:43 +09:00
Luke Huang
e3b3cd5400 Merge "Minor changes for DnsUtils and its test" am: 8c4ef95cbb am: dfda15715d
am: a771bede7c

Change-Id: I940cca86b6214ea48d79575c64c9b11680597aa6
2019-05-29 03:38:23 -07:00
Luke Huang
a771bede7c Merge "Minor changes for DnsUtils and its test" am: 8c4ef95cbb
am: dfda15715d

Change-Id: Ic1990922e599884582606d1a4d7da3950200d25c
2019-05-29 03:33:34 -07:00
Varun Anand
78d5ac4f8f Addressing comments for http://ag/7700679.
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
2019-05-29 18:15:34 +09:00
Varun Anand
e7094673d5 NetworkStatsService: Fix getDetailedUidStats to take VPNs into account.
(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
2019-05-29 18:15:24 +09:00
Varun Anand
97482de1fd Take all VPN underlying networks into account when migrating traffic for
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
2019-05-29 18:15:17 +09:00
chen xu
d5e7114ee9 NetworkStatAccess Should checkCarrierPrivileges cross all subscriptions
Bug: 133236378
Test: Manual
Change-Id: I49fbde1fe73b33aadcf8fd23ad224f363b137bf3
2019-05-28 23:28:56 -07:00
Luke Huang
3b14d4641a Minor changes for DnsUtils and its test
fix nits for ag/7671031

Bug: 129530368
Test: atest DnsUtilsTest
Change-Id: I562d33870a933a5fe55c89137a2d9574e3c59b90
2019-05-29 13:56:27 +08:00
Chalard Jean
e4b3340fef [automerger skipped] Merge "Let the system server have CONNECTIVITY_USE_RESTRICTED_NETWORKS." into qt-dev am: d0ee254855 -s ours
am: bc6d9b931a -s ours
am skip reason: change_id I74cf5f0fa17fcf818f1fed78c7e3e4375c20152e with SHA1 b807dd8884 is in history

Change-Id: I422cb4e44af1a10fb4582a61fd76139fc78f54db
2019-05-28 07:59:24 -07:00
Chalard Jean
38c1cfe5f5 [automerger skipped] Merge "Let the system server have CONNECTIVITY_USE_RESTRICTED_NETWORKS." into qt-dev am: d0ee254855
am: 9adfabc792 -s ours
am skip reason: change_id I74cf5f0fa17fcf818f1fed78c7e3e4375c20152e with SHA1 b807dd8884 is in history

Change-Id: Ibf67d64718d81583cc9de0f0f5d8bf5b7784e29f
2019-05-28 07:52:28 -07:00
Chalard Jean
bc6d9b931a [automerger skipped] Merge "Let the system server have CONNECTIVITY_USE_RESTRICTED_NETWORKS." into qt-dev
am: d0ee254855 -s ours
am skip reason: change_id I74cf5f0fa17fcf818f1fed78c7e3e4375c20152e with SHA1 b807dd8884 is in history

Change-Id: I3ded47d5eb88d7e666f5444e3072556cb94b064b
2019-05-28 07:50:53 -07:00
Chalard Jean
805327de42 Let the system server have CONNECTIVITY_USE_RESTRICTED_NETWORKS.
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)
2019-05-28 13:30:14 +00:00
Chalard Jean
e343bcc913 Add a common test library.
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
2019-05-28 22:20:51 +09:00
Chalard Jean
afdb54b9eb Merge "Let the system server have CONNECTIVITY_USE_RESTRICTED_NETWORKS." am: ce2f2fe2e8 am: c008c062fb
am: d79ebb08a3

Change-Id: I6396710933e4cb28cd211c51a991cc5e991a67c8
2019-05-28 05:56:49 -07:00
Chalard Jean
d79ebb08a3 Merge "Let the system server have CONNECTIVITY_USE_RESTRICTED_NETWORKS." am: ce2f2fe2e8
am: c008c062fb

Change-Id: Ie70b2e7ce28e8e8c070d5b0929f1a6beb855da46
2019-05-28 05:47:17 -07:00
Chalard Jean
ce2f2fe2e8 Merge "Let the system server have CONNECTIVITY_USE_RESTRICTED_NETWORKS." 2019-05-28 12:26:10 +00:00
Android Build Merger (Role)
9791cd52b1 Merge "[automerger skipped] Merge "Wipe the data in IpMemoryStore database upon network factory reset." into qt-dev am: b2be0361dc am: 3e21934d65 -s ours am skip reason: change_id I13ad04454e638905b74dd42a1c83266c7c37652f with SHA1 71950d27d8 is in history" into qt-r1-dev-plus-aosp 2019-05-28 10:54:47 +00:00
Xiao Ma
4a3b29a44c [automerger skipped] Merge "Wipe the data in IpMemoryStore database upon network factory reset." into qt-dev am: b2be0361dc
am: 3e21934d65 -s ours
am skip reason: change_id I13ad04454e638905b74dd42a1c83266c7c37652f with SHA1 71950d27d8 is in history

Change-Id: Ifc4c2043238ce3179852c5089bcee7e3501a34d1
2019-05-28 03:53:51 -07:00
Xiao Ma
47f504d313 [automerger skipped] Merge "Wipe the data in IpMemoryStore database upon network factory reset." into qt-dev am: b2be0361dc -s ours
am: 368c00edf7 -s ours
am skip reason: change_id I13ad04454e638905b74dd42a1c83266c7c37652f with SHA1 71950d27d8 is in history

Change-Id: I3d8fec5e596da38dc1f9df8ccbc3f8a6822a2cc6
2019-05-28 03:53:47 -07:00
Xiao Ma
368c00edf7 [automerger skipped] Merge "Wipe the data in IpMemoryStore database upon network factory reset." into qt-dev
am: b2be0361dc -s ours
am skip reason: change_id I13ad04454e638905b74dd42a1c83266c7c37652f with SHA1 71950d27d8 is in history

Change-Id: I3cf152c683a9c09245b05341973e31bd1715668f
2019-05-28 03:48:49 -07:00
TreeHugger Robot
b2be0361dc Merge "Wipe the data in IpMemoryStore database upon network factory reset." into qt-dev 2019-05-28 10:31:21 +00:00
Chiachang Wang
42bc857caf [automerger skipped] Merge "Clean up for multiple validation result update" into qt-dev am: 4d6330deae -s ours
am: be66842707 -s ours
am skip reason: change_id I4424663292c5ad29eb7a888fa6975835721a5d2e with SHA1 9ec2c725c8 is in history

Change-Id: Ie90e2d13b68fe37fb608685b82c184b283304715
2019-05-28 03:03:38 -07:00
Chiachang Wang
6b6820d1c4 [automerger skipped] Merge "Clean up for multiple validation result update" into qt-dev am: 4d6330deae
am: e2aa14774c -s ours
am skip reason: change_id I4424663292c5ad29eb7a888fa6975835721a5d2e with SHA1 9ec2c725c8 is in history

Change-Id: Ic2bf6d593170287595890d7eb70b279d0310aed7
2019-05-28 02:58:40 -07:00
Chiachang Wang
be66842707 [automerger skipped] Merge "Clean up for multiple validation result update" into qt-dev
am: 4d6330deae -s ours
am skip reason: change_id I4424663292c5ad29eb7a888fa6975835721a5d2e with SHA1 9ec2c725c8 is in history

Change-Id: I37cc75afcf4c2cfbe86fb5a165073d94e98c6e6d
2019-05-28 02:58:39 -07:00
Android Build Merger (Role)
096dfb7dce Merge "[automerger skipped] Merge "Reinstate access to a forgotten member" into qt-dev am: e97ef6d1d9 -s ours am: 6ec76e4292 -s ours am skip reason: change_id I6f6b2cf75793532d3d537a223b8e15d7304a1e3f with SHA1 8759c1ec9e is in history" into qt-r1-dev-plus-aosp 2019-05-28 09:57:18 +00:00
Chalard Jean
21746a0fb5 [automerger skipped] Merge "Reinstate access to a forgotten member" into qt-dev am: e97ef6d1d9 -s ours
am: 6ec76e4292 -s ours
am skip reason: change_id I6f6b2cf75793532d3d537a223b8e15d7304a1e3f with SHA1 8759c1ec9e is in history

Change-Id: I3f5e3ff6c5a2515cbede4d1049fa017f592f93d9
2019-05-28 02:56:31 -07:00
Chalard Jean
7ebbdf4292 [automerger skipped] Merge "Reinstate access to a forgotten member" into qt-dev am: e97ef6d1d9
am: 4cabc6d502 -s ours
am skip reason: change_id I6f6b2cf75793532d3d537a223b8e15d7304a1e3f with SHA1 8759c1ec9e is in history

Change-Id: I309dc78288401e59d4ff65ca2cac4a007ddbfe80
2019-05-28 02:55:34 -07:00
Chalard Jean
6ec76e4292 [automerger skipped] Merge "Reinstate access to a forgotten member" into qt-dev
am: e97ef6d1d9 -s ours
am skip reason: change_id I6f6b2cf75793532d3d537a223b8e15d7304a1e3f with SHA1 8759c1ec9e is in history

Change-Id: Id859f70e1e7584d3640a43a041126b82b308d84e
2019-05-28 02:50:36 -07:00
Chiachang Wang
4d6330deae Merge "Clean up for multiple validation result update" into qt-dev 2019-05-28 09:44:47 +00:00
Chalard Jean
e97ef6d1d9 Merge "Reinstate access to a forgotten member" into qt-dev 2019-05-28 09:38:51 +00:00
Xiao Ma
fbb2a4935c Wipe the data in IpMemoryStore database upon network factory reset.
Bug:128499160
Test: manual
Test: atest FrameworksNetTests NetworkStackTests
Merged-In: I13ad04454e638905b74dd42a1c83266c7c37652f
Merged-In: Ia13ff10a57c2043f6676976f23ecfb2d2a9a6ef0
(cherry picked from commit ef6ef68c48b869aa9960edd81c73f3d31391ae26)

Change-Id: I42507451d55a620c0e2d271c895ad158f348c1a5
2019-05-28 08:46:44 +00:00
Android Build Merger (Role)
8d70675679 Merge changes from topic "am-d829724f7889490d818e6069212702eb" into qt-r1-dev-plus-aosp
* changes:
  Merge changes from topic "am-851f19c8d7d34bb48accd48868aae501-qt-dev" into qt-dev am: d8bc2b5a15 am: f0b1dc8df4
  [automerger skipped] Add Rfc6724 style sort for DnsResolver and fix potential bug am: 51b9f6c069 -s ours am: 2fdaf771d6 -s ours am skip reason: change_id I0323f5c7f32fc3fa589b9e87f8e7c9caf744dbd4 with SHA1 d352f4ca85 is in history
2019-05-28 05:58:48 +00:00
Luke Huang
ae3583ee45 Merge changes from topic "am-851f19c8d7d34bb48accd48868aae501-qt-dev" into qt-dev am: d8bc2b5a15
am: f0b1dc8df4

Change-Id: Ib9455ba1651241408c1ace6f90d64a23c8ec8dfb
2019-05-27 22:57:40 -07:00
Luke Huang
eb5b80daf1 Merge changes from topic "am-851f19c8d7d34bb48accd48868aae501-qt-dev" into qt-dev am: d8bc2b5a15
am: ec07250973

Change-Id: I385b8c885f4e32a65a50c64fb4730e0f0dc5b6fd
2019-05-27 22:57:34 -07:00