Commit Graph

6678 Commits

Author SHA1 Message Date
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
Xiao Ma
3c33ee5d81 Add DHCP address lease expiry in IpMemoryStore.
Bug:122710829
Test: atest FrameworksNetTests
Change-Id: I643fe1231edcd18923514ab66c64a6cf83e69443
2019-03-29 16:51:47 +09: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
Bill Rassieur
7a129c706d Merge master@5406228 into git_qt-dev-plus-aosp.
Change-Id: I6ec4d7ef40a971744cbc14ebf3a9ec1071c0bb0a
BUG: 129345239
2019-03-29 04:16:19 +00: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
Lucas Lin
b7977acec0 Merge "Fix flaky test for ConnectivityServiceTest#testPartialConnectivity"
am: 52feef4450

Change-Id: I0639d4ccd7c3211595ede82bce3daa87ae759e10
2019-03-26 18:41:00 -07:00
Lucas Lin
52feef4450 Merge "Fix flaky test for ConnectivityServiceTest#testPartialConnectivity" 2019-03-27 01:29:51 +00:00
Chenbo Feng
0c4742527b Fix the INTERNET related permissions
Change the INTERNET permission implementation so it only block socket
creation when non of the packages under the same uid have internet
permission. Fix the UPDATE_DEVICE_STATS permission so only the uid that
own the permission can change it.

Bug: 111560570
Test: CtsNetTestCasesUpdateStatsPermission
      CtsNetTestCasesInternetPermission
Change-Id: I42385526c191d4429f486cde01293b27fcc1374b
2019-03-26 15:16:26 -07:00
lucaslin
9df5336349 Fix flaky test for ConnectivityServiceTest#testPartialConnectivity
There are 2 problems will make testPartialConnectivity flaky:
1. If we call setNetworkValid() before expectCapabilitiesWith(),
there may be a timing issue that network will become VALID before
NetworkMonitor send PARTIAL_CONNECTIVITY to ConnectivityService.
Solution:
We should set network to valid after ConnectivityService received
NETWORK_TEST_RESULT_PARTIAL_CONNECTIVITY to ensure NetworkMonitor
will send PARTIAL_CONNECTIVITY to ConnectivityService first then
send VALID.

2. When test case call explicitlySelected(true) first then call
connect(true), NetworkMonitor will report the network validation
test result twice because ConnectivityServiceTest() will trigger
notifyNetworkTested() when setAcceptPartialConnectivity() is
called, it may cause a timing that before the second test result
send to ConnectivityService, connect() already called
setNetworkInvalid. So, NET_CAPABILITY_VALIDATED will be removed
and ConnectivityService will trigger onCapabilitiesChanged()
unexpectedly.
Solution:
Don't trigger notifyNetworkTested() when
setAcceptPartialConnectivity() is called. If there is needed,
use mCm.reportNetworkConnectivity() to report the test result
instead.

Bug: 128426024
Test: 1. atest FrameworksNetTests: \
      ConnectivityServiceTest#testPartialConnectivity \
      --generate-new-metrics 1000

Change-Id: I7200528378201a3c7c09a78ff827b41f2741dfa1
2019-03-26 17:49:49 +08:00
Junyu Lai
b8368cc806 Merge "Reveal the call trace of failed test cases which run in executors" am: 67cfb00800 am: ff5f8defa6
am: e674483e9f

Change-Id: I023c8140c94966479db7f12647838699324462af
2019-03-26 00:13:47 -07:00
Junyu Lai
e674483e9f Merge "Reveal the call trace of failed test cases which run in executors" am: 67cfb00800
am: ff5f8defa6

Change-Id: I1a2d312842f33a9b7b98da925b332becaece3cb2
2019-03-26 00:03:27 -07:00
Junyu Lai
ff5f8defa6 Merge "Reveal the call trace of failed test cases which run in executors"
am: 67cfb00800

Change-Id: Ia0de9ac66ad2137c6d1147e2ad5c899ab7b33ece
2019-03-25 23:54:01 -07:00
Junyu Lai
67cfb00800 Merge "Reveal the call trace of failed test cases which run in executors" 2019-03-26 06:38:39 +00:00
Remi NGUYEN VAN
e289064a7b Merge "Add nullability annotations" am: 539821c978 am: 97350573b9
am: c66eb1e12e

Change-Id: I43088399da1d81556ab903ef1ca716439129f00d
2019-03-25 06:56:43 -07:00
Mark Chien
f2a195cad0 Merge "[TCPKeepalive] Fill correct TOS and TTL value" am: 13cc9e442e am: 52ffa51e7f
am: 73062f4600

Change-Id: I80c56a14a0be2e6b7996f2bcb9a1a320f0c2c058
2019-03-25 06:44:17 -07:00
Remi NGUYEN VAN
c66eb1e12e Merge "Add nullability annotations" am: 539821c978
am: 97350573b9

Change-Id: Ic81850c2976e7412e85856c5d1336f30d0691125
2019-03-25 06:42:49 -07:00