Commit Graph

5145 Commits

Author SHA1 Message Date
Jeffrey Vander Stoep
01baa06afe Merge "Add ConnectivityManager.getConnectionOwnerUid()" am: f8529dc891
am: 0c334f2581

Change-Id: I4ec4b9a8954deec001841566e0722caa1a3fa248
2018-09-21 14:48:32 -07:00
Jeffrey Vander Stoep
0c334f2581 Merge "Add ConnectivityManager.getConnectionOwnerUid()"
am: f8529dc891

Change-Id: Ib575a2a03c332d0143ed15652cc9c08c9cff694f
2018-09-21 14:26:19 -07:00
Jeff Vander Stoep
e7205d6853 Add ConnectivityManager.getConnectionOwnerUid()
Allow VPN apps to lookup the UID owner of a network connection.

Requires specifying the:
 - IP address and port for both the source and destination of a TCP
   connection.
 - IP address and port for either source and destination or just
   source for a UDP connection.
Only TCP and UDP protocols are supported. Only connections for UIDs
that apply to the calling VPN app will be resolved. This is intended
to replace direct app access to /proc/net/{tcp,tcp6,udp,udp6}.

The implementation uses netlink inet_diag sockets[1] to perform
the lookup on TCP sockets as well as UDP sockets when supported
(kernel has CONFIG_INET_UDP_DIAG=y).

[1] http://man7.org/linux/man-pages/man7/sock_diag.7.html

Bug: 9496886
Bug: 109758967
Test: atest HostsideVpnTests
Test: atest InetDiagSocketTest on Taimen with CONFIG_INET_UDP_DIAG
    and on Sailfish without CONFIG_INET_UDP_DIAG.
Change-Id: I2bbc7072dd091e2e653dadf6dc05024c04180f34
2018-09-21 06:16:09 +00:00
Shaotang Li
830deda9d0 Merge changes into stage-aosp-master
am: 42367b7fb9

Change-Id: I46d9e80464652ac98c7b745686aaa490d57a8ab0
2018-09-13 00:56:38 -07:00
Shaotang Li
8d9c87dd69 Merge changes into stage-aosp-master
am: 771d829443

Change-Id: I6fa8268060713303c3d999fec0fd91aa78849872
2018-09-13 00:52:20 -07:00
Android Build Merger (Role)
42367b7fb9 Merge changes into stage-aosp-master 2018-09-13 07:27:15 +00:00
Android Build Merger (Role)
771d829443 Merge changes into stage-aosp-master 2018-09-13 07:27:15 +00:00
Benedict Wong
772d488fc8 Merge "Use UID as requestID" am: d173d03cbb
am: c48d763dfd

Change-Id: I0d9fb770482e72f3b017702ffb7ec144a64462e0
2018-09-12 15:22:39 -07:00
Benedict Wong
c48d763dfd Merge "Use UID as requestID"
am: d173d03cbb

Change-Id: Icef3693f5911c8f69076e0990392e28c693cbc22
2018-09-12 14:35:27 -07:00
Benedict Wong
d173d03cbb Merge "Use UID as requestID" 2018-09-12 18:51:33 +00:00
Andreas Gampe
3deed549c4 Merge changes into stage-aosp-master
am: 729da5e7fb

Change-Id: If60b6361f323c651510900344d75ce5fa7db17c3
2018-09-10 16:01:58 -07:00
Andreas Gampe
9d4b89039a Merge changes into stage-aosp-master
am: 92c173ee56

Change-Id: I4e707c0172a858db97d903ad79dadb37c7a910a7
2018-09-10 15:58:08 -07:00
Android Build Merger (Role)
729da5e7fb Merge changes into stage-aosp-master 2018-09-10 22:43:03 +00:00
Android Build Merger (Role)
92c173ee56 Merge changes into stage-aosp-master 2018-09-10 22:43:03 +00:00
Hugo Benichi
8ae86fb501 Merge changes Ie28e6c80,I3cb9b2ce am: 706067c79a
am: 48266ce186

Change-Id: I550b2dd325dba38513eabb3ae8c94c2787fbbf70
2018-09-04 23:24:07 -07:00
Hugo Benichi
48266ce186 Merge changes Ie28e6c80,I3cb9b2ce
am: 706067c79a

Change-Id: I7e910aaed571c3c37fd4a5ba4d5a0eeb5f52c8bd
2018-09-04 23:15:54 -07:00
Hugo Benichi
706067c79a Merge changes Ie28e6c80,I3cb9b2ce
* changes:
  ConnectivityService: dumpsys args for dumping networks or requests only.
  ConnectivityService: Sort requests and networks in dumpsys.
2018-09-05 05:54:24 +00:00
Hugo Benichi
f93f448014 ConnectivityService: dumpsys args for dumping networks or requests only.
This patch adds two arguments to ConnectivityService dumpsys handler so
that only current networks or only current requests are dumped:

- "adb shell dumpsys connectivity networks" will dump current networks.
- "adb shell dumpsys connectivity requests" will dump current requests.

Bug: none
Test: Compiled, flashed, booted, checked that both new dumpsys args work
      as expected.

Change-Id: Ie28e6c800795eb49f386b609e8222a25e73dfc84
2018-09-05 13:04:12 +09:00
Hugo Benichi
821785c9f3 ConnectivityService: Sort requests and networks in dumpsys.
This patch adds two utility functions for sorting requests and networks
tracked by ConnectivityService by request id and network id
respectively.

These utility functions are then used to improve the output of
adb shell dumpsys connectivity so that networks and requests are
printed in a more stable fashion.

Bug: none
Test: Compiled, flashed, booted, checked output of adb shell
      dumpsys connectivity.

Change-Id: I3cb9b2ceab64145611a416dcb8c5d512838a2626
2018-09-05 13:03:55 +09:00
Benedict Wong
0ae911bbdd Use UID as requestID
This change makes all requestIDs use the UID of the creator, ensuring
that rekeys always use the same requestID. This also has the nice
property of separating app's resources from each other, and allowing for
identification of which app/UID allocated the resources from
command-line dumps (eg ip xfrm state show)

Bug: 111841561
Test: Updated tests & passing taimen
Change-Id: I4f1eadcdb795766ae4682b15e41727359c52fa38
2018-09-04 14:25:13 -07:00
Paul Hu
cef120f799 Merge "PermissionMonitor: Limit preinstalled apps network permissions" am: 0fbe8ae1ef
am: bb3f5edfbe

Change-Id: I1478c932bf612fd4546c4178fc8f4a0bededf127
2018-09-03 02:41:26 -07:00
Paul Hu
bb3f5edfbe Merge "PermissionMonitor: Limit preinstalled apps network permissions"
am: 0fbe8ae1ef

Change-Id: I173026e41ed11fa5f4c679a5759b55213e21b596
2018-09-03 02:30:12 -07:00
Paul Hu
0fbe8ae1ef Merge "PermissionMonitor: Limit preinstalled apps network permissions" 2018-09-03 09:16:52 +00:00
paulhu
52973c0608 PermissionMonitor: Limit preinstalled apps network permissions
Not all preinstalled apps should have access to background
networks or restricted networks. But we give them all network
access permissions currently, it's not a good design. So we
shall limit preinstalled apps permissions, they should just
request the appropriate permission for their use case from
the network permissions.

Bug:19610688
Test: runtest frameworks-net
Change-Id: I184ae3197208c979847ca134c8f01b32528badf1
2018-08-29 13:49:33 +08:00
Erik Kline
4ac0d1bd23 Merge "Remove ResolveUtil from frameworks/base callers" am: 0e1621296f
am: c59cbe8565

Change-Id: I3199337fd168f58f13a547d4eaff2be069a22f3d
2018-08-28 20:21:50 -07:00
Erik Kline
c59cbe8565 Merge "Remove ResolveUtil from frameworks/base callers"
am: 0e1621296f

Change-Id: Ibc885ccd9531706df029154f7ec4fde71bf600d1
2018-08-28 20:12:49 -07:00
Erik Kline
f2420790ac Remove ResolveUtil from frameworks/base callers
Use the Private DNS bypass logic that was moved into Network.

Once all callers of ResolvUtil are updated to use this interface
ResolvUtil can be deleted.

Test: as follows
    - built, flashed, booted
    - runtest frameworks-net passes
    - connection to captive portal network detects portal correctly
      and the login activity functions as expected

Bug: 64133961
Bug: 72345192
Bug: 73872000
Bug: 78548486

Change-Id: If11ef2b5ffdc729f8449cf18dccd5f1eccbc51e6
2018-08-28 12:59:21 +09:00
Blake Lawson
3034e8c321 Merge "Fix typo in IpConfiguration comment" am: 502e5b1aa2
am: 984d4edfa4

Change-Id: I0871973d37267215fc31455015a37e6a8a60d821
2018-08-23 21:17:32 -07:00
Blake Lawson
984d4edfa4 Merge "Fix typo in IpConfiguration comment"
am: 502e5b1aa2

Change-Id: Ife540b3bda671dcb8016dae86f221a62063bd464
2018-08-23 21:08:12 -07:00
Treehugger Robot
502e5b1aa2 Merge "Fix typo in IpConfiguration comment" 2018-08-24 03:43:38 +00:00
Remi NGUYEN VAN
20d256cae5 Merge changes I2cea553a,Id8d3dcf6,I19e68e88,I35598935,Idd7dc369, ... am: e01b4ce6c7
am: 173c851f66

Change-Id: If4f9e1b498855af05011cbd0f529e346bebd4cbd
2018-08-23 20:42:23 -07:00
Remi NGUYEN VAN
173c851f66 Merge changes I2cea553a,Id8d3dcf6,I19e68e88,I35598935,Idd7dc369, ...
am: e01b4ce6c7

Change-Id: I1800eb214d501e76b8705a27ca817000d009736e
2018-08-23 20:33:45 -07:00
Blake Lawson
f134e62f73 Fix typo in IpConfiguration comment
Bug: NONE
Test: NONE
Change-Id: Ib2ce166532292266da17ec85c16e400afe4f9111
2018-08-23 08:43:07 -07:00
Remi NGUYEN VAN
041ac7ed06 Add DhcpServingParams
Those parameters will be used to start DhcpServer or update its
configuration.

Test: runtest DhcpServingParamsTest.java
Bug: b/109584964
Change-Id: Id8d3dcf62d66dcb02accffa8d8500e30f07af452
2018-08-23 17:29:48 +09:00
Remi NGUYEN VAN
eb03f35534 Add util to add an ARP table entry
This is to be used by the new DhcpServer to add ARP entries with new
addresses before sending unicast responses.

Test: manual: cat /proc/net/arp with implementation based on this
Bug: b/109584964
Change-Id: I3559893583aa3c49b188ad689a41ee2f3e9d9bf3
2018-08-23 16:01:44 +09:00
Remi NGUYEN VAN
f58b010d19 Merge "Fix testRegisterUsageCallback failure in setUp" am: e873a53af1
am: c581541255

Change-Id: I5723e356d1b6aa1a71ba693598a5796900fd9ddc
2018-08-17 02:02:08 -07:00
Remi NGUYEN VAN
c581541255 Merge "Fix testRegisterUsageCallback failure in setUp"
am: e873a53af1

Change-Id: I516bab9b9b6c5f48845f18d0e2ab8b47f0f809de
2018-08-17 01:48:48 -07:00
Remi NGUYEN VAN
e873a53af1 Merge "Fix testRegisterUsageCallback failure in setUp" 2018-08-17 01:51:10 +00:00
Mathew Inwood
5c6db5d1af Merge "Add @UnsupportedAppUsage annotations" am: d717c04b12
am: 39c31ebfb2

Change-Id: I99215dd5430968df2e2dd514d21b396b00c1403e
2018-08-16 03:29:58 -07:00
Mathew Inwood
39c31ebfb2 Merge "Add @UnsupportedAppUsage annotations"
am: d717c04b12

Change-Id: I8f8c9106b494caa6dc5ad405111f2a285a01e49f
2018-08-15 10:12:01 -07:00
Mathew Inwood
0b8f861d07 Add @UnsupportedAppUsage annotations
For packages:
  android.net.wimax
  android.net.wifi.p2p.nsd
  android.net.wifi.p2p
  android.net.wifi.hotspot2.pps
  android.net.wifi.hotspot2.omadm
  android.net.wifi.hotspot2
  android.net.wifi.aware
  android.net.wifi
  android.net.util
  android.net.sip
  android.net.rtp
  android.net.nsd
  android.net.metrics
  android.net.lowpan
  android.net.http
  android.net.captiveportal
  android.net

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: Ie25423113ee1a8071cd5039382c00de6ce0af7fd
Merged-In: I520be7a4c79e68310c12e4f55bf66acaa94145a1
2018-08-14 14:44:29 +01:00
Remi NGUYEN VAN
6e025c05fe Fix testRegisterUsageCallback failure in setUp
LocalServices.addService in NetworkStatsService is currently failing
with IllegalStateException "Overriding service registration". Setting up
LocalServices in the test to avoid this issue might be possible, but
moving the registration to the only non-test caller of that constructor
as done here solves the issue and avoids side-effects from a constructor.

Test: atest FrameworksNetTests does not choke on this test
Bug: b/78487385
Bug: b/80082746
Change-Id: I5dba98fc79aec0800c8b71e6c7e23d1cfbcae852
Merged-In: I884a7a8bd7db3fcd220b785ba9914ac8c77720f0
(Clean cherry-pick of go/ag/4061255)
2018-08-14 18:14:09 +09:00
Xin Li
8040e85f20 Merge stage-dr1-aosp-master into stage-aosp-master
am: 19b7fb054c

Change-Id: I435e644305d986d3d359f7e97086637d00c50b6c
2018-08-13 17:21:33 -07:00
Roshan Pius
71d14b08b2 Merge "NetworkAgent: Send primitive integer in explicitlySelected" am: e6d745c6f8
am: 50a9fc9189

Change-Id: I5c00ed2031433b1176e41a1c01fd80b90fe0d27c
2018-08-13 15:37:07 -07:00
Xin Li
19b7fb054c Merge stage-dr1-aosp-master into stage-aosp-master
Bug: 112535855
Change-Id: I1ba00379ca307f44a6430e516b474983e4c1dd32
2018-08-13 13:01:08 -07:00
Treehugger Robot
e6d745c6f8 Merge "NetworkAgent: Send primitive integer in explicitlySelected" 2018-08-13 17:09:51 +00:00
Roshan Pius
98a4564880 Merge "NetworkAgent: Send primitive integer in score" am: 96da30f094 am: c039ad203e
am: f89a482aee

Change-Id: I8ca588bfcee7488c05ff33a2f85beb6aa2299776
2018-08-10 09:17:51 -07:00
Roshan Pius
f89a482aee Merge "NetworkAgent: Send primitive integer in score" am: 96da30f094
am: c039ad203e

Change-Id: I7f6ac7a5fd6ecae4ac077b7f54fe91879a63fa13
2018-08-10 08:54:21 -07:00
Roshan Pius
94f41e9c99 NetworkAgent: Send primitive integer in explicitlySelected
|Boolean| object is not parcelable and hences crashes when the binder call
crosses a process boundary. Using a primitive integer instead to
represent the boolean value.

Bug: 112358948
Test: Device boots up and able to make wifi connection.
Change-Id: Iac69fd302e1f1338ed0da1446105ffc5855451cc
2018-08-10 07:44:33 -07:00
Roshan Pius
96da30f094 Merge "NetworkAgent: Send primitive integer in score" 2018-08-10 14:33:07 +00:00