Commit Graph

5311 Commits

Author SHA1 Message Date
Junyu Lai
ec52e89628 Merge "No-op refactoring of VPN lockdown status check." 2018-10-26 05:35:28 +00:00
Junyu Lai
4a62810d90 Merge "Add more debug log when onBlockedStatusChanged was called." 2018-10-25 08:57:56 +00:00
junyulai
4526f99b5e No-op refactoring of VPN lockdown status check.
Currently, if VPN lockdown is disabled, the blocking judgement
inside VPN will return false immediately. It will make
ConnectivityService hard to check blocked status by a given
VPN lockdown status.

Thus, move this check into ConnectivityService and check it
externally.

Bug: 117814902
Test: 1. manual test with 3rd-party vpn app
      2. runtest frameworks-net

Change-Id: Ia8319b1a1a12f1058c24badf2431f2ec69bc78e7
2018-10-25 16:43:50 +08:00
junyulai
3a07d8b87d Add more debug log when onBlockedStatusChanged was called.
Bug: 118355916
Test: 1. runtest frameworks-net
      2. enable/disable battery saver

Change-Id: I6d5f9b49be0defd531fc7ea824668bec7863c4b7
2018-10-25 15:20:01 +08:00
Bill Yi
6155b25f24 Merge pie-platform-release to aosp-master - DO NOT MERGE
Change-Id: I695db52f5e22509401258e8b083e7650d401d993
2018-10-24 14:48:44 -07:00
Chalard Jean
2d23f14c9e Merge "To support skip464xlat per Network" 2018-10-24 07:15:20 +00:00
Nathan Harold
8d6a9818f0 Merge "Move some members to the "Q blacklist"." 2018-10-23 21:53:51 +00:00
Mathew Inwood
df1c689315 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Merged-In: I719b5c94e5b1f4fa562dd5d655953422958ad37e
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
(cherry picked from commit 15cfeb58a4)
2018-10-22 17:28:24 -07:00
Junyu Lai
cd2c08a219 Merge "Add tests for the network blocked status change"
am: f1d996ac11

Change-Id: I0f3f93807d9089239f572c487d791acd7a324a2e
2018-10-19 09:18:38 -07:00
Junyu Lai
d896c9a4e5 Merge "Add new callback to inform blocking of network on specific uid."
am: c7a2d957b0

Change-Id: Ia99ee2fbefa67a7ee00d6fecce430ba6431945cd
2018-10-19 09:14:23 -07:00
Junyu Lai
f1d996ac11 Merge "Add tests for the network blocked status change" 2018-10-19 15:20:48 +00:00
Junyu Lai
c7a2d957b0 Merge "Add new callback to inform blocking of network on specific uid." 2018-10-19 15:20:48 +00:00
Mike Yu
b8c1f78f0d Add tests for the network blocked status change
onBlockedStatusChanged is intruduced for network blocked status.
The changes in this patch are:
  - Test onBlockedStatusChanged which tells apps whether the
    network is blocked.
  - Fixed the tests which is affected by the order changed in
    onAvailable.

Test: as follows
    - runtest frameworks-net
    - runtest -x NetworkPolicyManagerServiceTest.java
Bug: 74575553
Change-Id: I383c037ed895ef69c478dc3cff69fb1e27c42845
2018-10-19 19:52:50 +08:00
Chalard Jean
2a01b50b17 Merge changes I66e40b4b,I599a2ff9,I7c210623
am: 7b0604a191

Change-Id: Iba4bb6d1676d889f1e4a781a7970f01c0e321275
2018-10-16 09:14:22 -07:00
Treehugger Robot
7b0604a191 Merge changes I66e40b4b,I599a2ff9,I7c210623
* changes:
  [PT16] Simplification of sendProxyBroadcast.
  [PT15] Tiny bugfix in setGlobalProxy
  [PT14] No-op refactoring of sendProxyBroadcast
2018-10-16 14:48:33 +00:00
Luke Huang
cb8425b803 Merge "Network-related commands porting"
am: f1b3ef44bc

Change-Id: I96b2bb80cca6e9d80f3f0fe08f7b71ce31b67528
2018-10-16 01:09:30 -07:00
Luke Huang
f1b3ef44bc Merge "Network-related commands porting" 2018-10-16 07:44:37 +00:00
Android Build Merger (Role)
8d8d06494a Merge changes into stage-aosp-master 2018-10-15 22:44:53 +00:00
Android Build Merger (Role)
8b21e345c6 Merge changes into stage-aosp-master 2018-10-15 22:44:53 +00:00
Lorenzo Colitti
001a9fdc97 Merge "Change permissions checks for setAirplaneMode."
am: 7b81c459ce

Change-Id: I578923c3f9012055f715e536f5d4d42ed669c5ee
2018-10-15 08:03:52 -07:00
Android Build Merger (Role)
b80a28b66d Merge changes into stage-aosp-master 2018-10-15 15:00:04 +00:00
Android Build Merger (Role)
7324d048a3 Merge changes into stage-aosp-master 2018-10-15 15:00:04 +00:00
Lorenzo Colitti
7b81c459ce Merge "Change permissions checks for setAirplaneMode." 2018-10-15 13:36:45 +00:00
Chalard Jean
07c5bab28d [PT16] Simplification of sendProxyBroadcast.
sendProxyBroadcast is always called with the same argument, and
it would make no sense with another argument anyway. Remove it.

This concludes the ProxyTracker refactoring with 227 lines removed
from ConnectivityService, a lot clarified, and some bugs removed.
Things can still be improved, but presumably at a much higher cost.

Next steps are : write tests, now that ProxyTracker is both testable
and mockable. And try to pour some gasoline on the PROXY_CHANGE_ACTION
broadcast, see if it burns well.

Test: runtest
Change-Id: I66e40b4bf5cfd0b2dc4fa37ea97b3429fe1b7e6c
2018-10-15 12:58:41 +09:00
Chalard Jean
9be9a4b6ef [PT15] Tiny bugfix in setGlobalProxy
This bug has existed for a long time. If mDefaultProxyEnabled is
false, then the mDefaultProxy member should obviously not be used
in the broadcast.

Test: runtest
Change-Id: I599a2ff9f96d4667e824cf000c2125f86010bb02
2018-10-15 12:58:41 +09:00
Chalard Jean
221019a4c6 [PT14] No-op refactoring of sendProxyBroadcast
If mGlobalProxy is non-null, then getDefaultProxy returns mGlobalProxy
so the first change is a no-op.
If mGlobalProxy is null and mDefaultProxyEnabled is true, then
getDefaultProxy returns mDefaultProxy, which has just been set to
proxyInfo, so the second change is a no-op.
If mGlobalProxy is null and mDefaultProxyEnabled is true, then
getDefaultProxy returns mDefaultProxy ; if mGlobalProxy is null and
mDefaultProxyEnabled is false, then getDefaultProxy returns null,
therefore the third change is a no-op.

Test: runtest
Change-Id: I7c21062302bf54f4fc917c82e0175975051a55ec
2018-10-15 12:58:40 +09:00
Chalard Jean
1030161630 Merge "[PT13] Simple cleanup of ProxyTracker."
am: d4436ad912

Change-Id: I6a30f78e517716ca3ff14a3601374fddc65e4aec
2018-10-12 00:50:29 -07:00
Lorenzo Colitti
c4d0186b30 Change permissions checks for setAirplaneMode.
Require NETWORK_SETTINGS (or NETWORK_SETUP_WIZARD) instead of the
legacy CONNECTIVITY_INTERNAL permission. The users are as follows:

- The system callers (Phone, Settings, SystemUI, VrSettings) all
  have NETWORK_SETTINGS.
- SetupWizard has NETWORK_SETUP_WIZARD
- sl4a has NETWORK_STACK

Bug: 115302596
Test: builds, boots, airplane mode via SystemUI works
Change-Id: I8ca40182bd8b5e3fd9a82296c0cc28de30ed4baf
2018-10-12 16:35:46 +09:00
Chalard Jean
d4436ad912 Merge "[PT13] Simple cleanup of ProxyTracker." 2018-10-12 07:34:43 +00:00
Chalard Jean
2e9029e658 Merge "[PT12] Factor some code into ProxyTracker."
am: 3da2ff5864

Change-Id: Ib92107f434576d8296ba74aab0d9abfe56cefa7c
2018-10-11 22:55:28 -07:00
Yuuki Habu
f7b0625dd7 To support skip464xlat per Network
To add skip464exlat in NetworkMisc.
NetworkAgent can skip to start 464xlat if need.
(e.g. IMS PDN for Cellular can be disabled)

Device will treat the network as IPv6-only if it is set

Bug: 69949375
Test: Nat464XlatTest, ConnectivityServiceTest

Change-Id: I676a02cb92530d64f29f34e89482a934f3ec4553
2018-10-12 14:35:30 +09:00
Chalard Jean
3da2ff5864 Merge "[PT12] Factor some code into ProxyTracker." 2018-10-12 04:23:16 +00:00
Chalard Jean
de3f1c804e Merge "Add log for debugging ConnectivityManager"
am: d3a9f1081a

Change-Id: I666e534f42a930a2d0fee55032d7a9e4516349c0
2018-10-11 21:11:51 -07:00
Chalard Jean
d3a9f1081a Merge "Add log for debugging ConnectivityManager" 2018-10-12 03:14:48 +00:00
Android Build Merger (Role)
68becced97 Merge changes into stage-aosp-master 2018-10-11 15:45:44 +00:00
Android Build Merger (Role)
c8b1e24b9b Merge changes into stage-aosp-master 2018-10-11 15:45:44 +00:00
Chalard Jean
4a4a900999 Merge "[PT11] Move handleDeprecatedGlobalHttpProxy to ProxyTracker"
am: 3bc52ec6f6

Change-Id: I91e1a230864f0d5d826c01f91918a35461e2a433
2018-10-11 06:36:29 -07:00
Treehugger Robot
3bc52ec6f6 Merge "[PT11] Move handleDeprecatedGlobalHttpProxy to ProxyTracker" 2018-10-11 12:50:17 +00:00
junyulai
5ab727b349 Add new callback to inform blocking of network on specific uid.
Currently, apps rely on querying NetworkInfo object to know
whether their network is blocked or not. There is no proactive
way to tell app when it is being blocked/unblocked. The only
event that app would receive is SocketException with
ECONNABORTED when their ongoing socket connection has been
blocked, which is not an elegant way to notify app.

Thus, this commit is trying to address this problem. Therefore,
with the uses of other callbacks, the need of
getState/getDetailedState in NetworkInfo could be completely
eliminated.

Test: runtest frameworks-net
      runtest -x NetworkPolicyManagerServiceTest.java
      cts-tradefed run cts -m CtsHostsideNetworkTests
      cts-tradefed run cts -m CtsNetTestCases -t \
              android.net.cts.ConnectivityManagerTest
Bug: 74575553

Change-Id: Iec96a3103d0aa9a505020eb89d69b89c0b694486
2018-10-11 16:31:10 +08:00
Lorenzo Colitti
27d5da4b3c Merge "Make setAirplaneMode @SystemApi for SetupWizard."
am: 772b75c26d

Change-Id: Ib418ca0a9f8d9be9c4bdc419c9d2ed05aa47a49d
2018-10-10 20:14:03 -07:00
Lorenzo Colitti
272a77dd9a Make setAirplaneMode @SystemApi for SetupWizard.
Expose ConnectivityManager#setAirplaneMode and the
NETWORK_SETUP_WIZARD permission so that SetupWizard can call
setAirplaneMode.

Delete setAirplaneMode from the greylist because the permissions
checks on it, since at least 2013, have been for a privileged
permission (CONNECTIVITY_INTERNAL) that normal apps don't have.

Test: m
Bug: 115302596
Change-Id: I28f24d32c4b4b386407e9e0e3514ea9f8854f4a8
2018-10-10 17:50:05 +09:00
Soi, Yoshinari
99efcbd08b Add log for debugging ConnectivityManager
Add log to ConnectivityManager for better investigations of issue.
This patch adds StackTrace to the following APIs.

reportInetCondition()
reportBadNetwork()
reportNetworkConnectivity()
sendRequestForNetwork()
requestNetwork()
releaseNetworkRequest()
registerNetworkCallback()
unregisterNetworkCallback()

Bug: 116751720
Change-Id: I992292cd9d6f3d69c91ddbde5577591f9ec0f39b
2018-10-10 11:56:04 +09:00
Luke Huang
089ebf12d9 Network-related commands porting
Test: runtest frameworks-net passes
Test: manual testing of network related function works
Change-Id: Id197d20c80b04378731b113ad74676672bd8b67e
2018-10-09 11:29:02 +08:00
Yan Yan
bd45a0d77f Merge changes I10c01f2b,Ie05bc535
am: c182d29130

Change-Id: I2e55a266f65268ca734c028d4da7add14a281d75
2018-10-05 11:47:12 -07:00
Yan Yan
c182d29130 Merge changes I10c01f2b,Ie05bc535
* changes:
  Check to ensure UDP-encap is used only for IPv4
  Add UDP encapsulation tests for IpSecService.
2018-10-05 17:38:41 +00:00
Android Build Merger (Role)
57ff7edf69 Merge changes into stage-aosp-master 2018-10-05 17:35:26 +00:00
Android Build Merger (Role)
526ef90850 Merge changes into stage-aosp-master 2018-10-05 17:35:26 +00:00
Chalard Jean
c75b9031f5 Merge "[PT10] Move loadGlobalProxy into ProxyTracker."
am: 79822ffb6f

Change-Id: If5d2eb35f1c990fc6af5747fb2f8e3d55afb7eb9
2018-10-05 02:22:44 -07:00
Chalard Jean
4d5ab0edc0 [PT13] Simple cleanup of ProxyTracker.
ProxyInfo#getPacFileUrl() is guaranteed to return non-null.

Test: runtest
Change-Id: Id206829441f01c6ed4066028de3e1f7fcbe8930b
2018-10-05 16:40:06 +09:00
Chalard Jean
bd2d0a0641 [PT12] Factor some code into ProxyTracker.
Test: runtest
Change-Id: Ic61ef1e735dcc988cf8fc698b853f3b3be331d8b
2018-10-05 16:40:02 +09:00