Commit Graph

5516 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
c4cb0330aa Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev am: 6555756e90 am: deae676127 am: af0fe2e715 am: b232961fb8
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
deae676127 Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev am: 6555756e90
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
6555756e90 Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev 2020-06-19 00:49:29 +00:00
Lorenzo Colitti
30370c23d4 Merge "Move DnsPacket to libs net" into rvc-dev am: db056d4043 am: 7f7e19eda5 am: a9095c04b9 am: ac253d354f
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
7f7e19eda5 Merge "Move DnsPacket to libs net" into rvc-dev am: db056d4043
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
db056d4043 Merge "Move DnsPacket to libs net" into rvc-dev 2020-06-18 10:14:47 +00:00
Luke Huang
c1a52b82c9 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
7c117370e3 Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: 7144459282 am: dae5d3f223 am: d996337c91 am: 4e4f6a89c3
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
dae5d3f223 Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: 7144459282
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
7144459282 Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev 2020-06-18 03:03:06 +00:00
Luke Huang
6f214e8ebe 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
b85fc66146 Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev 2020-06-17 15:26:22 +00:00
Treehugger Robot
6e9eaa35b2 Merge "Treat RouteInfo with different interfaces as different routes" am: 4156ab6937 am: 4c3d479c7d am: 4f52c1aa0d am: b9b3c10631 am: 939ed077fe
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
2f2dab0158 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
4f52c1aa0d Merge "Treat RouteInfo with different interfaces as different routes" am: 4156ab6937 am: 4c3d479c7d
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
4156ab6937 Merge "Treat RouteInfo with different interfaces as different routes" 2020-06-17 12:51:08 +00:00
Rubin Xu
c3dec3448d 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
26d2378f5b 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 e29bf99a7f)
2020-06-16 01:42:48 +00:00
Benedict Wong
e29bf99a7f Merge "Set correct owner UID for VPN agentConnect()" am: 7efd5a48e0 am: 8cabf350b5 am: fe747eaff7 am: 0cf7776f79 am: c8fa229947
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
fe747eaff7 Merge "Set correct owner UID for VPN agentConnect()" am: 7efd5a48e0 am: 8cabf350b5
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
7efd5a48e0 Merge "Set correct owner UID for VPN agentConnect()" 2020-06-15 17:09:46 +00:00
Remi NGUYEN VAN
eee629f4c7 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
081ff7a8f2 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
e02db84717 Merge "Document the limitation to a hundred callbacks." am: 0f3e06a1fa am: 79d15abe06 am: 4e33955a47 am: 1044bfb929 am: f7fd38e623
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1313813

Change-Id: Ib2be38ce56ad3097ad1a54f320b73f44c075bbc7
2020-06-11 13:52:48 +00:00
markchien
d3252e3e61 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
4e33955a47 Merge "Document the limitation to a hundred callbacks." am: 0f3e06a1fa am: 79d15abe06
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
0f3e06a1fa Merge "Document the limitation to a hundred callbacks." 2020-06-11 12:31:09 +00:00
Chalard Jean
c022b0c7ea 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
2d5dc5b274 Merge "Cleanup config_mobile_hotspot_provision_app usage" am: 443092b9a8 am: e0f4e04f5c am: f8bca221ad am: af17ba9493 am: 247e62c051
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
f8bca221ad Merge "Cleanup config_mobile_hotspot_provision_app usage" am: 443092b9a8 am: e0f4e04f5c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1329014

Change-Id: Ib3bb0129419ffd55df6c2c53cce3ad7e9155e854
2020-06-11 08:03:56 +00:00
markchien
a46ba4ea21 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
50440f899e Merge "Update extra info before registering" into rvc-dev 2020-06-10 15:17:38 +00:00
Benedict Wong
212b7e9edb 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
Xin Li
d7785982ac Merge "Merge QQ3A.200605.002 into master" 2020-06-06 01:41:11 +00:00
Treehugger Robot
5f6705f0e4 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
63a29bf916 Merge "Update javadoc to use complete sentence" am: 0be3cacedf am: ea9f9d821e am: e33d6e932a am: ac36e5b0f8 am: 16e7f8bafc
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
e33d6e932a Merge "Update javadoc to use complete sentence" am: 0be3cacedf am: ea9f9d821e
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
ea9f9d821e Merge "Update javadoc to use complete sentence" am: 0be3cacedf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1323953

Change-Id: I6c8358c81bbc7a08802ef027fcd32adea4821ba0
2020-06-05 03:17:00 +00:00
Treehugger Robot
0be3cacedf Merge "Update javadoc to use complete sentence" 2020-06-05 03:02:36 +00:00
Chiachang Wang
be7265d261 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
135fd81fe1 Merge "Update extra info before registering" am: 49d2af3662 am: cb4ec42283 am: 5422d57f59 am: d7e7c7eb55 am: c92d9efb51
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
5422d57f59 Merge "Update extra info before registering" am: 49d2af3662 am: cb4ec42283
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
cb4ec42283 Merge "Update extra info before registering" am: 49d2af3662
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1310538

Change-Id: I6eb786edfe615574c731097df09ae3142e137999
2020-06-05 00:24:09 +00:00
Chiachang Wang
e2732a8916 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
55882575de 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
53be2d08d3 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
Remi NGUYEN VAN
292565078c Merge "Allow TRANSPORT_TEST ethernet networks" am: 8dc6549e05 am: 0acc645912 am: 669fdbeb65 am: c9306c9123 am: b9a076d4bf
Change-Id: I50848798264f3b7a0605525c877471d4aab2aeb5
2020-05-29 22:57:05 +00:00
Remi NGUYEN VAN
669fdbeb65 Merge "Allow TRANSPORT_TEST ethernet networks" am: 8dc6549e05 am: 0acc645912
Change-Id: I030f0aeb0f196fee213fee02a25c5a7e66618b93
2020-05-29 22:09:13 +00:00
Remi NGUYEN VAN
0acc645912 Merge "Allow TRANSPORT_TEST ethernet networks" am: 8dc6549e05
Change-Id: Ib9ab1ddb855c90219e94c4b74dc7268cfbcdb661
2020-05-29 21:43:41 +00:00
Benedict Wong
8be61b3dd9 Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" am: 9d7577537b
Change-Id: I4a135e75105a49b25b65ba76a3c252467bd9d5ea
2020-05-29 21:41:40 +00:00