Commit Graph

4231 Commits

Author SHA1 Message Date
Hugo Benichi
2e5dfbec28 Merge changes Ia47e566b,Ib94d79a9 am: d8eae0de70 am: 53eee16439 am: b91bd88c5e
am: 883604a9fd

Change-Id: I4226f31aaea21a7ad2bff7ac8b0a85acc5151cfc
2017-09-26 13:30:24 +00:00
Hugo Benichi
883604a9fd Merge changes Ia47e566b,Ib94d79a9 am: d8eae0de70 am: 53eee16439
am: b91bd88c5e

Change-Id: Ied2b31c9d1219b8aebf5fec085ab598b77bede6e
2017-09-26 13:05:41 +00:00
Hugo Benichi
53eee16439 Merge changes Ia47e566b,Ib94d79a9
am: d8eae0de70

Change-Id: I0cac456f778db78d76d2225b79ce42526a6d2d19
2017-09-26 11:46:30 +00:00
Hugo Benichi
d8eae0de70 Merge changes Ia47e566b,Ib94d79a9
* changes:
  Separate connectivity event buffer for bug reports
  Extract RingBuffer class from NetdEventListenerService
2017-09-26 09:48:10 +00:00
Hugo Benichi
bf737c0a6b Extract RingBuffer class from NetdEventListenerService
This patch takes out the ring buffer array added for NFLOG wakeup packet
events logging and extract it into its own class for reuse. This new
RingBuffer class has the two minimal useful functions append() and
toArray().

Bug: 65164242
Bug: 65700460
Test: runtest frameworks-net, with new unit test
Change-Id: Ib94d79a93f4e99661b7d0fac67117b91d57af980
2017-09-26 14:14:16 +09:00
Hugo Benichi
a504e0b9dc Merge "Implement ConnectivityService TODO and fix many race conditions" into oc-mr1-dev am: ceb405f161
am: b5f621957c

Change-Id: I9acc47d1db8d98aa779b0fcbb2ffeb9b4189eadd
2017-09-22 01:27:15 +00:00
Hugo Benichi
b5f621957c Merge "Implement ConnectivityService TODO and fix many race conditions" into oc-mr1-dev
am: ceb405f161

Change-Id: I5729967b3009cb541e586df8117fca3cee860feb
2017-09-22 01:07:33 +00:00
Hugo Benichi
ceb405f161 Merge "Implement ConnectivityService TODO and fix many race conditions" into oc-mr1-dev 2017-09-22 00:50:39 +00:00
Hugo Benichi
b554a15cd4 Merge "Implement ConnectivityService TODO and fix many race conditions" am: 864746862b am: a25440dfc8 am: 287c334379
am: bff2599c5c

Change-Id: I1d4d3a75eb0e6cdfa348d8f877a5cdc5586b2551
2017-09-21 12:27:42 +00:00
Hugo Benichi
bff2599c5c Merge "Implement ConnectivityService TODO and fix many race conditions" am: 864746862b am: a25440dfc8
am: 287c334379

Change-Id: Ia59d45f4e95a536d7982f61ac9c9a1bfc5e8ebb8
2017-09-21 12:21:04 +00:00
Hugo Benichi
f15fc752c5 Implement ConnectivityService TODO and fix many race conditions
This patch implements an outstanding TODO in ConnectivityService to add
synchronization over the map of network request ids to network agent
info objects.

This structure is accessed from multiple threads:
 - Binder thread on public aidl methods, most notably via
   getDefaultNetwork().
 - Internal handler.

This leads to many race conditions that can crash the system server and
reboot the phone if getDefaultNetwork() is called on a Binder thread to
service a public ConnectivityManager api while the default network state
is being updated on the internal handler after losing the default
network.

Bug: 65911184
Test: runtest frameworks-net
Merged-In: I86c830ebd559e31d4576a7606705a056afb064ac
Merged-In: I2011e23c9f894c079ab66cd7cc5c14af572a956d
Merged-In: Ic70901a6aa22a03e97f494e793920ab07a0fd612
Merged-In: I4a7658e1fa6946063ab86a251269413903841ee8
Merged-In: Ia59d45f4e95a536d7982f61ac9c9a1bfc5e8ebb8

(cherry picked from commit cd95278e55bd0e4935f42214d964f8c6aa52b4ea)

Change-Id: I2e26bef9eddd342f51c02b991632c7ea04fe7e66
2017-09-21 21:15:01 +09:00
Erik Kline
0101b3362e Merge "Also support 464xlat on SUSPENDED networks" am: 995a28d334 am: 698b2ee406 am: 1347ac8109
am: 0bbe489393

Change-Id: Iacc209990bd7be57578bc52c9f57c63e0540209e
2017-09-21 12:10:40 +00:00
Hugo Benichi
a25440dfc8 Merge "Implement ConnectivityService TODO and fix many race conditions"
am: 864746862b

Change-Id: I2011e23c9f894c079ab66cd7cc5c14af572a956d
2017-09-21 12:08:45 +00:00
Erik Kline
0bbe489393 Merge "Also support 464xlat on SUSPENDED networks" am: 995a28d334 am: 698b2ee406
am: 1347ac8109

Change-Id: I83ae39a2e36bc036dce419c80dd476d2358b4537
2017-09-21 12:06:05 +00:00
Hugo Benichi
864746862b Merge "Implement ConnectivityService TODO and fix many race conditions" 2017-09-21 12:00:48 +00:00
Erik Kline
698b2ee406 Merge "Also support 464xlat on SUSPENDED networks"
am: 995a28d334

Change-Id: Iab87bfcb66e7932d61beec38bcbda366262eab46
2017-09-21 11:55:35 +00:00
Hugo Benichi
53e6fd54e6 Implement ConnectivityService TODO and fix many race conditions
This patch implements an outstanding TODO in ConnectivityService to add
synchronization over the map of network request ids to network agent
info objects.

This structure is accessed from multiple threads:
 - Binder thread on public aidl methods, most notably via
   getDefaultNetwork().
 - Internal handler.

This leads to many race conditions that can crash the system server and
reboot the phone if getDefaultNetwork() is called on a Binder thread to
service a public ConnectivityManager api while the default network state
is being updated on the internal handler after losing the default
network.

Bug: 65911184
Test: runtest frameworks-net
Change-Id: I86c830ebd559e31d4576a7606705a056afb064ac
2017-09-21 18:50:27 +09:00
Erik Kline
0b01b0f191 Also support 464xlat on SUSPENDED networks
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 65684232

Change-Id: I1b10aab01554b1f926ec7157dba78645fdaff90f
2017-09-21 18:06:29 +09:00
Hugo Benichi
191c971cd0 Merge changes Ied9d0cec,I3087f446,Ibe706872 into oc-mr1-dev am: 49289269b1
am: 8f1245607a

Change-Id: I1797f0c7ad3ddd7d6f509c093f9a16f007a7fe5d
2017-09-20 09:50:32 +00:00
Hugo Benichi
8f1245607a Merge changes Ied9d0cec,I3087f446,Ibe706872 into oc-mr1-dev
am: 49289269b1

Change-Id: I34613d4e53c6cc33029e1f8030b0605100cc59fc
2017-09-20 01:05:15 +00:00
Hugo Benichi
49289269b1 Merge changes Ied9d0cec,I3087f446,Ibe706872 into oc-mr1-dev
* changes:
  Wakeup packet events: addressing a few comments
  Connectivity metrics: add WakeupStats events
  Connectivity metrics: collect NFLOG wakeup events
2017-09-20 00:58:35 +00:00
Charles He
90f27e0771 Merge changes from topic "vpn-dialog" am: 85afa50569 am: b692194f38 am: a9f6384b6a
am: e25293089d

Change-Id: I1c3a3b852bd12a4310f54027b0e893feae2e0d55
2017-09-19 08:32:46 +00:00
Charles He
de30916ae8 Merge changes from topic "always-on-vpn" am: 65e8bd2e04 am: 8ee686cac9 am: 01014743c0
am: 0afa668d91

Change-Id: Id3ac9d9e2a982e9205f4f4a70c1373eed6480844
2017-09-19 08:25:22 +00:00
Charles He
e25293089d Merge changes from topic "vpn-dialog" am: 85afa50569 am: b692194f38
am: a9f6384b6a

Change-Id: I853f48a75865008ac8b976eec1af56fb1870a1b3
2017-09-19 08:25:16 +00:00
Charles He
0afa668d91 Merge changes from topic "always-on-vpn" am: 65e8bd2e04 am: 8ee686cac9
am: 01014743c0

Change-Id: Ide329f8e32538f4643e727697b35bfc2b7007f57
2017-09-19 08:17:12 +00:00
Charles He
b692194f38 Merge changes from topic "vpn-dialog"
am: 85afa50569

Change-Id: I168072aa2bfdb9ed7630cf50547cb9732fb29280
2017-09-19 08:09:45 +00:00
Charles He
8ee686cac9 Merge changes from topic "always-on-vpn"
am: 65e8bd2e04

Change-Id: I7391ce7ecab4f8e73912f420d49150ed7210ea6c
2017-09-19 08:01:45 +00:00
Charles He
85afa50569 Merge changes from topic "vpn-dialog"
* changes:
  Unbreak VPN unit tests.
  Add alert dialog when always-on VPN disconnects.
2017-09-19 07:56:44 +00:00
Charles He
ca55d7bda7 Unbreak VPN unit tests.
VpnTest was broken earlier due to a change to always-on VPN
notifications. This CL adds the corresponding mocks to the unit test to
fix it.

Bug: 36650087
Bug: 65439160
Test: runtest frameworks-net
Change-Id: Icff57c7e927c135d75a7d70ff347a579c5d45134
Merged-In: Icff57c7e927c135d75a7d70ff347a579c5d45134
(cherry picked from commit 5da89994b9)
2017-09-19 07:56:36 +00:00
Charles He
65e8bd2e04 Merge changes from topic "always-on-vpn"
* changes:
  Opt-out for always-on VPN: rename API.
  Opt-out for always-on VPN
2017-09-19 07:50:13 +00:00
Hugo Benichi
b166a64b20 Merge "Wakeup packet events: addressing a few comments" am: efd7e6d7a9 am: ca88876b58 am: 19625788a1
am: 17d5101e99

Change-Id: I7d57c0f2377f44bcf75e18c80c0306bbfccb9591
2017-09-19 07:42:18 +00:00
Hugo Benichi
17d5101e99 Merge "Wakeup packet events: addressing a few comments" am: efd7e6d7a9 am: ca88876b58
am: 19625788a1

Change-Id: I8ca2a01a95acaaca2599563efd6a21e4372d1f95
2017-09-19 07:36:12 +00:00
Hugo Benichi
ca88876b58 Merge "Wakeup packet events: addressing a few comments"
am: efd7e6d7a9

Change-Id: I67b2e54d45a39005e2091a46e8b90d8cc75fe079
2017-09-19 07:21:12 +00:00
Hugo Benichi
6c35b8082c Wakeup packet events: addressing a few comments
This patch addresses a few post-submit comment for
commits f562ac34a51dc and 60c9f63b66921.

Bug: 34901696
Bug: 62179647
Test: runtest frameworks-net
Merged-In: I4abec57e0c6bc869dc57b5eb54582dd977b64c30

(cherry picked from commit 175b574e27daa0d8832b8cc9615a15fce998309a)

Change-Id: Ied9d0cec98685e5a91ed2ca2c81ad88d7ae8d751
2017-09-19 16:14:19 +09:00
Hugo Benichi
efd7e6d7a9 Merge "Wakeup packet events: addressing a few comments" 2017-09-19 07:12:03 +00:00
Rubin Xu
42325fa3e9 Merge "Fix LinkPropertiesTest.testCompareResult" am: 430d8472b2 am: 1c7c93e084 am: 3db86833e6
am: f49156fd33

Change-Id: Ie928474dc005c713063885d156786106ca2c281c
2017-09-19 06:57:14 +00:00
Rubin Xu
f49156fd33 Merge "Fix LinkPropertiesTest.testCompareResult" am: 430d8472b2 am: 1c7c93e084
am: 3db86833e6

Change-Id: I72b0ca1b9b50dacb7067eb6ca12ca48a072b5d26
2017-09-19 06:51:07 +00:00
Rubin Xu
1c7c93e084 Merge "Fix LinkPropertiesTest.testCompareResult"
am: 430d8472b2

Change-Id: If87f8c43371ee1f5e2e893232c9e340a1a7339f4
2017-09-19 06:37:40 +00:00
Hugo Benichi
d4a29081c1 Wakeup packet events: addressing a few comments
This patch addresses a few post-submit comment for
commits f562ac34a51dc and 60c9f63b66921.

Bug: 34901696
Bug: 62179647
Test: runtest frameworks-net
Change-Id: I4abec57e0c6bc869dc57b5eb54582dd977b64c30
2017-09-19 14:07:47 +09:00
Rubin Xu
830124470a Fix LinkPropertiesTest.testCompareResult
Test: runtest frameworks-core -c android.net.LinkPropertiesTest
Change-Id: Ie97b7a7a1557b14296d7c33e98991cdede8463b0
2017-09-15 11:55:28 +01:00
Hugo Benichi
aba2884647 Merge "Merge changes I4719b4dc,I0308cdf4,I38db1bb7 am: e5090f2547 am: 1cbdfb6460 am: b025492a6b" into oc-mr1-dev-plus-aosp
am: add643c337

Change-Id: I235a6e894157f0a2b6bbcb26a35dd758da6aefc3
2017-09-15 06:54:11 +00:00
Hugo Benichi
47834c4698 Merge "Merge changes Ie2676b20,Ie8db6f85 am: f33207512a am: 3b0c20458d am: 7d16886c7e" into oc-mr1-dev-plus-aosp
am: 24d8238137

Change-Id: I05671ad4513645fff420cbc9fc4f8355bdeaa1f1
2017-09-15 06:51:45 +00:00
Hugo Benichi
611f62c6b9 Connectivity metrics: add WakeupStats events
This patch defines a new WakeupStats event in ipconnectivity.proto and
populates these events from the NFLOG wakeup events stored in
NetdEventListenerService.

There is one WakeupStats object per known interface on which ingress
packets arrive and may wake the system up.

Example from $ adb shell dumpsys connmetrics list:

...
WakeupStats(wlan0, total: 58, root: 0, system: 3, apps: 38, non-apps: 0, unrouted: 17, 6111s)
WakeupEvent(13:36:31.686, iface wlan0, uid -1)
WakeupEvent(13:38:50.846, iface wlan0, uid -1)
WakeupEvent(13:39:16.676, iface wlan0, uid 10065)
WakeupEvent(13:40:32.144, iface wlan0, uid 1000)
WakeupEvent(13:40:35.827, iface wlan0, uid 1000)
WakeupEvent(13:40:47.913, iface wlan0, uid 10004)
WakeupEvent(13:40:52.622, iface wlan0, uid 10014)
WakeupEvent(13:41:06.036, iface wlan0, uid 10004)
...

Bug: 34901696
Bug: 62179647
Test: runtest frameworks-net
Merged-In: Ie2676b20bfb411a1902f4942643df0c20e268d99

(cherry pick from commit 60c9f63b66926745603978e1bd6372b3a44561d1)

Change-Id: I3087f446fc998fc1ca895d975b80c4a1dd029bf3
2017-09-15 10:36:24 +09:00
Hugo Benichi
8b3f87160b Connectivity metrics: collect NFLOG wakeup events
This patch stores NFLOG packet wakeup events sent by Netd to the system
server into a ring buffer inside NetdEventListenerService. The content
of this buffer is accessible by $ dumpsys connmetrics or $ dumpsys
connmetrics list, and is added to bug reports.

The wakeup event buffer stores currently uid and timestamps.

Bug: 34901696
Bug: 62179647
Test: runtest frameworks-net, new unit tests

Merged-In: Ie8db6f8572b1a929a20398d8dc03e189bc488382

(cherry picked from commit f562ac34a51da55e4d15e34f0cd1cb597e7d926c)

Change-Id: Ibe706872a80dfd06abd9779a2116ca7e4bc0fb77
2017-09-15 10:35:17 +09:00
Rubin Xu
da51a11429 Merge "Refactor CompareResult<> class and its call sites" am: 414e97272f am: 027607ce4d am: c345562746
am: 3c737b4acc

Change-Id: Ib6c61ffe9718ef29c122609a9b343d4e01290568
2017-09-14 22:53:59 +00:00
Hugo Benichi
46510068bc Merge changes I4719b4dc,I0308cdf4,I38db1bb7 am: e5090f2547 am: 1cbdfb6460
am: b025492a6b

Change-Id: I5385a3747e039a42e86034f7632edd0f855b2eb1
2017-09-14 18:11:06 +00:00
Hugo Benichi
b5141eb1d4 Merge changes Ie2676b20,Ie8db6f85 am: f33207512a am: 3b0c20458d
am: 7d16886c7e

Change-Id: Ifd0ace409909d258db3738e58126bbf1c48af5dc
2017-09-14 18:02:14 +00:00
Hugo Benichi
1cbdfb6460 Merge changes I4719b4dc,I0308cdf4,I38db1bb7
am: e5090f2547

Change-Id: I3b222afc77b121769cc18d52e5c3d8bcec9db886
2017-09-14 12:08:26 +00:00
Hugo Benichi
3b0c20458d Merge changes Ie2676b20,Ie8db6f85
am: f33207512a

Change-Id: Ib4fab32418da8274bd6b5cb9fef85e0db79d866a
2017-09-14 12:01:19 +00:00
Hugo Benichi
e5090f2547 Merge changes I4719b4dc,I0308cdf4,I38db1bb7
* changes:
  IpManagerTest: fix flaky test
  Fix flaky NsdManagerTest
  Boostrap test for NetworkMonitor
2017-09-14 11:59:58 +00:00