Commit Graph

3922 Commits

Author SHA1 Message Date
The Android Automerger
e16d531b66 Manually merge commit '530b93aae428'
* commit '530b93aae428':
  NetworkCapabilities: Unhide TRANSPORT_LOWPAN

BUG:31038431
2017-07-19 00:27:08 +00:00
Robert Quattlebaum
9ff9821621 Merge "NetworkCapabilities: Unhide TRANSPORT_LOWPAN" am: f82bad29c7 am: 1d72e27026
am: dbc78509ae

Change-Id: I017036f8c63ea1e9c1934daad55ef087b3a83012
2017-07-18 23:51:04 +00:00
Robert Quattlebaum
1d72e27026 Merge "NetworkCapabilities: Unhide TRANSPORT_LOWPAN"
am: f82bad29c7

Change-Id: I3ae9566ca52b9dae87cace18b1e97897eb8de0ad
2017-07-18 23:33:08 +00:00
Treehugger Robot
f82bad29c7 Merge "NetworkCapabilities: Unhide TRANSPORT_LOWPAN" 2017-07-18 23:09:58 +00:00
Charles He
36f11ff9db Merge "Opt-out for always-on VPN" 2017-07-18 18:47:45 +00:00
TreeHugger Robot
e531235d76 Merge "IP connectivity metrics: fix tests after proto update" 2017-07-18 07:58:33 +00:00
Hugo Benichi
68d99ea1af IP connectivity metrics: fix tests after proto update
Update to ipconnectivity.proto in commit
6d2f506bfd788a3685292d404dc9d82a27357cfe broke the associated unit
tests (Change-Id: I4cf5b95956df721aecd63fddfb026a7266c190b9)

Bug: 34901696
Test: runtest frameworks-net
Change-Id: I57a6bad8a9836b1c45690c4589b416786ce1dfa0
2017-07-18 14:33:12 +09:00
Charles He
729f0b476d Opt-out for always-on VPN
Always-on VPN is a feature introduced in N. Since then, all VPN apps
targeting N+ are assumed to support the feature, and the user or the DPC
can turn on / off always-on for any such VPN app. However, a few VPN
apps are not designed to support the always-on feature. Enabling
always-on for these apps will result in undefined behavior and confusing
"Always-on VPN disconnected" notification.

This feature provides a new manifest meta-data field through which a VPN
app can opt out of the always-on feature explicitly. This will stop the
always-on feature from being enabled for the app, both by the user and
by the DPC, and will clear its existing always-on state.

A @hide API is provided to check whether an app supports always-on VPN.
Documentation is updated to reflect the behavior change.

Bug: 36650087
Test: runtest --path java/com/android/server/connectivity/VpnTest.java
Test: cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.MixedDeviceOwnerTest#testAlwaysOnVpnUnsupportedPackage'
Test: cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.MixedDeviceOwnerTest#testAlwaysOnVpnUnsupportedPackageReplaced'
Test: cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.MixedProfileOwnerTest#testAlwaysOnVpnUnsupportedPackage'
Test: cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.MixedProfileOwnerTest#testAlwaysOnVpnUnsupportedPackageReplaced'
Test: cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testAlwaysOnVpnUnsupportedPackage'
Test: cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testAlwaysOnVpnUnsupportedPackageReplaced'

Change-Id: I477897a29175e3994d4ecf8ec546e26043c90f13
2017-07-18 00:55:38 +01:00
Jeff Sharkey
38f0139f64 Merge "Move "metered" persistence to WifiConfiguration." 2017-07-14 17:48:02 +00:00
Jeff Sharkey
41a7269b04 Move "metered" persistence to WifiConfiguration.
For a long time we've had a nasty tangled dependency between Wi-Fi
and NPMS, since they both persisted different details for configured
networks.  As part of preparing for new carrier data plan APIs, move
the tracking of meteredness over to WifiConfiguration.

This also cleans up how meteredness is communicated through
NetworkAgents to rely completely on NET_CAPABILITY_NOT_METERED by
removing the metered flag on NetworkInfo, which has caused confusion
and staleness.

Migrates any existing user-configured metered networks over to
WifiConfiguration once the device finishes booting.

Remove support for NetworkQuotaInfo, since this information can no
longer be made available to apps.  Frustratingly, some apps are
using it, so keep the object around returning stub values, and shame
them in the logs.

Bug: 63391323
Test: builds, boots, Wi-Fi policy is upgraded
Exempt-From-Owner-Approval: Bug 63673347
Change-Id: I64f865ddeb65cfcd330f8d2a847368abdf960a07
2017-07-14 11:46:31 -06:00
Hugo Benichi
b4000e64b0 resolve merge conflicts of 4f2a0fe213e5 to stage-aosp-master am: 0c57cf16ee am: 164ff8a2ed
am: 0d3fd70ea2  -s ours

Change-Id: Ie43a31dc8ccc156383c8ab24a255e0683a44622a
2017-07-14 00:55:52 +00:00
Hugo Benichi
0d3fd70ea2 resolve merge conflicts of 4f2a0fe213e5 to stage-aosp-master am: 0c57cf16ee
am: 164ff8a2ed

Change-Id: I08195e119f866acc9fe1795b892fe45cea3c7f47
2017-07-14 00:46:49 +00:00
Hugo Benichi
0c57cf16ee resolve merge conflicts of 4f2a0fe213e5 to stage-aosp-master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I61cfb2d4798350f28f1bb36aed67ee8f18895031
2017-07-14 07:25:51 +09:00
Hugo Benichi
ce7b23c488 IpManager: define InitialConfiguration
This patch adds a InitialConfiguration class to IpManager for specifying
IP information in IpManager ProvisioningConfiguration at IpManager
startup.

At the moment this InitialConfiguration is not used, but is validated in
startProvsiioning if ProvisioningConfiguration includes one. It will be
integrated into IpManager IP provisioning logic in follow-up patches.

This patch also includes an example of data driven unit tests using a
table of test case. The highlights of this methodology are:
  1) easy extensibility for new test case,
  2) rich and informative error messages,
Unfortunately Java support for inlined data structure literals is poor
and some companion static methods for data generation are required for
enabling this methodology.

Bug: 62988545
Test: added new test in FrameworksNetTests,
      $ runtest frameworks-net
      $ runtest frameworks-wifi
Merged-In: I060b02603af7d73a6407df89344bf0c000574af2

(cherry pick of commit 0c9a9404aa)

Change-Id: I48dbf89232d7758f1b07ed4d76ce93281e5c6b53
2017-07-14 04:26:42 +09:00
Hugo Benichi
0c9a9404aa IpManager: define InitialConfiguration
This patch adds a InitialConfiguration class to IpManager for specifying
IP information in IpManager ProvisioningConfiguration at IpManager
startup.

At the moment this InitialConfiguration is not used, but is validated in
startProvsiioning if ProvisioningConfiguration includes one. It will be
integrated into IpManager IP provisioning logic in follow-up patches.

This patch also includes an example of data driven unit tests using a
table of test case. The highlights of this methodology are:
  1) easy extensibility for new test case,
  2) rich and informative error messages,
Unfortunately Java support for inlined data structure literals is poor
and some companion static methods for data generation are required for
enabling this methodology.

Bug: 62988545
Test: added new test in FrameworksNetTests,
      $ runtest frameworks-net
      $ runtest frameworks-wifi

Change-Id: I060b02603af7d73a6407df89344bf0c000574af2
2017-07-13 22:42:50 +09:00
Andreas Gampe
7c89e296e4 Merge "Connectivity: Fix format arguments" am: ba8ab362ad am: 9ad55e3591 am: ce4c57fd0e
am: 378c299abe

Change-Id: I8b0734e5d786999e1b520164b78ed72f453185e0
2017-07-12 05:08:02 +00:00
Andreas Gampe
378c299abe Merge "Connectivity: Fix format arguments" am: ba8ab362ad am: 9ad55e3591
am: ce4c57fd0e

Change-Id: Ia789f019394b7870994fcce8e64dee3b0501f7c1
2017-07-12 05:00:56 +00:00
Andreas Gampe
9ad55e3591 Merge "Connectivity: Fix format arguments"
am: ba8ab362ad

Change-Id: I844c7d1faea3dcc90cf9816cae984277d7525f15
2017-07-12 04:48:10 +00:00
Andreas Gampe
14c57f3a15 Connectivity: Fix format arguments
Fix missing argument.

Bug: 19797138
Test: m
Change-Id: I5fdd2a453c0d7422e8c3e79c8dce2d0800ec45e9
2017-07-11 18:21:15 -07:00
Robert Quattlebaum
4ec139be36 NetworkCapabilities: Unhide TRANSPORT_LOWPAN
This commit simply unhides the constant `TRANSPORT_LOWPAN` in the class
`android.net.NetworkCapabilities`, adding it to the public API.

Bug: b/63600204
Change-Id: I794635814c0bd3891cd22fcc1e31614e4d6ac654
2017-07-11 18:16:09 -07:00
Hugo Benichi
da8d3a8571 Merge "NetworkCapabilities: Added support for TRANSPORT_LOWPAN" into stage-aosp-master am: 6ab950dd5f am: 6659fdba55 -s ours
am: 4bf89e5ff9  -s ours

Change-Id: Ibe84e68d5224833b92e64e917123d835b7cca46f
2017-07-11 10:34:14 +00:00
Hugo Benichi
4bf89e5ff9 Merge "NetworkCapabilities: Added support for TRANSPORT_LOWPAN" into stage-aosp-master am: 6ab950dd5f
am: 6659fdba55  -s ours

Change-Id: I30a343b25381f201cad4bff45df4ab6a1cf38e34
2017-07-11 10:24:15 +00:00
Robert Quattlebaum
221ccf7ec5 NetworkCapabilities: Added support for TRANSPORT_LOWPAN
This change simply adds a new constant, `TRANSPORT_LOWPAN`, for
identifying low-power wireless networks like Thread.

Bug: b/33073713
Test: builds
Change-Id: I50d9b8df1a0270e06c28f001adf6c52a142a85af
Merged-In: Ie4aa77496f8ff466fa1a5fbc556e9c029457a689

(cherry pick from commit 5bc95c5900)
2017-07-11 15:52:37 +09:00
Android Build Merger (Role)
ede2dee5ca Merge "Merge "Merge "Wakeup packet mark/mask configuration option" into oc-dr1-dev am: d2eef601f6" into oc-dr1-dev-plus-aosp am: c29006c184" 2017-07-06 16:30:15 +00:00
Android Build Merger (Role)
f486e39193 Merge "Merge "Merge "Wakeup packet mark/mask configuration option" into oc-dr1-dev am: d2eef601f6" into oc-dr1-dev-plus-aosp am: c29006c184" 2017-07-06 16:29:52 +00:00
Lorenzo Colitti
77e766715f Merge "Merge "Wakeup packet mark/mask configuration option" into oc-dr1-dev am: d2eef601f6" into oc-dr1-dev-plus-aosp
am: c29006c184

Change-Id: Ic69cc209c2afbb99580998bb77f3b7df80afe8be
2017-07-06 16:29:04 +00:00
Lorenzo Colitti
b6557f920b Merge "Merge "Wakeup packet mark/mask configuration option" into oc-dr1-dev am: d2eef601f6" into oc-dr1-dev-plus-aosp
am: c29006c184

Change-Id: Iaafa4739f5e116fd94c60d662f9c9d09d56fe06e
2017-07-06 16:28:32 +00:00
Android Build Merger (Role)
1e3e85ee0a Merge "Merge "Wakeup packet mark/mask configuration option" into oc-dr1-dev am: d2eef601f6 am: 2564b1c7cc" 2017-07-06 16:27:32 +00:00
Lorenzo Colitti
e29731636e Merge "Wakeup packet mark/mask configuration option" into oc-dr1-dev am: d2eef601f6
am: 2564b1c7cc

Change-Id: I083aac710590a461f2c12735e0daaf35a6f35387
2017-07-06 16:25:48 +00:00
Lorenzo Colitti
b403f8b992 Merge "Wakeup packet mark/mask configuration option" into oc-dr1-dev am: d2eef601f6
am: 2564b1c7cc

Change-Id: I0c25ea79b2f62fa548c4ed5cccb398530f138822
2017-07-06 16:25:24 +00:00
Android Build Merger (Role)
c29006c184 Merge "Merge "Wakeup packet mark/mask configuration option" into oc-dr1-dev am: d2eef601f6" into oc-dr1-dev-plus-aosp 2017-07-06 16:10:57 +00:00
Lorenzo Colitti
5f7174a98b Merge "Wakeup packet mark/mask configuration option" into oc-dr1-dev
am: d2eef601f6

Change-Id: I8297ca8d29d3aab18884a35953b0021ec265ce26
2017-07-06 16:09:49 +00:00
Lorenzo Colitti
2564b1c7cc Merge "Wakeup packet mark/mask configuration option" into oc-dr1-dev
am: d2eef601f6

Change-Id: Ibc89ffd87fb87cd95f941b2bbd67469d961cb13e
2017-07-06 16:09:30 +00:00
Joel Scherpelz
ba37c6c7d8 Wakeup packet mark/mask configuration option
Rules will only be installed if a device specific config.xml overrides
the default values of mark and mask.

This change also fixes a bug where wakeup rules added by the wakeup
controller would never be removed because updateInterfaces() is not
invoked on wifi network change or disable.

Test: as follows
    - built
    - flashed
    - booted
    - Manually verified that mask/mark is set correctly
Bug: 28806131

(cherry picked from commit d18b92cd95)

Change-Id: I95e75b11b973707bcb428ea6498fbfd8e717b855
2017-07-06 19:10:33 +09:00
Hugo Benichi
064fd68f16 Merge "ConnectivityManager: allow usage of TYPE_NONE" am: ffcaee218d am: fab5b13b83 am: 0278aa4b70
am: fe42a55877

Change-Id: I1e005686a1de5f2154fbc614ea52ce1a3ff5fc81
2017-07-05 14:54:05 +00:00
Hugo Benichi
fe42a55877 Merge "ConnectivityManager: allow usage of TYPE_NONE" am: ffcaee218d am: fab5b13b83
am: 0278aa4b70

Change-Id: I1707e39308b0cf425b75e1e3f85323743c252c2f
2017-07-05 14:47:56 +00:00
Hugo Benichi
600aae4fe7 Merge "ConnectivityServiceTest: more informative assert failures" am: 9951460998 am: 598e36fd6a am: 14f400ca81
am: 3ca4158752

Change-Id: Icafd27e8273aa6b6595c30affd23a960e5d55c53
2017-07-05 14:40:30 +00:00
Hugo Benichi
fab5b13b83 Merge "ConnectivityManager: allow usage of TYPE_NONE"
am: ffcaee218d

Change-Id: I72dbd17db63bd7b8637e82f5cdcfec3bf1482962
2017-07-05 14:33:35 +00:00
Hugo Benichi
3ca4158752 Merge "ConnectivityServiceTest: more informative assert failures" am: 9951460998 am: 598e36fd6a
am: 14f400ca81

Change-Id: If00f0fd750d54074c0c642465384446502c1deec
2017-07-05 14:33:34 +00:00
Treehugger Robot
ffcaee218d Merge "ConnectivityManager: allow usage of TYPE_NONE" 2017-07-05 14:21:35 +00:00
Hugo Benichi
598e36fd6a Merge "ConnectivityServiceTest: more informative assert failures"
am: 9951460998

Change-Id: Iaa55014ae4c2f4927059735c349c40ada836b79b
2017-07-05 14:19:33 +00:00
Treehugger Robot
9951460998 Merge "ConnectivityServiceTest: more informative assert failures" 2017-07-05 14:07:37 +00:00
Hugo Benichi
6fe0f587c5 Merge "ConnectivityServiceTest: eliminate remaining sleep()" am: 5b906a4ece am: 6c65982d2b am: 80bc56bf2a
am: f6362d50a6

Change-Id: I9b1c77bd8d0710736f1f29b204acc3a162e833fb
2017-07-05 12:56:08 +00:00
Hugo Benichi
f6362d50a6 Merge "ConnectivityServiceTest: eliminate remaining sleep()" am: 5b906a4ece am: 6c65982d2b
am: 80bc56bf2a

Change-Id: I5e33e909cd8887460c2641c069432ec6bfa5beda
2017-07-05 12:49:04 +00:00
Hugo Benichi
6c65982d2b Merge "ConnectivityServiceTest: eliminate remaining sleep()"
am: 5b906a4ece

Change-Id: Ib1e31c2b8999d07b20ef4cef8e70d851f93df6e5
2017-07-05 12:35:01 +00:00
Hugo Benichi
37d5c3cb21 ConnectivityManager: allow usage of TYPE_NONE
This patch allows to use TYPE_NONE for the legacy network type variable
of NetworkInfo. This usage is "safe" with respect to legacy APIs using
network types as most of them already returns null or do nothing for
TYPE_NONE.

Of the existing APIs in ConnectivityManager that accept a network type
argument, those which were already returning null or doing nothing for
TYPE_NONE are:
  getNetworkInfo(int)
  getNetworkForType(int)
  stopUsingNetworkFeature(int, String)
  networkCapabilitiesForType(int)
  requestRouteToHostAddress(int, InetAddress)
  reportInetCondition(int, int)
  isNetworkSupported(int)
  getLinkProperties(int)

Only setProvisioningNotificationVisible needs an additional guard
against TYPE_NONE.

Bug: 30088447
Bug: 62844794
Test: runtest frameworks-net
Change-Id: I112596fcd03d3c2cd42a2a84d265adb38e3944bb
2017-07-05 21:30:52 +09:00
Hugo Benichi
6b1d01e117 ConnectivityServiceTest: more informative assert failures
Bug: 62918393
Test: runtest frameworks-net
Change-Id: If87315ef7cba6380596f48b92c7e0f6eeccc8368
2017-07-05 21:30:10 +09:00
Hugo Benichi
5b906a4ece Merge "ConnectivityServiceTest: eliminate remaining sleep()" 2017-07-05 12:25:16 +00:00
Hugo Benichi
d148700cd0 ConnectivityServiceTest: eliminate remaining sleep()
ConnectivityServiceTest was still using sleep() in a few places although
these were unnecessary:
  - in testSatisfiedThenLostNetworkRequestDoesNotTriggerOnAvailable(),
    expectNoCallback() and expectAvailableCallback() already include
    waitForIdleHandler calls that drain the message queues and make
    sleep no-ops.
  - in testTimedoutAfterUnregisterdNetworkRequest, the sleeps were
    introduced before unregisterNetworkCallback was changed to have a
    synchronous effect for callback unregistration, therefore the sleep
    becomes simply non-sensical. To reflect this the name of the method
    is also changed.

Bug: 62918393
Test: runtest frameworks-net
Change-Id: I7b701ecf5846a5e1890e86107b8d2544b419ce44
2017-07-05 16:07:57 +09:00
Roland Levillain
fdf31f0988 Merge "Revert "ConnectivityManager: allow usage of TYPE_NONE"" am: 613b73cac8 am: 0d0c37da2a am: bdcebe39e6
am: 1305ff8ac6

Change-Id: Ibd1ef362cdc21d57aefb2d1180dc678bb2692f34
2017-07-04 11:53:16 +00:00