Commit graph

6,029 commits

Message SHA1
Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues." am: 1f041d1443
am: 9420c284b5

Change-Id: I171e667dd279e008708fbc84972f63cbd5b55625

Paul Hu   authored and   android-build-merger   commited 2019-04-01 00:43:33 -07:00
ea2bcdfa4e
Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues."
am: 1f041d1443

Change-Id: I8d848c559e1c1e021a72bf525876aad9bddb3374

Paul Hu   authored and   android-build-merger   commited 2019-04-01 00:34:26 -07:00
9420c284b5
Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues."
Paul Hu   authored and   Gerrit Code Review   commited 2019-04-01 07:20:53 +00:00
1f041d1443
Merge "Fix race when starting NetworkMonitor" am: ef8485cc65
am: ea71c49a0e

Change-Id: I049ea18e6c5c42a1b31d93541aa3846b14b7ab08

Remi NGUYEN VAN   authored and   android-build-merger   commited 2019-03-31 21:25:12 -07:00
3a8102ab8e
Merge "Fix race when starting NetworkMonitor"
am: ef8485cc65

Change-Id: I3fe792704b9dfaafe09c83da57081d6668216a97

Remi NGUYEN VAN   authored and   android-build-merger   commited 2019-03-31 21:13:48 -07:00
ea71c49a0e
Merge "Fix race when starting NetworkMonitor"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-04-01 03:54:03 +00:00
ef8485cc65
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

Remi NGUYEN VAN   commited 2019-04-01 11:33:10 +09:00
ca33d197d9
Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues.
Fix: 129362082
Fix: 129361362
Fix: 129360330
Fix: 129362379
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I05fbc6f98207d5cf002e3cbc5829040af7d6be52

paulhu   commited 2019-04-01 10:23:51 +08:00
895a741bf1
Merge "Minor change for async DNS API" am: 80be1b1127
am: e0b323df1b

Change-Id: If69e95dbb3cba98af84079506d898350f812a7de

Luke Huang   authored and   android-build-merger   commited 2019-03-29 11:48:51 -07:00
2f0336caa9
Merge "Minor change for async DNS API"
am: 80be1b1127

Change-Id: I54a7695484b6523a92eaf246a4bb836fabc8957f

Luke Huang   authored and   android-build-merger   commited 2019-03-29 11:38:24 -07:00
e0b323df1b
Merge "Unremove DnsResolver#query method used by external developers" am: 3dd6df002b
am: f674528970

Change-Id: I8c555bc94ec774ebaed4836db7fefece88556d16

Lorenzo Colitti   authored and   android-build-merger   commited 2019-03-29 08:23:31 -07:00
22f7e75f67
Merge "Unremove DnsResolver#query method used by external developers"
am: 3dd6df002b

Change-Id: I0c8b5b5fe68b99cacc4da10ae27b69fcab8685b7

Lorenzo Colitti   authored and   android-build-merger   commited 2019-03-29 08:09:18 -07:00
f674528970
Minor change for async DNS API
do the minor changes to address comments before

Bug: 129395490
Test: atest DnsResolverTest
Change-Id: I56e2e5bc4352ff5c979579247a333a41950079da

Luke Huang   commited 2019-03-29 18:12:26 +08:00
293ffaa081
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

Luke Huang   commited 2019-03-29 18:12:26 +08:00
fb5afabcb8
Merge "Use IDnsResolver instead of INetd for resolver related binder commands" am: efa4301a7f
am: 8ef15888a5

Change-Id: I80ae047bd65b654e01061a9f218be23e1e3ef2ed

Luke Huang   authored and   android-build-merger   commited 2019-03-29 02:10:55 -07:00
068f305fc7
Merge "Use IDnsResolver instead of INetd for resolver related binder commands"
am: efa4301a7f

Change-Id: Icca07604bc8f922c51493e72fde8c7377105bf8b

Luke Huang   authored and   android-build-merger   commited 2019-03-29 01:57:44 -07:00
8ef15888a5
Merge "Use IDnsResolver instead of INetd for resolver related binder commands"
Luke Huang   authored and   Gerrit Code Review   commited 2019-03-29 08:45:19 +00:00
efa4301a7f
Merge "Fix cancellation race problem for aysnc DNS API" am: de6217b8e2
am: 829e409827

Change-Id: I633a592c7f46162268a759f84a77211443e9a04e

Luke Huang   authored and   android-build-merger   commited 2019-03-28 20:45:44 -07:00
ae338a8030
Merge "Fix cancellation race problem for aysnc DNS API"
am: de6217b8e2

Change-Id: I7e22c38c502fa0181e97057d9992c2a43c11b378

Luke Huang   authored and   android-build-merger   commited 2019-03-28 20:32:40 -07:00
829e409827
Merge "Fix cancellation race problem for aysnc DNS API"
Luke Huang   authored and   Gerrit Code Review   commited 2019-03-29 03:15:32 +00:00
de6217b8e2
Merge changes from topic "vpn_data_accounting" am: 06b4b6f92e
am: f714bf2fad

Change-Id: If4fff1b4d14e80e024ce7b1aa85ebd3afcb1ecc2

Varun Anand   authored and   android-build-merger   commited 2019-03-28 18:16:37 -07:00
272f9072f6
Merge changes from topic "vpn_data_accounting"
am: 06b4b6f92e

Change-Id: Iaa4b2dd9be2fc6e9833c6c846b6858aab507ca8b

Varun Anand   authored and   android-build-merger   commited 2019-03-28 18:06:12 -07:00
f714bf2fad
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.

Varun Anand   authored and   Gerrit Code Review   commited 2019-03-29 00:40:53 +00:00
06b4b6f92e
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

Varun Anand   commited 2019-03-28 10:31:51 -07:00
2af0b66aba
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

Varun Anand   commited 2019-03-28 10:31:49 -07:00
612520f544
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

Luke Huang   commited 2019-03-28 19:46:56 +08:00
e17bb2dff4
Merge "support msim for captiveportal notification" am: 5c83418408
am: 3555617d90

Change-Id: I2a28b1b096239091af8c063418994e7db0d35df4

chen xu   authored and   android-build-merger   commited 2019-03-27 20:52:04 -07:00
32b39d1a84
Merge "support msim for captiveportal notification"
am: 5c83418408

Change-Id: I3bed0b6d44a13a4dd1c68b21a28b75e4e6c7aa81

chen xu   authored and   android-build-merger   commited 2019-03-27 20:42:44 -07:00
3555617d90
Merge "support msim for captiveportal notification"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-28 03:28:19 +00:00
5c83418408
Merge changes I0baf582f,I4bba01ba am: 6d7c97dc5c
am: a0540419f9

Change-Id: Ia6cd87afec7c449b9096400352c5f6de75a012bc

Junyu Lai   authored and   android-build-merger   commited 2019-03-27 18:27:36 -07:00
7fd6b91b04
Merge changes I0baf582f,I4bba01ba
am: 6d7c97dc5c

Change-Id: Ie69a03e6c61e172ba7e9948706fe6780be61a41b

Junyu Lai   authored and   android-build-merger   commited 2019-03-27 18:17:27 -07:00
a0540419f9
Merge changes I0baf582f,I4bba01ba
* changes:
  Block unpriviledged apps which create keepalives with null fd
  Fix keepalive don't get removed when lower layer error

Junyu Lai   authored and   Gerrit Code Review   commited 2019-03-28 00:53:20 +00:00
6d7c97dc5c
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

junyulai   commited 2019-03-27 19:51:08 +08:00
828dad188c
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

Luke Huang   commited 2019-03-27 17:39:07 +08:00
8141319b4d
support msim for captiveportal notification
Bug: 123025093
Test: Manual
Change-Id: Ie04f3ae9a825ab75077a94b108ac92075b6d4753

chen xu   commited 2019-03-27 00:11:52 -07:00
5b5447e421
Merge "Get the permission information for native services" am: 743a1c8001
am: 2a029a210c

Change-Id: I61bdf44239c880ef1b95c31a037f64158a32d789

Chenbo Feng   authored and   android-build-merger   commited 2019-03-26 22:42:38 -07:00
e2e936d32d
Merge "Get the permission information for native services"
am: 743a1c8001

Change-Id: I806e3e948dfab0cc8c691c20f377bbc3a24240a6

Chenbo Feng   authored and   android-build-merger   commited 2019-03-26 22:33:27 -07:00
2a029a210c
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

junyulai   commited 2019-03-27 11:38:58 +08:00
8b381dd91b
Merge "Fix the INTERNET related permissions" am: 65cef6401a
am: 5289cdd37e

Change-Id: I7b07ca0ef7966f0ebee17cabe2eb79c5d6381228

Chenbo Feng   authored and   android-build-merger   commited 2019-03-26 20:02:14 -07:00
08c2484d37
Merge "Fix the INTERNET related permissions"
am: 65cef6401a

Change-Id: Id97b1ea945409e938158f30efd564b10c9e81380

Chenbo Feng   authored and   android-build-merger   commited 2019-03-26 19:52:57 -07:00
5289cdd37e
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

Chenbo Feng   commited 2019-03-27 02:45:37 +00:00
d72e9ab720
Merge "Fix the INTERNET related permissions"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-27 02:35:35 +00:00
65cef6401a
Merge "Fix flaky test for ConnectivityServiceTest#testPartialConnectivity" am: 52feef4450
am: b7977acec0

Change-Id: I4b0a70cbfdce8f43c07275ace151d3ab464da5a4

Lucas Lin   authored and   android-build-merger   commited 2019-03-26 18:49:59 -07:00
5ae1bff2bf
Merge "Fix flaky test for ConnectivityServiceTest#testPartialConnectivity"
am: 52feef4450

Change-Id: I0639d4ccd7c3211595ede82bce3daa87ae759e10

Lucas Lin   authored and   android-build-merger   commited 2019-03-26 18:41:00 -07:00
b7977acec0
Merge "Fix flaky test for ConnectivityServiceTest#testPartialConnectivity"
Lucas Lin   authored and   Gerrit Code Review   commited 2019-03-27 01:29:51 +00:00
52feef4450
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

Chenbo Feng   commited 2019-03-26 15:16:26 -07:00
0c4742527b
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

lucaslin   commited 2019-03-26 17:49:49 +08:00
9df5336349
Merge "Reveal the call trace of failed test cases which run in executors" am: 67cfb00800
am: ff5f8defa6

Change-Id: I1a2d312842f33a9b7b98da925b332becaece3cb2

Junyu Lai   authored and   android-build-merger   commited 2019-03-26 00:03:27 -07:00
e674483e9f
Merge "Reveal the call trace of failed test cases which run in executors"
am: 67cfb00800

Change-Id: Ia0de9ac66ad2137c6d1147e2ad5c899ab7b33ece

Junyu Lai   authored and   android-build-merger   commited 2019-03-25 23:54:01 -07:00
ff5f8defa6
Merge "Reveal the call trace of failed test cases which run in executors"
Junyu Lai   authored and   Gerrit Code Review   commited 2019-03-26 06:38:39 +00:00
67cfb00800