Commit Graph

6388 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
c8f93bca44 Merge "Fix race when starting NetworkMonitor" am: ef8485cc65 am: ea71c49a0e
am: 3a8102ab8e

Change-Id: I595ecdbf0b8e91fec4287c3476239a1e6c9c80a7
2019-03-31 21:35:25 -07:00
Remi NGUYEN VAN
3a8102ab8e Merge "Fix race when starting NetworkMonitor" am: ef8485cc65
am: ea71c49a0e

Change-Id: I049ea18e6c5c42a1b31d93541aa3846b14b7ab08
2019-03-31 21:25:12 -07:00
Remi NGUYEN VAN
ea71c49a0e Merge "Fix race when starting NetworkMonitor"
am: ef8485cc65

Change-Id: I3fe792704b9dfaafe09c83da57081d6668216a97
2019-03-31 21:13:48 -07:00
Remi NGUYEN VAN
ef8485cc65 Merge "Fix race when starting NetworkMonitor" 2019-04-01 03:54:03 +00:00
Remi NGUYEN VAN
ca33d197d9 Fix race when starting NetworkMonitor
NetworkMonitor obtained LinkProperties and NetworkCapabilities via
synchronous calls to ConnectivityManager after receiving an asynchronous
notification, which is prone to races: the network could be gone before
the LinkProperties/NetworkCapabilities can be fetched.

Fix the race by passing LinkProperties/NetworkCapabilities directly to
NetworkMonitor in the asynchronous notifications.

Test: atest FrameworksNetTests NetworkStackTests
Test: booted, WiFi works
Bug: 129375892
Change-Id: I200ac7ca6ff79590b11c9be705f650c92fd3cb63
2019-04-01 11:33:10 +09:00
Luke Huang
31f19f7af7 Merge "Minor change for async DNS API" am: 80be1b1127 am: e0b323df1b
am: 2f0336caa9

Change-Id: Iebc2946e5705cfda16f44cb468804c2be385c02a
2019-03-29 12:03:25 -07:00
Luke Huang
2f0336caa9 Merge "Minor change for async DNS API" am: 80be1b1127
am: e0b323df1b

Change-Id: If69e95dbb3cba98af84079506d898350f812a7de
2019-03-29 11:48:51 -07:00
Luke Huang
e0b323df1b Merge "Minor change for async DNS API"
am: 80be1b1127

Change-Id: I54a7695484b6523a92eaf246a4bb836fabc8957f
2019-03-29 11:38:24 -07:00
Lorenzo Colitti
6180380e75 Merge "Unremove DnsResolver#query method used by external developers" am: 3dd6df002b am: f674528970
am: 22f7e75f67

Change-Id: Ibfba10cb92e63a7ae727f48543da040aa5f39116
2019-03-29 08:38:15 -07:00
Lorenzo Colitti
22f7e75f67 Merge "Unremove DnsResolver#query method used by external developers" am: 3dd6df002b
am: f674528970

Change-Id: I8c555bc94ec774ebaed4836db7fefece88556d16
2019-03-29 08:23:31 -07:00
Lorenzo Colitti
f674528970 Merge "Unremove DnsResolver#query method used by external developers"
am: 3dd6df002b

Change-Id: I0c8b5b5fe68b99cacc4da10ae27b69fcab8685b7
2019-03-29 08:09:18 -07:00
Luke Huang
293ffaa081 Minor change for async DNS API
do the minor changes to address comments before

Bug: 129395490
Test: atest DnsResolverTest
Change-Id: I56e2e5bc4352ff5c979579247a333a41950079da
2019-03-29 18:12:26 +08:00
Luke Huang
fb5afabcb8 Unremove DnsResolver#query method used by external developers
This method was removed as part of addressing API council feedback in b/129261432
Add back previous DnsResolver#query which is already being used by developers.

Bug: 129395490
Test: atest DnsResolverTest

Change-Id: Ic956db204f3940d39d42e1b11dda39e57d356fad
2019-03-29 18:12:26 +08:00
Luke Huang
bd2a4be755 Merge "Use IDnsResolver instead of INetd for resolver related binder commands" am: efa4301a7f am: 8ef15888a5
am: 068f305fc7

Change-Id: I2d642b71df25934fddd8a1476b5d27457628b8e2
2019-03-29 02:24:24 -07:00
Luke Huang
068f305fc7 Merge "Use IDnsResolver instead of INetd for resolver related binder commands" am: efa4301a7f
am: 8ef15888a5

Change-Id: I80ae047bd65b654e01061a9f218be23e1e3ef2ed
2019-03-29 02:10:55 -07:00
Luke Huang
8ef15888a5 Merge "Use IDnsResolver instead of INetd for resolver related binder commands"
am: efa4301a7f

Change-Id: Icca07604bc8f922c51493e72fde8c7377105bf8b
2019-03-29 01:57:44 -07:00
Luke Huang
efa4301a7f Merge "Use IDnsResolver instead of INetd for resolver related binder commands" 2019-03-29 08:45:19 +00:00
Luke Huang
19dcd80972 Merge "Fix cancellation race problem for aysnc DNS API" am: de6217b8e2 am: 829e409827
am: ae338a8030

Change-Id: I4e10bfaa43a63cedd9fbddfc6f8bf8853c426eba
2019-03-28 21:18:41 -07:00
Luke Huang
ae338a8030 Merge "Fix cancellation race problem for aysnc DNS API" am: de6217b8e2
am: 829e409827

Change-Id: I633a592c7f46162268a759f84a77211443e9a04e
2019-03-28 20:45:44 -07:00
Luke Huang
829e409827 Merge "Fix cancellation race problem for aysnc DNS API"
am: de6217b8e2

Change-Id: I7e22c38c502fa0181e97057d9992c2a43c11b378
2019-03-28 20:32:40 -07:00
Luke Huang
de6217b8e2 Merge "Fix cancellation race problem for aysnc DNS API" 2019-03-29 03:15:32 +00:00
Varun Anand
25a6f97f2c [automerger skipped] Merge changes from topic "vpn_data_accounting" am: 06b4b6f92e am: f714bf2fad
am: 272f9072f6 -s ours
am skip reason: change_id I230c1edbf64cfeb3dbb560db368b5e420f7b79a4 with SHA1 e62e287511 is in history

Change-Id: I193b9d8190a4cda863d89d9babb680201fa3f125
2019-03-28 18:25:59 -07:00
Varun Anand
272f9072f6 Merge changes from topic "vpn_data_accounting" am: 06b4b6f92e
am: f714bf2fad

Change-Id: If4fff1b4d14e80e024ce7b1aa85ebd3afcb1ecc2
2019-03-28 18:16:37 -07:00
Varun Anand
f714bf2fad Merge changes from topic "vpn_data_accounting"
am: 06b4b6f92e

Change-Id: Iaa4b2dd9be2fc6e9833c6c846b6858aab507ca8b
2019-03-28 18:06:12 -07:00
Varun Anand
06b4b6f92e Merge changes from topic "vpn_data_accounting"
* changes:
  Move BatteryStats and StatsCompanionService to use NetworkStatsService.
  NetworkStatsService: Fix getDetailedUidStats to take VPNs into account.
  Take all VPN underlying networks into account when migrating traffic for VPN uid.
2019-03-29 00:40:53 +00:00
Varun Anand
2af0b66aba NetworkStatsService: Fix getDetailedUidStats to take VPNs into account.
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: Ib0f0c2d4d41ee1d7a027ea9da457baaf198d649e
2019-03-28 10:31:51 -07:00
Varun Anand
612520f544 Take all VPN underlying networks into account when migrating traffic for
VPN uid.

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: I9d8d0cc58d18002c1c96f8ddff780ef8dc452d21
2019-03-28 10:31:49 -07:00
Luke Huang
e17bb2dff4 Fix cancellation race problem for aysnc DNS API
This problem might cause double-close fd and result in app crash
or unexpected behaviour

Bug: 129317069
Test: atest DnsResolverTest
      manual test with delaying response callback/cancel
Change-Id: I223234f527edafc51d34fa6be390419c05def8d8
2019-03-28 19:46:56 +08:00
chen xu
5a459916e5 Merge "support msim for captiveportal notification" am: 5c83418408 am: 3555617d90
am: 32b39d1a84

Change-Id: Ia6babd4bae6fcffdc3149f76c7e378b14ec42375
2019-03-27 21:10:41 -07:00
chen xu
32b39d1a84 Merge "support msim for captiveportal notification" am: 5c83418408
am: 3555617d90

Change-Id: I2a28b1b096239091af8c063418994e7db0d35df4
2019-03-27 20:52:04 -07:00
chen xu
3555617d90 Merge "support msim for captiveportal notification"
am: 5c83418408

Change-Id: I3bed0b6d44a13a4dd1c68b21a28b75e4e6c7aa81
2019-03-27 20:42:44 -07:00
Treehugger Robot
5c83418408 Merge "support msim for captiveportal notification" 2019-03-28 03:28:19 +00:00
Junyu Lai
bf7917290e Merge changes I0baf582f,I4bba01ba am: 6d7c97dc5c am: a0540419f9
am: 7fd6b91b04

Change-Id: I2cc021899270b41e4b9047ef32869af53ea6fb65
2019-03-27 18:43:18 -07:00
Junyu Lai
7fd6b91b04 Merge changes I0baf582f,I4bba01ba am: 6d7c97dc5c
am: a0540419f9

Change-Id: Ia6cd87afec7c449b9096400352c5f6de75a012bc
2019-03-27 18:27:36 -07:00
Junyu Lai
a0540419f9 Merge changes I0baf582f,I4bba01ba
am: 6d7c97dc5c

Change-Id: Ie69a03e6c61e172ba7e9948706fe6780be61a41b
2019-03-27 18:17:27 -07:00
Junyu Lai
6d7c97dc5c Merge changes I0baf582f,I4bba01ba
* changes:
  Block unpriviledged apps which create keepalives with null fd
  Fix keepalive don't get removed when lower layer error
2019-03-28 00:53:20 +00:00
junyulai
828dad188c Block unpriviledged apps which create keepalives with null fd
Currently, socketKeepalive implementation is accepting null fd
due to backward compatibility with legacy packet keepalive API.
However, due to lack of the fd, the service cannot guarantee the
port is not reused by another app if the caller release the port
for any reason.

Thus, grant the null fd access only for priviledged apps.

This commit also address some comments from aosp/918533.

Bug: 126699232
Test: atest FrameworksNetTests
Change-Id: I0baf582ff4ca8af6082c3754e8dfbcd867f39792
2019-03-27 19:51:08 +08:00
Luke Huang
8141319b4d Use IDnsResolver instead of INetd for resolver related binder commands
migrate resolver related commands from INetd to IDnsResolver

Bug: 126141549
Test: atest FrameworksNetTests ConnectivityServiceTest Nat464XlatTest
      atest DnsManagerTest
Change-Id: I559c0c1304d53dde408c062e1a52e742595e7cbe
2019-03-27 17:39:07 +08:00
chen xu
5b5447e421 support msim for captiveportal notification
Bug: 123025093
Test: Manual
Change-Id: Ie04f3ae9a825ab75077a94b108ac92075b6d4753
2019-03-27 00:11:52 -07:00
Chenbo Feng
697ebc8373 Merge "Get the permission information for native services" am: 743a1c8001 am: 2a029a210c
am: e2e936d32d

Change-Id: I798cf00caee4f505d45929ddf9ccd03e658c4c3c
2019-03-26 22:53:13 -07:00
Chenbo Feng
e2e936d32d Merge "Get the permission information for native services" am: 743a1c8001
am: 2a029a210c

Change-Id: I61bdf44239c880ef1b95c31a037f64158a32d789
2019-03-26 22:42:38 -07:00
Chenbo Feng
2a029a210c Merge "Get the permission information for native services"
am: 743a1c8001

Change-Id: I806e3e948dfab0cc8c691c20f377bbc3a24240a6
2019-03-26 22:33:27 -07:00
junyulai
8b381dd91b Fix keepalive don't get removed when lower layer error
Currently, if the lower layer, e.g. wifi, didn't successfully
start keepalive by any reason. Due to the startedState changed
to NOT_STARTED first, the logic inside stop() will skip the
removing process and cause leak.

Thus, moving the changing of startedState to proper place first
to unblock subsequent changes first.

Bug: 123988249
Bug: 129371366
Test: atest FrameworksNetTests
Change-Id: I4bba01bacc80e1dac2023ef831b5ade5501894e4
2019-03-27 11:38:58 +08:00
Chenbo Feng
13730b8b9e Merge "Fix the INTERNET related permissions" am: 65cef6401a am: 5289cdd37e
am: 08c2484d37

Change-Id: Id14b54002f7b3496df9e7943a127f63dcf4e82b2
2019-03-26 20:14:10 -07:00
Chenbo Feng
08c2484d37 Merge "Fix the INTERNET related permissions" am: 65cef6401a
am: 5289cdd37e

Change-Id: I7b07ca0ef7966f0ebee17cabe2eb79c5d6381228
2019-03-26 20:02:14 -07:00
Chenbo Feng
5289cdd37e Merge "Fix the INTERNET related permissions"
am: 65cef6401a

Change-Id: Id97b1ea945409e938158f30efd564b10c9e81380
2019-03-26 19:52:57 -07:00
Chenbo Feng
d72e9ab720 Get the permission information for native services
For native services such as mediaserver and audioserver, the permission
information cannot be retrieved from getInstalledPackages. Instead, the
high level permission information is avalaible in systemConfigs. With
those permission information, netd can store the complete list of uids
that have UPDATE_DEVICE_STATS permission.

Bug: 128944261
Test: dumpsys netd trafficcontroller
Change-Id: I0331d5a3a5b927a351fcfe6689ef1ba2b993db0c
2019-03-27 02:45:37 +00:00
Treehugger Robot
65cef6401a Merge "Fix the INTERNET related permissions" 2019-03-27 02:35:35 +00:00
Lucas Lin
63c0ac9f45 Merge "Fix flaky test for ConnectivityServiceTest#testPartialConnectivity" am: 52feef4450 am: b7977acec0
am: 5ae1bff2bf

Change-Id: I80399f9980119342ba5cd3d4f1922badb1fee3e9
2019-03-26 19:00:50 -07:00
Lucas Lin
5ae1bff2bf Merge "Fix flaky test for ConnectivityServiceTest#testPartialConnectivity" am: 52feef4450
am: b7977acec0

Change-Id: I4b0a70cbfdce8f43c07275ace151d3ab464da5a4
2019-03-26 18:49:59 -07:00