Commit Graph

8658 Commits

Author SHA1 Message Date
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
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
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
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
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
Pavel Grafov
7a952773d1 Connectivity: start PAC global proxy after reboot.
Previously, we read the global proxy settings from Settings.Global
database after reboot. This works for manual proxies, but not for
proxies based on PAC rules, as PacManager is never invoked when
ConnectivityService starts up. As a consequence, services required for
PAC-based proxies (PacService and ProxyService) are never started.

In this CL, we make sure PacManager is called during boot, so that PAC
rules will take effect.

Bug: 35943997
Test: set a PAC proxy and observe it still works after reboot
Change-Id: I69edb5fcd3e84663d338ff4b93c40fd5ee2c8c51
2020-06-17 00:18:34 +01: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
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
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
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
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
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
Xin Li
551b6e094b Merge "Merge QQ3A.200605.002 into master" 2020-06-06 01:41:11 +00:00
Treehugger Robot
bd1d9f134f Merge "Update javadoc to use complete sentence" am: d3068f93c3
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
d3068f93c3 Merge "Update javadoc to use complete sentence" 2020-06-05 03:02:36 +00:00
Chiachang Wang
d5420bf1f9 Merge "Update extra info before registering" am: 6f9c48b81e
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
6f9c48b81e Merge "Update extra info before registering" 2020-06-05 00:04:04 +00:00
Chiachang Wang
8b60559b7e 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
9774ceb3ea 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
Junyu Lai
528f5debe1 Merge "Disable log for per uid blocked status changed event" am: d66468ca25
Original change: undetermined

Change-Id: I6ba38a19e1ac1d7f3f3eccef76aa10f75273ca47
2020-06-02 09:52:38 +00:00
Junyu Lai
d66468ca25 Merge "Disable log for per uid blocked status changed event" 2020-06-02 09:39:30 +00:00
junyulai
31a6c32056 Disable log for per uid blocked status changed event
This consumes ~3.5% system logs, however it is not very useful
when debugging since similar information could be obtained from
dumpsys {connectivity|netpolicy}. Thus, remove the log.

Test: manual
Bug: 135504481
Change-Id: I04d2b7402f892546722fe6868c521afd9534f183
2020-06-02 14:26:36 +08:00
Maciej Żenczykowski
5b8a4a37af Merge "Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS" am: 4bf80c0b90
Change-Id: I4128678546feba6840ddb210244992846705e5d9
2020-06-01 02:14:25 +00:00
Maciej Żenczykowski
4bf80c0b90 Merge "Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS" 2020-06-01 02:00:40 +00:00
Luke Huang
c9dcbcd597 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
54c3c2b3c7 Merge "Allow TRANSPORT_TEST ethernet networks" am: 6642ec61c3
Change-Id: Ib9ab1ddb855c90219e94c4b74dc7268cfbcdb661
2020-05-29 21:43:41 +00:00
Benedict Wong
29879886c9 Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" am: de684cfa06
Change-Id: I4a135e75105a49b25b65ba76a3c252467bd9d5ea
2020-05-29 21:41:40 +00:00
Remi NGUYEN VAN
6642ec61c3 Merge "Allow TRANSPORT_TEST ethernet networks" 2020-05-29 06:26:14 +00:00
Benedict Wong
de684cfa06 Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" 2020-05-29 01:55:08 +00:00
Remi NGUYEN VAN
656c566cf1 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
Change-Id: I0d9477977c88aa055625ab4046577a41e76b05ff
2020-05-29 10:22:50 +09:00
Treehugger Robot
843c1661c7 Merge changes I289d935f,I0121a4ac am: 84af34369d
Change-Id: I7c413c9e1f2efc3aba55453c6b98bf682f3d4116
2020-05-28 10:55:48 +00:00
Treehugger Robot
84af34369d Merge changes I289d935f,I0121a4ac
* changes:
  NetworkStats: apply464xlatAdjustments - don't remove CLAT_UID
  NetworkStats: apply464xlatAdjustments - remove useBpfStats parameter.
2020-05-28 10:34:01 +00:00
Maciej Żenczykowski
62cf792d3f Merge changes Ie73ba058,I4393afcb,Ifebd946e,Ib12ee882,Ia171b779 am: 9fb791c62d
Change-Id: I7b9ae6590c67f89b023417e511fa823b79ad53b1
2020-05-28 09:18:16 +00:00
Maciej Żenczykowski
9fb791c62d Merge changes Ie73ba058,I4393afcb,Ifebd946e,Ib12ee882,Ia171b779
* changes:
  fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting100MBDownload
  fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting
  fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccountingSimple
  fix android.net.NetworkStatsTest#testApply464xlatAdjustments
  NetworkStats - no need for xt_qtaguid clat bw fixups
2020-05-28 09:04:42 +00:00
Maciej Żenczykowski
bcd2b09b35 NetworkStats: apply464xlatAdjustments - don't remove CLAT_UID
This should no longer be needed after all the cleanups.

Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I289d935f84b616ed857ef4c5a7427d57c282d00c
2020-05-28 01:47:30 -07:00
Maciej Żenczykowski
4bfcfc5f02 NetworkStats: apply464xlatAdjustments - remove useBpfStats parameter.
Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0121a4ac7ee824adc5930bab786d550b2f00b05b
2020-05-28 01:33:25 -07:00
Maciej Żenczykowski
b053a337e3 fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting100MBDownload
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

(so just copy over the rx stats from the before file)

Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie73ba0586dafde67bc2726db26e07f7268c18be3
2020-05-28 00:26:18 -07:00