Commit Graph

6041 Commits

Author SHA1 Message Date
Paul Hu
8b207facf4 Merge "Fix IpPrefixTest#testContainsInetAddress fail." am: 79a5776e79
am: 0756750737

Change-Id: I257b51a4f0be974eacf8a6c0f12b5d5aacdc7a5f
2019-04-01 18:59:35 -07:00
Paul Hu
0756750737 Merge "Fix IpPrefixTest#testContainsInetAddress fail."
am: 79a5776e79

Change-Id: I0926ee39c306fefdd158e1c4c7e4c1ba4b7c5f7d
2019-04-01 18:47:42 -07:00
Paul Hu
79a5776e79 Merge "Fix IpPrefixTest#testContainsInetAddress fail." 2019-04-02 01:33:02 +00:00
Chalard Jean
17f183f66a Merge "Cleanup SystemReady in the network stack" am: 37576c4dde
am: aa2878a2e0

Change-Id: Id1348ffa1406adf08b94eec18b3b1e6da40e84be
2019-04-01 17:41:35 -07:00
Chalard Jean
aa2878a2e0 Merge "Cleanup SystemReady in the network stack"
am: 37576c4dde

Change-Id: I1a55078b74d5f94afde94da0dc5f6e1d2af10de3
2019-04-01 17:12:06 -07:00
Chalard Jean
37576c4dde Merge "Cleanup SystemReady in the network stack" 2019-04-01 23:28:47 +00:00
paulhu
da137d9082 Fix IpPrefixTest#testContainsInetAddress fail.
The argument of IpPreFix#contains() has been marked as @NonNull.
So the IpPrefixTest#testContainsInetAddress should not test
contains() method wiht null object.

Bug: None
Test: atest FrameworksNetTests
      atest IpPrefixTest#testContainsInetAddress

Change-Id: I2f6bee19514dc47702f64d2a2bbf02d8b7b1b407
2019-04-02 00:49:00 +08:00
Xiao Ma
72da4758de Merge "Add DHCP address lease expiry in IpMemoryStore." am: 0f1ffb3b77
am: 5bdb41fdcf

Change-Id: I690d6c1602292731f27b3f2d0a1a36cf95849d2e
2019-04-01 06:27:18 -07:00
Xiao Ma
5bdb41fdcf Merge "Add DHCP address lease expiry in IpMemoryStore."
am: 0f1ffb3b77

Change-Id: Idb73423aaf875bb77d19f9661e243f152f734fa3
2019-04-01 06:16:08 -07:00
Xiao Ma
0f1ffb3b77 Merge "Add DHCP address lease expiry in IpMemoryStore." 2019-04-01 12:59:20 +00:00
Paul Hu
0dcc2d8053 Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues." am: 2971c23c97
am: c66885bc37

Change-Id: I171e667dd279e008708fbc84972f63cbd5b55625
2019-04-01 00:43:33 -07:00
Paul Hu
c66885bc37 Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues."
am: 2971c23c97

Change-Id: I8d848c559e1c1e021a72bf525876aad9bddb3374
2019-04-01 00:34:26 -07:00
Paul Hu
2971c23c97 Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues." 2019-04-01 07:20:53 +00:00
Chalard Jean
b1b282c8ee Cleanup SystemReady in the network stack
The system server (in SystemServer.java) defines the boot
sequence, during which an event called SystemReady happens.
This corresponds to a time when critical system services
that are depended upon by other components in the system
server are ready to handle requests from their dependencies.
Some system services are listening to this event to defer
initializations that depend on the critical services.

Because the network stack is only started after SystemReady,
there is no way any NetworkMonitor may be started before
SystemReady. Remove the associated mechanism.

Fix: 129376083
Test: FrameworksNetTests
Change-Id: I071eeb10d0b7c4f71af6653d322c7b442b2cc7ee
2019-04-01 13:32:25 +09:00
Remi NGUYEN VAN
bf761cce3e Merge "Fix race when starting NetworkMonitor" am: ca5b44477a
am: 9e85030e71

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

Change-Id: I3fe792704b9dfaafe09c83da57081d6668216a97
2019-03-31 21:13:48 -07:00
Remi NGUYEN VAN
ca5b44477a Merge "Fix race when starting NetworkMonitor" 2019-04-01 03:54:03 +00:00
Remi NGUYEN VAN
f59a5d4580 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
paulhu
6f2c1b5f78 Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues.
Fix: 129362082
Fix: 129361362
Fix: 129360330
Fix: 129362379
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I05fbc6f98207d5cf002e3cbc5829040af7d6be52
2019-04-01 10:23:51 +08:00
Luke Huang
9e70eedefb Merge "Minor change for async DNS API" am: 80be1b1127
am: a3cac1b558

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

Change-Id: I54a7695484b6523a92eaf246a4bb836fabc8957f
2019-03-29 11:38:24 -07:00
Lorenzo Colitti
b09fa5d9e5 Merge "Unremove DnsResolver#query method used by external developers" am: 3dd6df002b
am: 2735dbeb27

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

Change-Id: I0c8b5b5fe68b99cacc4da10ae27b69fcab8685b7
2019-03-29 08:09:18 -07:00
Luke Huang
10331f6810 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
4430601e38 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
bdf234395b Merge "Use IDnsResolver instead of INetd for resolver related binder commands" am: 8c3d79e813
am: 3b2c0dda05

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

Change-Id: Icca07604bc8f922c51493e72fde8c7377105bf8b
2019-03-29 01:57:44 -07:00
Luke Huang
8c3d79e813 Merge "Use IDnsResolver instead of INetd for resolver related binder commands" 2019-03-29 08:45:19 +00:00
Xiao Ma
314a2312aa 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
af155d0716 Merge "Fix cancellation race problem for aysnc DNS API" am: b08fbde438
am: c8e5e12a32

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

Change-Id: I7e22c38c502fa0181e97057d9992c2a43c11b378
2019-03-28 20:32:40 -07:00
Luke Huang
b08fbde438 Merge "Fix cancellation race problem for aysnc DNS API" 2019-03-29 03:15:32 +00:00
Varun Anand
a54fbaea86 Merge changes from topic "vpn_data_accounting" am: f004bcbbf5
am: 7b2515e424

Change-Id: If4fff1b4d14e80e024ce7b1aa85ebd3afcb1ecc2
2019-03-28 18:16:37 -07:00
Varun Anand
7b2515e424 Merge changes from topic "vpn_data_accounting"
am: f004bcbbf5

Change-Id: Iaa4b2dd9be2fc6e9833c6c846b6858aab507ca8b
2019-03-28 18:06:12 -07:00
Varun Anand
f004bcbbf5 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
23e1e5e300 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
2dbf6e6978 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
93ebd752c0 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
285f57f0aa Merge "support msim for captiveportal notification" am: b3aaa9e902
am: effcccf638

Change-Id: I2a28b1b096239091af8c063418994e7db0d35df4
2019-03-27 20:52:04 -07:00
chen xu
effcccf638 Merge "support msim for captiveportal notification"
am: b3aaa9e902

Change-Id: I3bed0b6d44a13a4dd1c68b21a28b75e4e6c7aa81
2019-03-27 20:42:44 -07:00
Treehugger Robot
b3aaa9e902 Merge "support msim for captiveportal notification" 2019-03-28 03:28:19 +00:00
Junyu Lai
9cd8136d86 Merge changes I0baf582f,I4bba01ba am: ae26195e6a
am: 92adef2970

Change-Id: Ia6cd87afec7c449b9096400352c5f6de75a012bc
2019-03-27 18:27:36 -07:00
Junyu Lai
92adef2970 Merge changes I0baf582f,I4bba01ba
am: ae26195e6a

Change-Id: Ie69a03e6c61e172ba7e9948706fe6780be61a41b
2019-03-27 18:17:27 -07:00
Junyu Lai
ae26195e6a 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
c4fb248ef7 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
e3d6a7907b 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
696c6de419 support msim for captiveportal notification
Bug: 123025093
Test: Manual
Change-Id: Ie04f3ae9a825ab75077a94b108ac92075b6d4753
2019-03-27 00:11:52 -07:00
Chenbo Feng
e9b7751ccf Merge "Get the permission information for native services" am: 743a1c8001
am: f28abcce27

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

Change-Id: I806e3e948dfab0cc8c691c20f377bbc3a24240a6
2019-03-26 22:33:27 -07:00
junyulai
04bd504641 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