Commit Graph

10819 Commits

Author SHA1 Message Date
Luke Huang
72be68ef27 Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: bbcd3b326b am: 854adb51eb am: 505650a64f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881939

Change-Id: Icca2ae80d7d669fc5d9d8e3658d81cb1e9e69917
2020-06-18 15:13:27 +00:00
Luke Huang
3ed9592ee0 Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: bbcd3b326b am: 854adb51eb am: e3c9c6bfe0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881939

Change-Id: Ib0234ff767b1bcfe6829037fcf68d8e87031a9ad
2020-06-18 15:12:20 +00:00
Lorenzo Colitti
d7e96fe5ae Merge "Move DnsPacket to libs net" into rvc-dev am: 81f0fe48d2 am: 5409cf46b5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862407

Change-Id: I3f1edfe442f3408a19c9a901fb35bde8ef22950b
2020-06-18 15:02:30 +00:00
Lorenzo Colitti
5409cf46b5 Merge "Move DnsPacket to libs net" into rvc-dev am: 81f0fe48d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862407

Change-Id: I74cac5c415d8b3447b57cda7cba1caa215e84ea2
2020-06-18 14:58:19 +00:00
TreeHugger Robot
d92d22fd67 [automerger skipped] Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev am: 65efcc84a0 am: 9a0218f958 -s ours am: a352edc747 -s ours
am skip reason: Change-Id Ic979dad73983d722365849fbfb0becfd432b894c with SHA-1 b001522433 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11869883

Change-Id: I474985691913c254b8683d375641c7c8319a0729
2020-06-18 14:56:19 +00:00
TreeHugger Robot
b521540559 [automerger skipped] Merge "Treat RouteInfo with different interfaces as different routes" into rvc-dev am: 70e3f56147 am: b3a9f82988 -s ours am: fb2d643937 -s ours
am skip reason: Change-Id I57987233d42a0253eaee2e1ca5f28728c2354620 with SHA-1 58897cc491 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882397

Change-Id: Ie3c180e7085612c892d4494299a53ee84f0f8a02
2020-06-18 14:55:50 +00:00
Luke Huang
505650a64f Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: bbcd3b326b am: 854adb51eb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881939

Change-Id: I6631692e31afe751c89b5647ca51cca288b5b329
2020-06-18 14:46:29 +00:00
Luke Huang
854adb51eb Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: bbcd3b326b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881939

Change-Id: I10202dc784bafa044a04546d0a765370331223dc
2020-06-18 14:46:02 +00:00
TreeHugger Robot
a352edc747 [automerger skipped] Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev am: 65efcc84a0 am: 9a0218f958 -s ours
am skip reason: Change-Id Ic979dad73983d722365849fbfb0becfd432b894c with SHA-1 b001522433 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11869883

Change-Id: I5351565ef7b11ebc95ddb99b60bba34b9793bfaa
2020-06-18 14:38:58 +00:00
TreeHugger Robot
fb2d643937 [automerger skipped] Merge "Treat RouteInfo with different interfaces as different routes" into rvc-dev am: 70e3f56147 am: b3a9f82988 -s ours
am skip reason: Change-Id I57987233d42a0253eaee2e1ca5f28728c2354620 with SHA-1 58897cc491 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882397

Change-Id: Ic398329038eb9e91f6ad9676865448f7317edeef
2020-06-18 14:35:54 +00:00
TreeHugger Robot
9a0218f958 Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev am: 65efcc84a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11869883

Change-Id: I84b0010488024aa9867ad4af7a4013854cdeeaa1
2020-06-18 14:34:45 +00:00
TreeHugger Robot
b3a9f82988 Merge "Treat RouteInfo with different interfaces as different routes" into rvc-dev am: 70e3f56147
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882397

Change-Id: I4c96f81ba9118b545b69eb507333f09ea634bdf8
2020-06-18 14:29:52 +00:00
Aaron Huang
d01848756d Merge "Address comments from aosp/1298476" am: 48fbda02b0 am: 76d4f3513f am: 69b06f9369 am: 0f24079a53
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1340040

Change-Id: I067965de3d884bfe8f2832e5116daadd5bda1ae5
2020-06-18 11:06:40 +00:00
Lorenzo Colitti
c88624f094 Merge "Move DnsPacket to libs net" into rvc-dev am: 81f0fe48d2 am: 1ff1653dbb am: ca72aa0a4f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862407

Change-Id: I15e4f426e47cdc77a1cdccb1501f7e649c9a6bbf
2020-06-18 11:04:23 +00:00
Aaron Huang
0f24079a53 Merge "Address comments from aosp/1298476" am: 48fbda02b0 am: 76d4f3513f am: 69b06f9369
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1340040

Change-Id: I8557b955af2d28122054df5236a38543523909f4
2020-06-18 10:49:25 +00:00
Lorenzo Colitti
ca72aa0a4f Merge "Move DnsPacket to libs net" into rvc-dev am: 81f0fe48d2 am: 1ff1653dbb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862407

Change-Id: I130496147364f798817d7d12e814749e86f0ab0c
2020-06-18 10:47:59 +00:00
Aaron Huang
69b06f9369 Merge "Address comments from aosp/1298476" am: 48fbda02b0 am: 76d4f3513f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1340040

Change-Id: I7b119758ac7cd65defdec77692957287af17566d
2020-06-18 10:47:47 +00:00
Lorenzo Colitti
1ff1653dbb Merge "Move DnsPacket to libs net" into rvc-dev am: 81f0fe48d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862407

Change-Id: Ia19cb44ad56e4358c63564261d481459d1386542
2020-06-18 10:34:11 +00:00
Aaron Huang
76d4f3513f Merge "Address comments from aosp/1298476" am: 48fbda02b0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1340040

Change-Id: I3c7c0ef738b6c6b964dc91c593cbf2b6166e3843
2020-06-18 10:34:10 +00:00
Aaron Huang
48fbda02b0 Merge "Address comments from aosp/1298476" 2020-06-18 10:18:57 +00:00
Lorenzo Colitti
81f0fe48d2 Merge "Move DnsPacket to libs net" into rvc-dev 2020-06-18 10:14:47 +00:00
Luke Huang
51221efa45 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
Aaron Huang
69bfb5afea Address comments from aosp/1298476
This patch addresses the followings,
- Pass Looper to NetworkStatsSubscriptionsMonitor constructor
- Replace Looper with TestLooper in unit test
- Assert fail if result of condition check is not expected.

Bug: 154080205
Test: atest FrameworksNetTests:com.android.server.net.NetworkStatsServiceTest
      atest FrameworksNetTests:com.android.server.net.NetworkStatsSubscriptionsMonitorTest
Change-Id: Ibcaba2b38af80cc0ec9a4e428a3b3a1538bc4325
2020-06-18 15:05:19 +08:00
Aaron Huang
9b08449fa7 Merge "Dynamically enable/disable watch for RAT type changes" am: 3fdad73a32 am: cc1d6b13d6 am: c98228cf54 am: a9a2ee5bfc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1315574

Change-Id: I61d7242d2c597e680953d2603b0b54962dd749b3
2020-06-18 04:40:20 +00:00
Aaron Huang
a9a2ee5bfc Merge "Dynamically enable/disable watch for RAT type changes" am: 3fdad73a32 am: cc1d6b13d6 am: c98228cf54
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1315574

Change-Id: I5e607bb44b2e97c01da9f9dcc0e89687bd08130f
2020-06-18 04:23:10 +00:00
Aaron Huang
c98228cf54 Merge "Dynamically enable/disable watch for RAT type changes" am: 3fdad73a32 am: cc1d6b13d6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1315574

Change-Id: I5a96774ad2104a6b03c9abab2b105b97195edea8
2020-06-18 04:22:21 +00:00
Aaron Huang
cc1d6b13d6 Merge "Dynamically enable/disable watch for RAT type changes" am: 3fdad73a32
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1315574

Change-Id: Id5c4ad325779322bbf4881816235904a6d454583
2020-06-18 04:09:37 +00:00
Luke Huang
0d07b1db37 Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: bbcd3b326b am: f12eff79db am: 7d09ef6560
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881939

Change-Id: Ib9375a24b742cfb3e40be5c5d540c5c0ceb0be9f
2020-06-18 04:09:31 +00:00
Aaron Huang
3fdad73a32 Merge "Dynamically enable/disable watch for RAT type changes" 2020-06-18 03:51:51 +00:00
Luke Huang
7d09ef6560 Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: bbcd3b326b am: f12eff79db
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881939

Change-Id: Ieeaab8035f6055b93a03abe7451f3ba496bd2285
2020-06-18 03:49:34 +00:00
Luke Huang
f12eff79db Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: bbcd3b326b
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
bbcd3b326b Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev 2020-06-18 03:03:06 +00:00
Luke Huang
5a42a4132f 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
639e3465be [automerger skipped] Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev am: 65efcc84a0 -s ours am: 3f7a4b9254 -s ours am: eeaa1490e4 -s ours
am skip reason: Change-Id Ic979dad73983d722365849fbfb0becfd432b894c with SHA-1 bf004e9830 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11869883

Change-Id: I03b086429c8a1095ad6effe421b3256492a127d4
2020-06-17 16:07:08 +00:00
TreeHugger Robot
736170e6a0 [automerger skipped] Merge "Treat RouteInfo with different interfaces as different routes" into rvc-dev am: 70e3f56147 -s ours am: 49d46b6c1f -s ours am: f5e7b367d5 -s ours
am skip reason: Change-Id I57987233d42a0253eaee2e1ca5f28728c2354620 with SHA-1 bc4c5caa4f is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882397

Change-Id: Ib7e4c77b068f28db64be4aa867c8bfefbeeb007b
2020-06-17 16:04:52 +00:00
TreeHugger Robot
eeaa1490e4 [automerger skipped] Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev am: 65efcc84a0 -s ours am: 3f7a4b9254 -s ours
am skip reason: Change-Id Ic979dad73983d722365849fbfb0becfd432b894c with SHA-1 bf004e9830 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11869883

Change-Id: Idd7465eef4ae2cd482f6fe70ca3bee0c3260e74b
2020-06-17 15:48:44 +00:00
TreeHugger Robot
f5e7b367d5 [automerger skipped] Merge "Treat RouteInfo with different interfaces as different routes" into rvc-dev am: 70e3f56147 -s ours am: 49d46b6c1f -s ours
am skip reason: Change-Id I57987233d42a0253eaee2e1ca5f28728c2354620 with SHA-1 bc4c5caa4f is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882397

Change-Id: I35e9898e25ff2b74c3876f0a19ce8dd6b6514011
2020-06-17 15:47:56 +00:00
TreeHugger Robot
3f7a4b9254 [automerger skipped] Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev am: 65efcc84a0 -s ours
am skip reason: Change-Id Ic979dad73983d722365849fbfb0becfd432b894c with SHA-1 bf004e9830 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11869883

Change-Id: I7df1004e885ff680a48d57e41987eb12f990875c
2020-06-17 15:35:35 +00:00
TreeHugger Robot
49d46b6c1f [automerger skipped] Merge "Treat RouteInfo with different interfaces as different routes" into rvc-dev am: 70e3f56147 -s ours
am skip reason: Change-Id I57987233d42a0253eaee2e1ca5f28728c2354620 with SHA-1 bc4c5caa4f is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882397

Change-Id: I0b5d3d42ac9310e71262a7e8cf21af51b75837c4
2020-06-17 15:34:30 +00:00
TreeHugger Robot
65efcc84a0 Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev 2020-06-17 15:26:22 +00:00
Treehugger Robot
90684d4db0 Merge "Treat RouteInfo with different interfaces as different routes" am: d77e15c125 am: 157191f50f am: 7a49a3b538 am: 0e21a83d94
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1331916

Change-Id: Idbf543c750fbfc634eb68fa3ff2a0f497521c2d9
2020-06-17 13:45:07 +00:00
Treehugger Robot
58897cc491 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
0e21a83d94 Merge "Treat RouteInfo with different interfaces as different routes" am: d77e15c125 am: 157191f50f am: 7a49a3b538
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1331916

Change-Id: Ia1d52507ad6d04586b9d1df3fc182982639d1218
2020-06-17 13:32:51 +00:00
Treehugger Robot
7a49a3b538 Merge "Treat RouteInfo with different interfaces as different routes" am: d77e15c125 am: 157191f50f
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
157191f50f Merge "Treat RouteInfo with different interfaces as different routes" am: d77e15c125
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1331916

Change-Id: Ibe919ea7c2096094fdb48fc91881d9f19678ac50
2020-06-17 13:07:42 +00:00
Treehugger Robot
d77e15c125 Merge "Treat RouteInfo with different interfaces as different routes" 2020-06-17 12:51:08 +00:00
Rubin Xu
bc4c5caa4f 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
Aaron Huang
5fa8ba76c1 [automerger skipped] Merge "Add unit test for NetworkStatsSubscriptionsMonitor" am: 0543f2328d am: 032d132e50 -s ours am: 43b76f917e -s ours am: 973cfd159a -s ours
am skip reason: Change-Id I4ef3f1ab2e5ea1322133edd80db3ccd0022e9c91 with SHA-1 a8eab54eee is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1298476

Change-Id: I03cc7680a5a57f16862792351ddae20acd66167a
2020-06-17 09:47:28 +00:00
Aaron Huang
973cfd159a [automerger skipped] Merge "Add unit test for NetworkStatsSubscriptionsMonitor" am: 0543f2328d am: 032d132e50 -s ours am: 43b76f917e -s ours
am skip reason: Change-Id I4ef3f1ab2e5ea1322133edd80db3ccd0022e9c91 with SHA-1 a8eab54eee is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1298476

Change-Id: I2058092be5426269fc93e209517a0d01c2fab1ec
2020-06-17 09:34:01 +00:00
Aaron Huang
43b76f917e [automerger skipped] Merge "Add unit test for NetworkStatsSubscriptionsMonitor" am: 0543f2328d am: 032d132e50 -s ours
am skip reason: Change-Id I4ef3f1ab2e5ea1322133edd80db3ccd0022e9c91 with SHA-1 a8eab54eee is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1298476

Change-Id: I11b25c0832d6959e77bbabbfce53cdedce922279
2020-06-17 09:21:52 +00:00