Commit Graph

4244 Commits

Author SHA1 Message Date
Jean Chalard
bf37853bed Merge "Adds necessary permissions to system apis" am: eea8c4fbc9 am: 7ef3014cad am: 19fc73f8dc -s ours
am: ea422d9b07

Change-Id: If7607e2a2f8043e2a4f5a57738c98bc7361f8a5e
2017-09-27 11:04:23 +00:00
Jean Chalard
ea422d9b07 Merge "Adds necessary permissions to system apis" am: eea8c4fbc9 am: 7ef3014cad
am: 19fc73f8dc  -s ours

Change-Id: If082278ab91e01852155afc1748474a937d7faae
2017-09-27 10:54:58 +00:00
Jean Chalard
7ef3014cad Merge "Adds necessary permissions to system apis"
am: eea8c4fbc9

Change-Id: Ifa5d94cdd883c3e1b983c985c0c17fe61e864352
2017-09-27 09:58:51 +00:00
Jean Chalard
eea8c4fbc9 Merge "Adds necessary permissions to system apis" 2017-09-27 09:50:42 +00:00
Lorenzo Colitti
e1a389d578 Merge "Declare support for Ethernet if the service is running." am: e7a82bbaf3 am: dae0a11792 am: a6648cc90b
am: 640e28df16

Change-Id: I38791cf8b26a49dd8bd210ea3e0284dece9f0719
2017-09-27 09:08:08 +00:00
Lorenzo Colitti
640e28df16 Merge "Declare support for Ethernet if the service is running." am: e7a82bbaf3 am: dae0a11792
am: a6648cc90b

Change-Id: Iafd9807ab76ce4e4ab1fd506d7b0e2b2b7017751
2017-09-27 08:51:51 +00:00
Lorenzo Colitti
dae0a11792 Merge "Declare support for Ethernet if the service is running."
am: e7a82bbaf3

Change-Id: Ie0a0190da53571c6f4b466840b7878eb54b5e136
2017-09-27 08:32:43 +00:00
Treehugger Robot
e7a82bbaf3 Merge "Declare support for Ethernet if the service is running." 2017-09-27 08:23:34 +00:00
Lorenzo Colitti
4c535bcc03 Declare support for Ethernet if the service is running.
On some devices, support for TYPE_ETHERNET is not specified in
the networkAttributes config resource, even though the device is
capable of supporting Ethernet (e.g., via USB host adapters).
This leads to Ethernet working but various connectivity APIs
behaving as if it was not - for example, no CONNECTIVITY_ACTION
broadcasts will be issues when it connects or disconnects.

Ensure that ConnectivityService always treats Ethernet as
available if the service is running. Currently the service is
started if the device supports FEATURE_ETHERNET or
FEATURE_USB_HOST.

Bug: 37359230
Test: bullhead builds, boots
Test: ConnectivityServiceTest passes
Test: Ethernet is available even if removed from networkAttributes resource
Test: ConnectivityManagerTest CTS test passes
Change-Id: I58801bf4f0bbdc3ff6345ec6bfdc911ce045c8ab
2017-09-27 13:03:10 +09:00
Udam Saini
168ad5cb13 Adds necessary permissions to system apis
adds privileged permission for getCaptivePortalServerUrl
adds tether privileged permission for
startTethering,isTetheringSupported

bug:62348162

Test: make and manual testing
Change-Id: I8eb8e3c9dcd7201abe9ea303ee57fe99073d67eb
2017-09-27 12:14:37 +09:00
Chalard Jean
0c91e8adbf Merge "Do not throw on call to isTetheringSupported w/o permission" into oc-mr1-dev am: e545f00e10
am: 4bfafba9dc

Change-Id: I9eb78b72bdf043e4917f6d0d7495b65cfa1114db
2017-09-27 02:21:11 +00:00
Chalard Jean
4bfafba9dc Merge "Do not throw on call to isTetheringSupported w/o permission" into oc-mr1-dev
am: e545f00e10

Change-Id: Ib5b17a7f68c1327f47fe1f54c0454c51f4226907
2017-09-27 02:12:24 +00:00
Hugo Benichi
85c1225158 Merge changes Ia47e566b,Ib94d79a9 am: 1c05049a5b am: 6094886f51 am: b91bd88c5e
am: f0145debdc

Change-Id: I4226f31aaea21a7ad2bff7ac8b0a85acc5151cfc
2017-09-26 13:30:24 +00:00
Hugo Benichi
f0145debdc Merge changes Ia47e566b,Ib94d79a9 am: 1c05049a5b am: 6094886f51
am: b91bd88c5e

Change-Id: Ied2b31c9d1219b8aebf5fec085ab598b77bede6e
2017-09-26 13:05:41 +00:00
Hugo Benichi
6094886f51 Merge changes Ia47e566b,Ib94d79a9
am: 1c05049a5b

Change-Id: I0cac456f778db78d76d2225b79ce42526a6d2d19
2017-09-26 11:46:30 +00:00
Chalard Jean
4e1bb72e61 Do not throw on call to isTetheringSupported w/o permission
...just return false instead. This will change in P.

Test: Made an app to test this. Made sure it doesn't have
Test: the required permission. Checked it crashes with
Test: SecurityException without this change. Checked it
Test: doesn't with it.

Bug: 65404184

Change-Id: Id20d3c240ec5d70d085e0366b92ab3a514f3e7c8
2017-09-26 19:25:48 +09:00
Hugo Benichi
1c05049a5b 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
accf6091e8 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
80452e749b Merge "Implement ConnectivityService TODO and fix many race conditions" into oc-mr1-dev am: b80fcf5ed9
am: 11d98b54a9

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

Change-Id: I5729967b3009cb541e586df8117fca3cee860feb
2017-09-22 01:07:33 +00:00
Hugo Benichi
b80fcf5ed9 Merge "Implement ConnectivityService TODO and fix many race conditions" into oc-mr1-dev 2017-09-22 00:50:39 +00:00
Hugo Benichi
738086ab88 Merge "Implement ConnectivityService TODO and fix many race conditions" am: d66ad08192 am: 55cda75f0d am: 287c334379
am: 09f406e0f6

Change-Id: I1d4d3a75eb0e6cdfa348d8f877a5cdc5586b2551
2017-09-21 12:27:42 +00:00
Hugo Benichi
09f406e0f6 Merge "Implement ConnectivityService TODO and fix many race conditions" am: d66ad08192 am: 55cda75f0d
am: 287c334379

Change-Id: Ia59d45f4e95a536d7982f61ac9c9a1bfc5e8ebb8
2017-09-21 12:21:04 +00:00
Hugo Benichi
0ce0eecbbb 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 28c8414e09)

Change-Id: I2e26bef9eddd342f51c02b991632c7ea04fe7e66
2017-09-21 21:15:01 +09:00
Erik Kline
ed107bfd61 Merge "Also support 464xlat on SUSPENDED networks" am: 995a28d334 am: e7adef3b1f am: 1347ac8109
am: 75ed6c018e

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

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

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

Change-Id: Iab87bfcb66e7932d61beec38bcbda366262eab46
2017-09-21 11:55:35 +00:00
Hugo Benichi
28c8414e09 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
c3e3f84531 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
538c207146 Merge changes Ied9d0cec,I3087f446,Ibe706872 into oc-mr1-dev am: d63a523e8c
am: 64d2d2cecb

Change-Id: I1797f0c7ad3ddd7d6f509c093f9a16f007a7fe5d
2017-09-20 09:50:32 +00:00
Hugo Benichi
64d2d2cecb Merge changes Ied9d0cec,I3087f446,Ibe706872 into oc-mr1-dev
am: d63a523e8c

Change-Id: I34613d4e53c6cc33029e1f8030b0605100cc59fc
2017-09-20 01:05:15 +00:00
Hugo Benichi
d63a523e8c 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
515ba4d005 Merge changes from topic "vpn-dialog" am: 5ebd6035ec am: 9db0d719c4 am: a9f6384b6a
am: 8f619858a4

Change-Id: I1c3a3b852bd12a4310f54027b0e893feae2e0d55
2017-09-19 08:32:46 +00:00
Charles He
dceb3bd18e Merge changes from topic "always-on-vpn" am: 9bab00f0e3 am: 9cc7575ad8 am: 01014743c0
am: 0cc7132f2f

Change-Id: Id3ac9d9e2a982e9205f4f4a70c1373eed6480844
2017-09-19 08:25:22 +00:00
Charles He
8f619858a4 Merge changes from topic "vpn-dialog" am: 5ebd6035ec am: 9db0d719c4
am: a9f6384b6a

Change-Id: I853f48a75865008ac8b976eec1af56fb1870a1b3
2017-09-19 08:25:16 +00:00
Charles He
0cc7132f2f Merge changes from topic "always-on-vpn" am: 9bab00f0e3 am: 9cc7575ad8
am: 01014743c0

Change-Id: Ide329f8e32538f4643e727697b35bfc2b7007f57
2017-09-19 08:17:12 +00:00
Charles He
9db0d719c4 Merge changes from topic "vpn-dialog"
am: 5ebd6035ec

Change-Id: I168072aa2bfdb9ed7630cf50547cb9732fb29280
2017-09-19 08:09:45 +00:00
Charles He
9cc7575ad8 Merge changes from topic "always-on-vpn"
am: 9bab00f0e3

Change-Id: I7391ce7ecab4f8e73912f420d49150ed7210ea6c
2017-09-19 08:01:45 +00:00
Charles He
5ebd6035ec 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
ddcbabb472 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 3da6a1fc82b7e0c7adc88b92e50cceec8173672e)
2017-09-19 07:56:36 +00:00
Charles He
9bab00f0e3 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
49290515c4 Merge "Wakeup packet events: addressing a few comments" am: 8e1f9cba10 am: 857584f17c am: 19625788a1
am: 4e625c6408

Change-Id: I7d57c0f2377f44bcf75e18c80c0306bbfccb9591
2017-09-19 07:42:18 +00:00
Hugo Benichi
4e625c6408 Merge "Wakeup packet events: addressing a few comments" am: 8e1f9cba10 am: 857584f17c
am: 19625788a1

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

Change-Id: I67b2e54d45a39005e2091a46e8b90d8cc75fe079
2017-09-19 07:21:12 +00:00
Hugo Benichi
c7ef8f8bc2 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 97b3983d68)

Change-Id: Ied9d0cec98685e5a91ed2ca2c81ad88d7ae8d751
2017-09-19 16:14:19 +09:00
Hugo Benichi
8e1f9cba10 Merge "Wakeup packet events: addressing a few comments" 2017-09-19 07:12:03 +00:00
Rubin Xu
9eaccb55ab Merge "Fix LinkPropertiesTest.testCompareResult" am: 430d8472b2 am: e77fe1bdae am: 3db86833e6
am: 8c7980846c

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

Change-Id: I72b0ca1b9b50dacb7067eb6ca12ca48a072b5d26
2017-09-19 06:51:07 +00:00