Commit Graph

509 Commits

Author SHA1 Message Date
Hugo Benichi
85808c8293 Merge "NetworkCapabilities: fix describeImmutableDifferences" into oc-dr1-dev
am: 1b3877a965

Change-Id: I50748aa0c9332787797f91265afccf82ceabf332
2017-08-07 05:49:25 +00:00
Hugo Benichi
8a3a012a1c NetworkCapabilities: fix describeImmutableDifferences
This patch fixes the mask used in describeImmutableDifferences which did
not correctly turn NET_CAPABILITY_NOT_METERED into bit flag.

Bug: 63326103
Test: added unit tests, runtest frameworks-net
Merged-In: Ib6b390b1daef5912859302692af7dcd6cfd3e39a
Merged-In: If38efacdeec8476880835657938e435f9b598525
Merged-In: Ieccad46fcffcaf748f5644b04617e9a82527000e
Merged-In: I533ef8fe369cec19d283ff2950314fce6e28cffd
Merged-In: I12636c6699ff60487a28570208e819ea0b66fa2e
Merged-In: Ie5df14e0ea1c12e0cfabe87978ac6c9b744353b2

(cherry picked from commit 2ecb9408f4)

Change-Id: I74ecf34a2c079c74152d00caea2c220e9c6d1fa5
2017-08-05 11:37:10 +09:00
Hugo Benichi
b704e7aa75 Merge "NetworkNotificationManager: correctly handle existing notifications" into oc-dr1-dev
am: a03bf7acd1

Change-Id: I4ca3dcc293be5408a6f207e1ac1a7229a915723a
2017-07-28 04:39:14 +00:00
Hugo Benichi
3cff783a05 NetworkNotificationManager: correctly handle existing notifications
This patch corrects a regression added by commit fb2609d3ee that did
not take into account the case of multiple notifications shown for a
single network id. Given how network notifications are triggered, it can
happen that NO_INTERNET and SIGN_IN notifications are both triggered for
the same network when captive portal detection is slow.

Contrary to the situation before commit fb2609d3ee, a notification
priority order is introduced so that SIGN_IN always overrides
NO_INTERNET, and NO_INTERNET is ignored if SIGN_IN is already present.

Bug: 63676954
Bug: 62503737
Test: runtest frameworks-net, added new unit tests
Merged-In: Ib8658601e8d4dc6c41b335ab7dd8caa0cccd9531
Merged-In: I4432f66067ea1ab02e1d2dfe42530bcdafa52df6
Merged-In: I74631b0bfd14daf18a1641ed7f2ec323d636ebbf
Merged-In: I73cc879e910d503946facdba498b300337f349fd
Merged-In: Ieed9e3e7755e0c5f89dc41ef66f47d4dbf4c66a9
Merged-In: I0aa590170f1bd4c37175c7e35e54d52f1fb21347

(cherry picked from commit 5fcd050e0e)

Change-Id: I41675768ab59e9b23ca4275edf297b82595e5730
2017-07-28 09:17:20 +09:00
Ahmed ElArabawy
e9685cab9a Merge "Add Configuration to APF Policy" into oc-dr1-dev am: 1da6af31ff
am: 1885632105

Change-Id: I5949798a6531344ed90301f452165838fa8adb6a
2017-07-19 22:17:21 +00:00
Ahmed ElArabawy
1885632105 Merge "Add Configuration to APF Policy" into oc-dr1-dev
am: 1da6af31ff

Change-Id: I16346bb98a0b9259f7c3f51e318c472cfc1bb492
2017-07-19 22:11:40 +00:00
TreeHugger Robot
1da6af31ff Merge "Add Configuration to APF Policy" into oc-dr1-dev 2017-07-19 22:02:09 +00:00
Hugo Benichi
c948cfab40 Merge "ConnectivityServiceTest: fix testNetworkInfoOfTypeNone" am: 24a2adfa27 am: f6883504c2 am: b1894abbc5
am: 443f3aa138

Change-Id: I7d3bfdf6d95d5db2d31439b5c3334569666864e1
2017-07-19 08:20:23 +00:00
Hugo Benichi
443f3aa138 Merge "ConnectivityServiceTest: fix testNetworkInfoOfTypeNone" am: 24a2adfa27 am: f6883504c2
am: b1894abbc5

Change-Id: I458a0fdae874039e0f1d5cd38ed8ad0a1754bba9
2017-07-19 08:15:12 +00:00
Hugo Benichi
b1894abbc5 Merge "ConnectivityServiceTest: fix testNetworkInfoOfTypeNone" am: 24a2adfa27
am: f6883504c2

Change-Id: I432f419d1c8f93136a76cbadfd32018294b3e3d7
2017-07-19 08:09:38 +00:00
Hugo Benichi
f6883504c2 Merge "ConnectivityServiceTest: fix testNetworkInfoOfTypeNone"
am: 24a2adfa27

Change-Id: I4be1d2ce67871c1e01364beca886fdd3af374321
2017-07-19 08:04:48 +00:00
Hugo Benichi
c1014509d8 ConnectivityServiceTest: fix testNetworkInfoOfTypeNone
This patch fixes a couple of flakyness issues with
testNetworkInfoOfTypeNone. It also fixes some typos and naming issues.

Bug: 62918393, 62918393
Test: runtest frameworks-net
Change-Id: I1c56557ab113d3ef57dbc06a6e882634d03c5b09
2017-07-19 15:08:49 +09:00
Hugo Benichi
31097a6341 Merge "IpManager: fix test for default ProvisioningConfiguration" am: 2627d4856b am: 361162b636 am: fe88fa947e
am: 93c5a4b389

Change-Id: I7c66b30f5f7961900c3b5a5baf0c14644cbcb69e
2017-07-19 01:31:28 +00:00
Hugo Benichi
93c5a4b389 Merge "IpManager: fix test for default ProvisioningConfiguration" am: 2627d4856b am: 361162b636
am: fe88fa947e

Change-Id: I4bbbf0997f5bf9a1ebba1eb9968471fff9f297fe
2017-07-19 01:22:59 +00:00
Hugo Benichi
fe88fa947e Merge "IpManager: fix test for default ProvisioningConfiguration" am: 2627d4856b
am: 361162b636

Change-Id: Id72cd94c481bdc106ed022582399687b9abcc22b
2017-07-19 01:15:12 +00:00
Hugo Benichi
361162b636 Merge "IpManager: fix test for default ProvisioningConfiguration"
am: 2627d4856b

Change-Id: I087aee995858ae898f5d660c11552724a07503c3
2017-07-19 01:06:59 +00:00
Treehugger Robot
2627d4856b Merge "IpManager: fix test for default ProvisioningConfiguration" 2017-07-19 00:58:11 +00:00
Lorenzo Colitti
6a5fe34edf resolve merge conflicts of a1d67fb38e to stage-aosp-master
am: 8228eb3446

Change-Id: Ic9ba31da8e5281c9dbc8fa7ff56a63956a495b72
2017-07-18 23:37:57 +00:00
Lorenzo Colitti
8228eb3446 resolve merge conflicts of a1d67fb38e to stage-aosp-master
Test: make -j64 services
Change-Id: I3955b01189993f3051c608bc5d07a87e4e3b5f0b
Merged-In: Ic1e799c17b4bb0272cf85e03d5ad14981a55defa
2017-07-19 07:35:31 +09:00
Charles He
fa9c0be357 Merge "Opt-out for always-on VPN" 2017-07-18 18:47:45 +00:00
Lorenzo Colitti
4ca0ba8f86 Fetch tethering offload stats.
Make tethering offload register an ITetheringStatsProvider and
fetch tethering stats from the hardware.

Currently we fetch stats in the following cases:

1. Just after changing upstreams, we fetch stats from the
   previous upstream.
2. When we are polled by NetworkStatsService.

(cherry-picked from commit 5a7dea1a8e)

Bug: 29337859
Bug: 32163131
Test: builds, boots
Test: stats appear in tethering logs
Change-Id: If744f2e06cb6a3095a40199936b9afb76eff7b56
Merged-In: If744f2e06cb6a3095a40199936b9afb76eff7b56
2017-07-19 00:55:37 +09:00
Hugo Benichi
c10fe5f463 IpManager: fix test for default ProvisioningConfiguration
The test did not properly account for the stopAllIP() done in starting
state of the IpManager state machine, which could cause assertions to
fail when stopAllIP() is called again after stop().

Bug: 62988545
Test: runtest frameworks-net
Change-Id: I2c6eb76461a81c1d743bf448da36c58a99ce082d
2017-07-18 21:31:17 +09:00
Hugo Benichi
822c5bf778 IP connectivity metrics: fix tests after proto update
Update to ipconnectivity.proto in commit
6d2f506bfd 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
3673863f3b 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
Lorenzo Colitti
041111ff7e Merge changes Icc5aa605,If744f2e0,Ie1b5a5e4 into oc-dr1-dev
am: 3756636ad6

Change-Id: Ic1e799c17b4bb0272cf85e03d5ad14981a55defa
2017-07-14 01:01:29 +00:00
Hugo Benichi
a30cb89dfa resolve merge conflicts of 4f2a0fe213 to stage-aosp-master am: a428392c1d
am: 164ff8a2ed

Change-Id: I08195e119f866acc9fe1795b892fe45cea3c7f47
2017-07-14 00:46:49 +00:00
Hugo Benichi
164ff8a2ed resolve merge conflicts of 4f2a0fe213 to stage-aosp-master
am: a428392c1d

Change-Id: Ide67520d074330ec050ded71118bff0bc88be784
2017-07-14 00:37:20 +00:00
Hugo Benichi
a428392c1d resolve merge conflicts of 4f2a0fe213 to stage-aosp-master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I61cfb2d4798350f28f1bb36aed67ee8f18895031
2017-07-14 07:25:51 +09:00
Treehugger Robot
4f2a0fe213 Merge "IpManager: define InitialConfiguration" 2017-07-13 20:45:21 +00:00
Hugo Benichi
fd31b9d46e 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 2757fcf3a1)

Change-Id: I48dbf89232d7758f1b07ed4d76ce93281e5c6b53
2017-07-14 04:26:42 +09:00
Lorenzo Colitti
5a7dea1a8e Fetch tethering offload stats.
Make tethering offload register an ITetheringStatsProvider and
fetch tethering stats from the hardware.

Currently we fetch stats in the following cases:

1. Just after changing upstreams, we fetch stats from the
   previous upstream.
2. When we are polled by NetworkStatsService.

Bug: 29337859
Bug: 32163131
Test: builds, boots
Test: stats appear in tethering logs
Change-Id: If744f2e06cb6a3095a40199936b9afb76eff7b56
2017-07-13 23:54:51 +09:00
Erik Kline
17a62281e4 Merge "Program offload-exempt local prefixes into the HAL" am: de837a97aa
am: ae21b89414

Change-Id: If96a33f26fed64a84219868d28765b7581ad453d
2017-07-13 09:07:01 +00:00
Erik Kline
ae21b89414 Merge "Program offload-exempt local prefixes into the HAL"
am: de837a97aa

Change-Id: I741b6e31fb3adc922f47df824188786ff35e3aa9
2017-07-13 09:00:56 +00:00
Erik Kline
5acb4e3b62 Program offload-exempt local prefixes into the HAL
Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passes
    - observed calls to the HAL setLocalPrefixes in tethering log
Bug: 29337859
Bug: 32163131
Merged-In: I3c3bd4ee83ffe86ddbe6a16fbbfa0756bf5064d4
Merged-In: Iaf80e584df458010741401fc1a19e7f6e21923c1
Merged-In: Ifaf23c6179ead9de6ccfcf41e0c203025153167b
(cherry picked from commit 32179ff815)

Change-Id: I65ea833ac6fe7a75ebe546cfa358c4cffdf2de05
2017-07-13 16:43:34 +09:00
Erik Kline
b3d2aaaf2f Merge "Program offload-exempt local prefixes into the HAL" into oc-dr1-dev
am: aa7b8b5322

Change-Id: Iaf80e584df458010741401fc1a19e7f6e21923c1
2017-07-13 07:36:50 +00:00
Erik Kline
32179ff815 Program offload-exempt local prefixes into the HAL
Additionally:
    - move mOffloadController into MasterTetherSM

Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passes
    - observed calls to the HAL setLocalPrefixes in tethering log
Bug: 29337859
Bug: 32163131
Change-Id: Ifaf23c6179ead9de6ccfcf41e0c203025153167b
2017-07-13 13:45:49 +09:00
Erik Kline
d21ad47d43 Merge "Restructure use of absent tether_offload_disabled setting" am: 5bb30496cf
am: c8b4ef85dc

Change-Id: I2210e9d25a4e7c497b9383324e574c9f8aca0d6f
2017-07-12 06:25:04 +00:00
Erik Kline
c8b4ef85dc Merge "Restructure use of absent tether_offload_disabled setting"
am: 5bb30496cf

Change-Id: I9d1ec7d1c060278018c80c9374d724ee0ddba3a4
2017-07-12 06:18:11 +00:00
Erik Kline
5eaa7ed03b Restructure use of absent tether_offload_disabled setting
This restructures the fetching of the default disposition such
that we disable (and enable) the feature with only a single
character change.

Additionally: fix unittests with proper use of FakeSettingsProvider.

Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passed with developer enabled and disabled
Bug: 29337859
Bug: 32163131
Bug: 63250751
(cherry picked from commit c87cd41184)
Merged-In: Ib32489d07778465134bca52c589baddbd78ab129
Merged-In: I03d68b0da192fbd6172639343d4ab88c20127ad7
Merged-In: I10c0af2b2c4f6b6e613380e637cc3acb1f7a55a3

Change-Id: Ie16a022be8dacd76b0402bcb777680c36163a084
2017-07-12 13:29:22 +09:00
Erik Kline
9d9b5c22f1 Merge "Restructure use of absent tether_offload_disabled setting" into oc-dr1-dev
am: d8fdb26ebf

Change-Id: I03d68b0da192fbd6172639343d4ab88c20127ad7
2017-07-12 03:11:15 +00:00
Ahmed ElArabawy
4dd7c58fc8 Add Configuration to APF Policy
in b/37702435 battery was drained due to reception of
Ethernet frames with Eth-type < 0x600 (non ehternet II frames)

This change adds an XML file to drop/allow these frames
Dropping helps tp avoid acquiring a wakelock for the
reception of these packets, while allowing them may be needed
for some protocols
The Change allow the OEM to override the system settings

Bug: 37702435
Test: runtest frameworks-net
Merged-In: Idb6c215896ef230a8136ff4ecefc90ccdc5c1c6d

Change-Id: Idb6c215896ef230a8136ff4ecefc90ccdc5c1c6d
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
2017-07-11 22:16:16 +00:00
Erik Kline
c87cd41184 Restructure use of absent tether_offload_disabled setting
This restructures the fetching of the default disposition such
that we disable (and enable) the feature with only a single
character change.

Additionally: fix unittests with proper use of FakeSettingsProvider.

Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passed with developer enabled and disabled
Bug: 29337859
Bug: 32163131
Bug: 63250751

Change-Id: Ib32489d07778465134bca52c589baddbd78ab129
2017-07-11 23:46:58 +09:00
Hugo Benichi
f060ecf1e8 Merge "ConnectivityManager: allow usage of TYPE_NONE" am: 279f32ded5 am: 0537f16516
am: 0278aa4b70

Change-Id: I1707e39308b0cf425b75e1e3f85323743c252c2f
2017-07-05 14:47:56 +00:00
Hugo Benichi
0278aa4b70 Merge "ConnectivityManager: allow usage of TYPE_NONE" am: 279f32ded5
am: 0537f16516

Change-Id: If6430976a3a894b9f883e03692e500eb013a5245
2017-07-05 14:40:34 +00:00
Hugo Benichi
0537f16516 Merge "ConnectivityManager: allow usage of TYPE_NONE"
am: 279f32ded5

Change-Id: I72dbd17db63bd7b8637e82f5cdcfec3bf1482962
2017-07-05 14:33:35 +00:00
Hugo Benichi
89c67d3211 Merge "ConnectivityServiceTest: more informative assert failures" am: 04d8a730a9 am: 0a7f5cc9d6
am: 14f400ca81

Change-Id: If00f0fd750d54074c0c642465384446502c1deec
2017-07-05 14:33:34 +00:00
Hugo Benichi
14f400ca81 Merge "ConnectivityServiceTest: more informative assert failures" am: 04d8a730a9
am: 0a7f5cc9d6

Change-Id: If152d2eb134f678673b76b181146874bf65fc536
2017-07-05 14:26:23 +00:00
Hugo Benichi
0a7f5cc9d6 Merge "ConnectivityServiceTest: more informative assert failures"
am: 04d8a730a9

Change-Id: Iaa55014ae4c2f4927059735c349c40ada836b79b
2017-07-05 14:19:33 +00:00
Hugo Benichi
7ee7b4c6d4 Merge "ConnectivityServiceTest: eliminate remaining sleep()" am: 66788dc4d8 am: 2d452e6c48
am: 80bc56bf2a

Change-Id: I5e33e909cd8887460c2641c069432ec6bfa5beda
2017-07-05 12:49:04 +00:00
Hugo Benichi
80bc56bf2a Merge "ConnectivityServiceTest: eliminate remaining sleep()" am: 66788dc4d8
am: 2d452e6c48

Change-Id: I6426659d9cf84f7e1d142b006ffe69df304f7a91
2017-07-05 12:41:53 +00:00