Commit Graph

2286 Commits

Author SHA1 Message Date
Orion Hodson
8593e96983 Merge changes from topic "lnh-platform-split"
* changes:
  Sync with libnativehelper refactoring
  Update to use nativehelper/JNIPlatformHelp.h
2020-06-24 06:18:23 +00:00
Orion Hodson
e7e3e3ea8f Update to use nativehelper/JNIPlatformHelp.h
Reflects refactoring of JNI helper code that depends on private
methods within libnativehelper.

Bug: 151443957
Test: Treehugger
Change-Id: I7af128f42ae89a77a8e3fb113ea533331153c535
2020-06-23 11:50:20 +01:00
Remi NGUYEN VAN
65dea3da72 Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev am: af3d08be80 am: edadfcfae1 am: d1819c064d am: 7a676a8e0f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11846903

Change-Id: I9791fe78ecbe5c91f00225c13db7f9ed9f5823d4
2020-06-19 01:57:56 +00:00
Remi NGUYEN VAN
edadfcfae1 Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev am: af3d08be80
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11846903

Change-Id: Icd141a992c46290c74929785e261a1cd57bc001b
2020-06-19 01:08:48 +00:00
Remi NGUYEN VAN
af3d08be80 Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev 2020-06-19 00:49:29 +00:00
Lorenzo Colitti
347d6af913 Merge "Move DnsPacket to libs net" into rvc-dev am: 271db73395 am: 0c1f0247d5 am: 7d7a284f4e am: 5f2298dc9e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862407

Change-Id: Ida1e72cf4d56b175ba2121fd8ed06b3701aad770
2020-06-18 11:23:50 +00:00
Lorenzo Colitti
0c1f0247d5 Merge "Move DnsPacket to libs net" into rvc-dev am: 271db73395
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862407

Change-Id: Ia19cb44ad56e4358c63564261d481459d1386542
2020-06-18 10:34:11 +00:00
Lorenzo Colitti
271db73395 Merge "Move DnsPacket to libs net" into rvc-dev 2020-06-18 10:14:47 +00:00
Luke Huang
8baac073d8 Move DnsPacket to libs net
This class might be used by some mainline modules.

Bug: 151052811
Test: atest DnsPacketTest
Test: atest DnsResolverTest
Change-Id: I8841d91456952ded5efbf8ea221289aecc7746ad
2020-06-18 16:17:04 +08:00
Luke Huang
269b04fff3 Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: aef7a1fd4b am: a3b69be395 am: bcc15949cc am: c05abf503a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881939

Change-Id: I945b061484a7a2da22043103b7102e16fceff930
2020-06-18 04:24:37 +00:00
Luke Huang
a3b69be395 Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: aef7a1fd4b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881939

Change-Id: I7c285a848ac947e0acf1acc8bc32f3ece3456412
2020-06-18 03:23:46 +00:00
Luke Huang
aef7a1fd4b Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev 2020-06-18 03:03:06 +00:00
Luke Huang
4b667b529a Disable sockets and DNS if process lacks INTERNET permission.
This is a Client-only solution.
  - Add to NetdClient a per-process std::atomic_boolean
    similar to netIdForProcess and netIdForResolv.
  - The boolean says whether the process should be
    allowed Internet connectivity.
  - Add an @hide method to NetUtils.java to set the boolean;
    call it from the initialization code of the new
    process just after forking from zygote.
  - Make netdClientSocket and dnsOpenProxy check the
    boolean. If the boolean is false, return EPERM from
    socket calls.

Bug: 150028556
Test: atest NetworkUtilsTest
Test: atest CtsAppSecurityHostTestCases:UseProcessTest
Change-Id: If002280fbad493dfc2db3d9d505c0257d49a9056
Exempt-From-Owner-Approval: OWNERS already approved identical patchset 5
2020-06-18 03:02:06 +00:00
TreeHugger Robot
11b31c573f Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev 2020-06-17 15:26:22 +00:00
Treehugger Robot
f0e03b8faf Merge "Treat RouteInfo with different interfaces as different routes" am: 6d4e2d5ec3 am: a89e9a29a3 am: 674c632fdd am: 0416da6d7b am: a54a1bfe87
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1331916

Change-Id: I55b19b73a6c86e3610524f4064f09c95a576916f
2020-06-17 14:00:17 +00:00
Treehugger Robot
ebf6ab4c34 Treat RouteInfo with different interfaces as different routes
On Android different interfaces usually use different routing tables.
As a result, a change in interface should not be treated as route
update, but rather a remove and an add.

This change fixes a bug in VPN seamless handover where routes
failed to be updated when a new tunnel interface replaces the existing
one within the same network.

Bug: 158696878
Test: atest com.android.cts.net.HostsideVpnTests
Test: atest NetworkStackTests
Test: atest CtsNetTestCases
Test: atest FrameworksNetTests
Original-Change: https://android-review.googlesource.com/1331916
Merged-In: I57987233d42a0253eaee2e1ca5f28728c2354620
Change-Id: I57987233d42a0253eaee2e1ca5f28728c2354620
2020-06-17 13:34:11 +00:00
Treehugger Robot
674c632fdd Merge "Treat RouteInfo with different interfaces as different routes" am: 6d4e2d5ec3 am: a89e9a29a3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1331916

Change-Id: I2f4d88aa74588e8ed27c5d0abcb9a6919f26f27d
2020-06-17 13:21:06 +00:00
Treehugger Robot
6d4e2d5ec3 Merge "Treat RouteInfo with different interfaces as different routes" 2020-06-17 12:51:08 +00:00
Rubin Xu
ad524dec0b Treat RouteInfo with different interfaces as different routes
On Android different interfaces usually use different routing tables.
As a result, a change in interface should not be treated as route
update, but rather a remove and an add.

This change fixes a bug in VPN seamless handover where routes
failed to be updated when a new tunnel interface replaces the existing
one within the same network.

Bug: 158696878
Test: atest com.android.cts.net.HostsideVpnTests
Test: atest NetworkStackTests
Test: atest CtsNetTestCases
Test: atest FrameworksNetTests
Change-Id: I57987233d42a0253eaee2e1ca5f28728c2354620
2020-06-17 12:01:41 +01:00
Benedict Wong
532a94a4fe Set correct owner UID for VPN agentConnect()
This commit changes agentConnect to set the owner UID as the mOwnerUid
field instead of the Binder.getCallingUid().

Binder.getCallingUid() can return incorrect results for platform VPNs,
as agentConnect() is called under a clean calling UID.

Additionally, this relaxes the ownerUid sanitization check to allow a
VPN network's owner to see it's own ownership information.

Vpn.mOwnerUid is guaranteed to be correct, as all VPNs MUST have called
prepareInternal() at some previous point, which sets mOwnerUid as the
package's UID (or SYSTEM_UID if this is legacy VPN).

Bug: 150135470
Test: CTS tests showing ownership information
Merged-In: Ic979dad73983d722365849fbfb0becfd432b894c
Change-Id: Ic979dad73983d722365849fbfb0becfd432b894c
(cherry picked from commit 5da3e20cfb)
2020-06-16 01:42:48 +00:00
Benedict Wong
5da3e20cfb Merge "Set correct owner UID for VPN agentConnect()" am: 08447ffcc0 am: bc6da9922c am: e980440591 am: 26d802f1ec am: 6c003e8896
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1326493

Change-Id: Ib473ec592210bc7f7f8ee86ef0f9b10e7f45e0a4
2020-06-15 17:54:29 +00:00
Benedict Wong
e980440591 Merge "Set correct owner UID for VPN agentConnect()" am: 08447ffcc0 am: bc6da9922c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1326493

Change-Id: I5ff673d97fe4558da77575b2cc8c43b87e3673f6
2020-06-15 17:33:33 +00:00
Benedict Wong
08447ffcc0 Merge "Set correct owner UID for VPN agentConnect()" 2020-06-15 17:09:46 +00:00
Remi NGUYEN VAN
68bdb5ac9e Move Inet[4]AddressUtils to libs/net
The classes should not be picked up from frameworks/base, as they are
part of several mainline modules.

Also refine comments in DhcpResults following feedback in previous
change.

Bug: 151052811
Test: m; manual: flashed, wifi and telephony working
Test: atest NetworkStackCoverageTests
Change-Id: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f
2020-06-12 17:04:06 +09:00
Chalard Jean
f980a6cabb Document the limitation to a hundred callbacks.
Some developers have been surprised by this limitation and had trouble
figuring out what the issue was. Add documentation to address this.

This also includes a drive-by removal of a duplicate check.

Bug: 149867479
Test: doc-only change
Original-Change: https://android-review.googlesource.com/1313813
Merged-In: I5911d01984695550b6c9afe7a8eb535bf5e320a1
Change-Id: I5911d01984695550b6c9afe7a8eb535bf5e320a1
2020-06-12 00:35:39 +00:00
Chalard Jean
04ab388705 Merge "Document the limitation to a hundred callbacks." am: 665d54db52 am: 1baaf76e55 am: 8534af7ed5 am: 06ee0240a7 am: ca741d1383
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1313813

Change-Id: Ib2be38ce56ad3097ad1a54f320b73f44c075bbc7
2020-06-11 13:52:48 +00:00
markchien
958263cad9 Cleanup config_mobile_hotspot_provision_app usage
config_mobile_hotspot_provision_app would be move out of framework and
only private for tethering only.
enforceTetherChangePermission is no longer needed because its only
caller PanService already gate by other privileged permission
(BLUETOOTH_PRIVILEGED).

Bug: 146918263
Test: m

Change-Id: I030871c2bc46bc09c4e52970b4995f98d31bb90e
Merged-In: I030871c2bc46bc09c4e52970b4995f98d31bb90e
2020-06-11 13:32:12 +00:00
Chalard Jean
8534af7ed5 Merge "Document the limitation to a hundred callbacks." am: 665d54db52 am: 1baaf76e55
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1313813

Change-Id: I84b1e39503feddc914b61d4e8bd35953e92ac270
2020-06-11 13:03:37 +00:00
Chalard Jean
665d54db52 Merge "Document the limitation to a hundred callbacks." 2020-06-11 12:31:09 +00:00
Chalard Jean
7f06b34acd Document the limitation to a hundred callbacks.
Some developers have been surprised by this limitation and had trouble
figuring out what the issue was. Add documentation to address this.

This also includes a drive-by removal of a duplicate check.

Bug: 149867479
Test: doc-only change
Change-Id: I5911d01984695550b6c9afe7a8eb535bf5e320a1
2020-06-11 12:30:21 +00:00
Mark Chien
8041e34fca Merge "Cleanup config_mobile_hotspot_provision_app usage" am: 443092b9a8 am: 4c645dd681 am: ba41c9cef1 am: e80f74f29e am: 2275fe925f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1329014

Change-Id: I5af592774f51ddb97b6c926b54ad93b70b7c6836
2020-06-11 08:56:01 +00:00
Mark Chien
ba41c9cef1 Merge "Cleanup config_mobile_hotspot_provision_app usage" am: 443092b9a8 am: 4c645dd681
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1329014

Change-Id: Ib3bb0129419ffd55df6c2c53cce3ad7e9155e854
2020-06-11 08:03:56 +00:00
markchien
11f729b0b5 Cleanup config_mobile_hotspot_provision_app usage
config_mobile_hotspot_provision_app would be move out of framework and
only private for tethering only.
enforceTetherChangePermission is no longer needed because its only
caller PanService already gate by other privileged permission
(BLUETOOTH_PRIVILEGED).

Bug: 146918263
Test: m

Change-Id: I030871c2bc46bc09c4e52970b4995f98d31bb90e
2020-06-10 15:52:24 +00:00
Lorenzo Colitti
9d6f1bf413 Merge "Update extra info before registering" into rvc-dev 2020-06-10 15:17:38 +00:00
Benedict Wong
e3bcbc0ec7 Set correct owner UID for VPN agentConnect()
This commit changes agentConnect to set the owner UID as the mOwnerUid
field instead of the Binder.getCallingUid().

Binder.getCallingUid() can return incorrect results for platform VPNs,
as agentConnect() is called under a clean calling UID.

Additionally, this relaxes the ownerUid sanitization check to allow a
VPN network's owner to see it's own ownership information.

Vpn.mOwnerUid is guaranteed to be correct, as all VPNs MUST have called
prepareInternal() at some previous point, which sets mOwnerUid as the
package's UID (or SYSTEM_UID if this is legacy VPN).

Bug: 150135470
Test: CTS tests showing ownership information
Change-Id: Ic979dad73983d722365849fbfb0becfd432b894c
2020-06-08 14:33:01 -07:00
Treehugger Robot
411bb6eb27 Update javadoc to use complete sentence
Avoid using the "iff" abbreviation in our Javadoc.

Bug: 158092978
Test: m doc-comment-check-docs and check the generated doc
Merged-In: I41bf8a6ddad200f00524d9b2dd1bf169810ee460
Change-Id: I41bf8a6ddad200f00524d9b2dd1bf169810ee460
2020-06-05 04:50:14 +00:00
Treehugger Robot
8e8051973c Merge "Update javadoc to use complete sentence" am: 1b33b21814 am: 43299a816e am: 1e926eff19 am: e1d18a0e54 am: f9852aea4e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1323953

Change-Id: I558108a3b7f0d33436ee1dbaf6efa9a0ed0a8096
2020-06-05 03:49:26 +00:00
Treehugger Robot
1e926eff19 Merge "Update javadoc to use complete sentence" am: 1b33b21814 am: 43299a816e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1323953

Change-Id: I357ae71b7f86ed3560333a67a2444eb8bb93c71c
2020-06-05 03:36:44 +00:00
Treehugger Robot
1b33b21814 Merge "Update javadoc to use complete sentence" 2020-06-05 03:02:36 +00:00
Chiachang Wang
d4f8954b27 Update extra info before registering
The extra info is taken into NetworkMonitor from while creating
it. The NetworkMonitor is created when a new agent is registered
but the extra info is not available at that time. Make sure the
field is set in the NetworkInfo when registering.

Bug: 156173829
Test: adb shell dumpsys network and check the apn in the extra
      info shown correctly
Test: atest FrameworkNetTests
Merged-In: Ieaad8cbf1a28af3b97c7f98f74358e417fcad661
Change-Id: Ieaad8cbf1a28af3b97c7f98f74358e417fcad661
2020-06-05 01:46:06 +00:00
Chiachang Wang
80d8b90c49 Merge "Update extra info before registering" am: 004dde17a5 am: 74c9a25719 am: 9e01256b2d am: 5d5f7c80da am: 53c2132bbf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1310538

Change-Id: Idade27520bfda8ca33142c6d2825a504c9cccead
2020-06-05 01:23:59 +00:00
Chiachang Wang
9e01256b2d Merge "Update extra info before registering" am: 004dde17a5 am: 74c9a25719
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1310538

Change-Id: I5e38601026c1f9d30fee58a40bfb1ad467f41e35
2020-06-05 00:41:42 +00:00
Chiachang Wang
d24c4d2f15 Update javadoc to use complete sentence
Avoid using the "iff" abbreviation in our Javadoc.

Bug: 158092978
Test: m doc-comment-check-docs and check the generated doc
Change-Id: I41bf8a6ddad200f00524d9b2dd1bf169810ee460
2020-06-04 07:46:14 +00:00
Chiachang Wang
c9d788a50c Update extra info before registering
The extra info is taken into NetworkMonitor from while creating
it. The NetworkMonitor is created when a new agent is registered
but the extra info is not available at that time. Make sure the
field is set in the NetworkInfo when registering.

Bug: 156173829
Test: adb shell dumpsys network and check the apn in the extra
      info shown correctly
Test: atest FrameworkNetTests
Change-Id: Ieaad8cbf1a28af3b97c7f98f74358e417fcad661
2020-06-03 13:01:01 +08:00
Remi NGUYEN VAN
43b3337094 Allow TRANSPORT_TEST ethernet networks
Ethernet networks using tap interfaces should have TRANSPORT_TEST so
they are not considered by network selection.

Test: atest CaptivePortalApiTest FrameworksNetTests
Bug: 156319532
Original-Change: https://android-review.googlesource.com/1317238
Merged-In: I0d9477977c88aa055625ab4046577a41e76b05ff
Change-Id: I0d9477977c88aa055625ab4046577a41e76b05ff
2020-06-01 01:43:32 +00:00
Luke Huang
cc4ced860a Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS
NETID_USE_LOCAL_NAMESERVERS is no longer in libnetd_client

Bug: 151895202
Test: build
Change-Id: Iea0c2488dcabdd24d6ffca8134cd11ed12e8308a
Merged-In: Iea0c2488dcabdd24d6ffca8134cd11ed12e8308a
2020-05-30 19:04:44 -07:00
Remi NGUYEN VAN
86c2627df9 Merge "Allow TRANSPORT_TEST ethernet networks" am: c45abad7fd am: 8d78387b3b am: b3ca3af496 am: d6fdfade8c am: a3a7b861cf
Change-Id: I50848798264f3b7a0605525c877471d4aab2aeb5
2020-05-29 22:57:05 +00:00
Remi NGUYEN VAN
b3ca3af496 Merge "Allow TRANSPORT_TEST ethernet networks" am: c45abad7fd am: 8d78387b3b
Change-Id: I030f0aeb0f196fee213fee02a25c5a7e66618b93
2020-05-29 22:09:13 +00:00
TreeHugger Robot
bf5afa78b5 Merge "Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS" into rvc-dev am: 3abae6da06 am: c029e74145 am: b64de67a32 am: 39924665f9
Change-Id: I5ad15218e901634c7f6c84abb528eea12daa5e82
2020-05-29 14:49:18 +00:00
TreeHugger Robot
b64de67a32 Merge "Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS" into rvc-dev am: 3abae6da06 am: c029e74145
Change-Id: If7e0be35ad58b0d4c6a5436a4d6bdd2c7c490ef6
2020-05-29 14:19:49 +00:00