Commit Graph

9680 Commits

Author SHA1 Message Date
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
Aaron Huang
3fdad73a32 Merge "Dynamically enable/disable watch for RAT type changes" 2020-06-18 03:51:51 +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
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
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
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
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
Aaron Huang
032d132e50 Merge "Add unit test for NetworkStatsSubscriptionsMonitor" am: 0543f2328d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1298476

Change-Id: I1b191cd4706a7409794d382bda95ef6933b019a1
2020-06-17 09:09:13 +00:00
Aaron Huang
0543f2328d Merge "Add unit test for NetworkStatsSubscriptionsMonitor" 2020-06-17 08:52:20 +00:00
Aaron Huang
7558938ce9 Dynamically enable/disable watch for RAT type changes
Add ContentObserver to observe the status of
NETSTATS_COMBINE_SUBTYPE_ENABLED to determine that
NetworkStatsSubscriptionsMonitor start or stop
monitoring data usage per RAT type changes.

Bug: 154080515
Test: atest NetworkStatsServiceTest#testDynamicWatchForNetworkRatTypeChanges
Change-Id: I272d589633c9186b45753228b05aa0b40b7c7b89
2020-06-17 17:09:10 +09:00
TreeHugger Robot
c3a780339a [automerger skipped] Merge "Test extra info sent to NetworkMonitor" into rvc-dev am: 8202b399da -s ours
am skip reason: Change-Id I4f827664c528bea30cc957a0a617dd37693f4460 with SHA-1 301bc7b40a is in history

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

Change-Id: I63ad698bb29d3770e879f27b155a9fc656a80836
2020-06-16 03:28:39 +00:00
Chiachang Wang
1182d5a7fc Test extra info sent to NetworkMonitor
Test extra info sent to NetworkMonitor correctly if network
agent is created through new NetworkAgent constructor without
legacy network info taken as parameter.

Bug: 156173829
Test: atest FrameworkNetTests
Merged-In: I4f827664c528bea30cc957a0a617dd37693f4460
Change-Id: I4f827664c528bea30cc957a0a617dd37693f4460
2020-06-16 01:57:46 +00:00
Benedict Wong
b001522433 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 e29bf99a7fc1067c546d7fa6cbcb9001fb110d16)
2020-06-16 01:42:48 +00:00
Chiachang Wang
41b5925f01 Merge "Test extra info sent to NetworkMonitor" am: 9792742ee0 am: 26cd395a9e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1331060

Change-Id: Ice048df853589411ee1f1c935b929994af1c525b
2020-06-16 01:02:52 +00:00
Chiachang Wang
26cd395a9e Merge "Test extra info sent to NetworkMonitor" am: 9792742ee0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1331060

Change-Id: If48de0d3fe326d72170b13ec6a9477dfc8dc48ff
2020-06-16 00:52:01 +00:00
Chiachang Wang
9792742ee0 Merge "Test extra info sent to NetworkMonitor" 2020-06-16 00:38:58 +00:00
Benedict Wong
d01a9458ed Merge "Set correct owner UID for VPN agentConnect()" am: 2f7bb517fd am: bab1782868
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
bab1782868 Merge "Set correct owner UID for VPN agentConnect()" am: 2f7bb517fd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1326493

Change-Id: I04609b41c9e878e1e3ca8f128d86290012d4ede7
2020-06-15 17:18:15 +00:00
Benedict Wong
2f7bb517fd Merge "Set correct owner UID for VPN agentConnect()" 2020-06-15 17:09:46 +00:00
Aaron Huang
b0e7dca43e Add unit test for NetworkStatsSubscriptionsMonitor
Bug: 154080205
Test: atest FrameworksNetTests:com.android.server.net.NetworkStatsSubscriptionsMonitorTest
(copy from ag/11788484 but getActiveAndHiddenSubscriptionIdList() since it's renamed
in internal)
Change-Id: Ia162f36efe96d90b2f6f70190d9fa855bba34484
Merged-In: I4ef3f1ab2e5ea1322133edd80db3ccd0022e9c91
2020-06-15 07:05:19 +00:00
Chiachang Wang
301bc7b40a Test extra info sent to NetworkMonitor
Test extra info sent to NetworkMonitor correctly if network
agent is created through new NetworkAgent constructor without
legacy network info taken as parameter.

Bug: 156173829
Test: atest FrameworkNetTests
Change-Id: I4f827664c528bea30cc957a0a617dd37693f4460
2020-06-12 18:13:00 +08:00
Chalard Jean
51732a8d91 [automerger skipped] Merge "Document the limitation to a hundred callbacks." into rvc-dev am: df9ce18085 -s ours
am skip reason: Change-Id I5911d01984695550b6c9afe7a8eb535bf5e320a1 with SHA-1 a5ff113bff is in history

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

Change-Id: I819ea5e14c6eaf108ac7252768014aa5d33891b3
2020-06-12 04:58:29 +00:00
Chalard Jean
df9ce18085 Merge "Document the limitation to a hundred callbacks." into rvc-dev 2020-06-12 04:54:02 +00:00
Aaron Huang
65556318aa Merge "Add unit test for NetworkStatsSubscriptionsMonitor" into rvc-dev am: 70afc75769
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11788484

Change-Id: Iac633487b359d751206e06b2352a2a9cb475811e
2020-06-12 02:11:29 +00:00
Aaron Huang
70afc75769 Merge "Add unit test for NetworkStatsSubscriptionsMonitor" into rvc-dev 2020-06-12 01:58:59 +00:00
Chalard Jean
cece40543e 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
Mark Chien
977a7aa9db [automerger skipped] Merge "Cleanup config_mobile_hotspot_provision_app usage" into rvc-dev am: ef24e2121d -s ours
am skip reason: Change-Id I030871c2bc46bc09c4e52970b4995f98d31bb90e with SHA-1 e9aad6fa2b is in history

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

Change-Id: I03e5cf0b7950726825c781dda3b5efdc613e2dcf
2020-06-11 15:42:35 +00:00
markchien
f949ec251f 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
1fa0eab021 Merge "Document the limitation to a hundred callbacks." am: f60ed54d33 am: 363fb9fef9
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
363fb9fef9 Merge "Document the limitation to a hundred callbacks." am: f60ed54d33
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1313813

Change-Id: Id2f70609c46ec6252b7e734c1e5838016314400f
2020-06-11 12:46:15 +00:00
Chalard Jean
f60ed54d33 Merge "Document the limitation to a hundred callbacks." 2020-06-11 12:31:09 +00:00
Chalard Jean
a5ff113bff 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
b4e92e60f1 Merge "Cleanup config_mobile_hotspot_provision_app usage" am: 443092b9a8 am: 921d8c0fb5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1329014

Change-Id: Ib3bb0129419ffd55df6c2c53cce3ad7e9155e854
2020-06-11 08:03:56 +00:00
Mark Chien
921d8c0fb5 Merge "Cleanup config_mobile_hotspot_provision_app usage" am: 443092b9a8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1329014

Change-Id: I3d265ab9806605e18384fa6321452f7c96f3f48b
2020-06-11 07:40:27 +00:00
markchien
e9aad6fa2b 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
e7a3528bbf [automerger skipped] Merge "Update extra info before registering" into rvc-dev am: 4720606b02 -s ours
am skip reason: Change-Id Ieaad8cbf1a28af3b97c7f98f74358e417fcad661 with SHA-1 9774ceb3ea is in history

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

Change-Id: Iee50671a7363ed0e820494cbbb06b71063d01f6a
2020-06-10 15:33:04 +00:00
Lorenzo Colitti
4720606b02 Merge "Update extra info before registering" into rvc-dev 2020-06-10 15:17:38 +00:00
Benedict Wong
bf004e9830 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
Aaron Huang
a8eab54eee Add unit test for NetworkStatsSubscriptionsMonitor
Bug: 154080205
Test: atest FrameworksNetTests:com.android.server.net.NetworkStatsSubscriptionsMonitorTest
Change-Id: I4ef3f1ab2e5ea1322133edd80db3ccd0022e9c91
2020-06-09 00:40:36 +08:00
Xin Li
e0a1ab503c [automerger skipped] Merge "Merge QQ3A.200605.002 into master" am: 551b6e094b -s ours am: 8c453bdce0 -s ours
am skip reason: Change-Id I5e28537689d1a53e99f91eafd494eb3a0c890f46 with SHA-1 afbf77813b is in history

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

Change-Id: I3811100a743b62c5a5e9f661647793b719824679
2020-06-08 16:08:03 +00:00
Xin Li
8c453bdce0 [automerger skipped] Merge "Merge QQ3A.200605.002 into master" am: 551b6e094b -s ours
am skip reason: Change-Id I5e28537689d1a53e99f91eafd494eb3a0c890f46 with SHA-1 afbf77813b is in history

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

Change-Id: Iacc1884e345d9df125b3a9bbf32d1d10d3a4757d
2020-06-08 15:56:48 +00:00
TreeHugger Robot
a29f7baa7b [automerger skipped] Merge "Update javadoc to use complete sentence" into rvc-dev am: 1f883f9099 -s ours
am skip reason: Change-Id I41bf8a6ddad200f00524d9b2dd1bf169810ee460 with SHA-1 8b60559b7e is in history

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

Change-Id: I5d2a2bb388181fa798c934dd94bf65df29d13dc3
2020-06-08 09:10:45 +00:00