Commit Graph

3877 Commits

Author SHA1 Message Date
Lorenzo Colitti
d14f673516 Merge "Wakeup packet mark/mask configuration option" into oc-dr1-dev
am: d2eef601f6

Change-Id: I8297ca8d29d3aab18884a35953b0021ec265ce26
2017-07-06 16:09:49 +00:00
Joel Scherpelz
0e42c8a0ab 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 668370b9a5d36511f8f2cd58d6c6b0fc1020ee2d)

Change-Id: I95e75b11b973707bcb428ea6498fbfd8e717b855
2017-07-06 19:10:33 +09:00
Hugo Benichi
3d2b4e04f3 Merge "ConnectivityManager: allow usage of TYPE_NONE" am: d54a27d898 am: 93e1941b43
am: 0278aa4b70

Change-Id: I1707e39308b0cf425b75e1e3f85323743c252c2f
2017-07-05 14:47:56 +00:00
Hugo Benichi
93e1941b43 Merge "ConnectivityManager: allow usage of TYPE_NONE"
am: d54a27d898

Change-Id: I72dbd17db63bd7b8637e82f5cdcfec3bf1482962
2017-07-05 14:33:35 +00:00
Hugo Benichi
5c84e3b690 Merge "ConnectivityServiceTest: more informative assert failures" am: cc1feacd8d am: a64e822036
am: 14f400ca81

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

Change-Id: Iaa55014ae4c2f4927059735c349c40ada836b79b
2017-07-05 14:19:33 +00:00
Treehugger Robot
cc1feacd8d Merge "ConnectivityServiceTest: more informative assert failures" 2017-07-05 14:07:37 +00:00
Hugo Benichi
9ca9374aff Merge "ConnectivityServiceTest: eliminate remaining sleep()" am: 2af7cbd8b7 am: c521380789
am: 80bc56bf2a

Change-Id: I5e33e909cd8887460c2641c069432ec6bfa5beda
2017-07-05 12:49:04 +00:00
Hugo Benichi
c521380789 Merge "ConnectivityServiceTest: eliminate remaining sleep()"
am: 2af7cbd8b7

Change-Id: Ib1e31c2b8999d07b20ef4cef8e70d851f93df6e5
2017-07-05 12:35:01 +00:00
Hugo Benichi
ad353f451a 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
99495b1a4d ConnectivityServiceTest: more informative assert failures
Bug: 62918393
Test: runtest frameworks-net
Change-Id: If87315ef7cba6380596f48b92c7e0f6eeccc8368
2017-07-05 21:30:10 +09:00
Hugo Benichi
2af7cbd8b7 Merge "ConnectivityServiceTest: eliminate remaining sleep()" 2017-07-05 12:25:16 +00:00
Hugo Benichi
96d0a49b19 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
93caca72db Merge "Revert "ConnectivityManager: allow usage of TYPE_NONE"" am: a4fcd1a2b7 am: 8ad104e62c
am: bdcebe39e6

Change-Id: I428cb473221a403e3c78cbc5d1224d46747ec315
2017-07-04 11:46:56 +00:00
Roland Levillain
ee2e0723c7 Merge "Revert "ConnectivityServiceTest: more informative assert failures"" am: 959e3f9ac9 am: a17d7171d9
am: 3b2b9b6238

Change-Id: Id038c0f03a0edaff27b51878a6e2ee7aace7e7cb
2017-07-04 11:43:07 +00:00
Roland Levillain
efe62d5f06 Merge "Revert "ConnectivityServiceTest: eliminate remaining sleep()"" am: 1c5d788650 am: 2e99b8e7d2
am: a3909e0583

Change-Id: I8ecc2290d58b9e8f570ec404bbde1a2a60a89b75
2017-07-04 11:41:37 +00:00
Roland Levillain
8ad104e62c Merge "Revert "ConnectivityManager: allow usage of TYPE_NONE""
am: a4fcd1a2b7

Change-Id: I49221522c1a9a6e7d4ae72529c1a47b736e26a39
2017-07-04 11:31:30 +00:00
Roland Levillain
a17d7171d9 Merge "Revert "ConnectivityServiceTest: more informative assert failures""
am: 959e3f9ac9

Change-Id: Ie61051984a1b6efbb0b19754ce0fb99024ab296a
2017-07-04 11:24:25 +00:00
Roland Levillain
2e99b8e7d2 Merge "Revert "ConnectivityServiceTest: eliminate remaining sleep()""
am: 1c5d788650

Change-Id: If210f213c7840c218d5e847667c7613d53f86661
2017-07-04 11:22:32 +00:00
Roland Levillain
a4fcd1a2b7 Merge "Revert "ConnectivityManager: allow usage of TYPE_NONE"" 2017-07-04 11:15:18 +00:00
Roland Levillain
4bb710cb01 Revert "ConnectivityManager: allow usage of TYPE_NONE"
This CL is breaking some internal builds.

This reverts commit 0b7642a820.

Change-Id: Ie79214808d84c73f54a525f515b4c90a3fb23542
2017-07-04 11:14:03 +00:00
Roland Levillain
959e3f9ac9 Merge "Revert "ConnectivityServiceTest: more informative assert failures"" 2017-07-04 11:12:10 +00:00
Roland Levillain
a12b67eacf Revert "ConnectivityServiceTest: more informative assert failures"
CL https://android-review.googlesource.com/#/c/420720/ is
breaking several internal builds, and CL
https://android-review.googlesource.com/#/c/422480/ must
be reverted beforehand.

This reverts commit a0b7f12eb7.

Change-Id: I5883409452d39e1834e183aa7b5ccdbf14291ca5
2017-07-04 11:11:35 +00:00
Roland Levillain
1c5d788650 Merge "Revert "ConnectivityServiceTest: eliminate remaining sleep()"" 2017-07-04 11:11:09 +00:00
Roland Levillain
d5810f566f Revert "ConnectivityServiceTest: eliminate remaining sleep()"
CL https://android-review.googlesource.com/#/c/420720/ is
breaking several internal builds, and CL
https://android-review.googlesource.com/#/c/422481/ must
be reverted beforehand.

This reverts commit 137a0e6d16.

Change-Id: If0b196b6860c4087a05b28770469d7850a76fd37
2017-07-04 11:10:06 +00:00
Hugo Benichi
7f4b6d54b2 Merge "ConnectivityServiceTest: eliminate remaining sleep()" am: a1dca50b88 am: 745a3564e2
am: 2a7985a6d0

Change-Id: I3d53ece1c18cf1cf1e5e361231e321dcd59b5bad
2017-07-04 09:55:04 +00:00
Hugo Benichi
7c6b8f0138 Merge changes I90c211dc,I4455f272 am: a5ea99e288 am: 8a73d29f31
am: d0e5f1d280

Change-Id: Ia79936c51ec8236d5c92c19a8d2a3dff34f0e1a1
2017-07-04 09:49:06 +00:00
Hugo Benichi
745a3564e2 Merge "ConnectivityServiceTest: eliminate remaining sleep()"
am: a1dca50b88

Change-Id: I31a8f64b4ee37a58bc83c08251d949f44cc26fd4
2017-07-04 09:43:01 +00:00
Hugo Benichi
8a73d29f31 Merge changes I90c211dc,I4455f272
am: a5ea99e288

Change-Id: I502d978ff636a00979d2083c39381bf600d3d6da
2017-07-04 09:35:51 +00:00
Treehugger Robot
a1dca50b88 Merge "ConnectivityServiceTest: eliminate remaining sleep()" 2017-07-04 09:25:53 +00:00
Treehugger Robot
a5ea99e288 Merge changes I90c211dc,I4455f272
* changes:
  ConnectivityServiceTest: more informative assert failures
  ConnectivityManager: allow usage of TYPE_NONE
2017-07-04 09:22:07 +00:00
Hugo Benichi
137a0e6d16 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: I78426665670f702304212753f417b3d5a8a2c107
2017-07-04 16:23:06 +09:00
Hugo Benichi
a0b7f12eb7 ConnectivityServiceTest: more informative assert failures
Bug: 62918393
Test: runtest frameworks-net
Change-Id: I90c211dc6d6262475924ecabc2863c47aec5a0b9
2017-07-04 16:23:05 +09:00
Hugo Benichi
0b7642a820 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: I4455f2726d06406047086368628c1f253d854d8d
2017-07-04 16:22:59 +09:00
Joel Scherpelz
b5e29bf906 Merge "Wakeup packet mark/mask configuration option" am: 728e787ba1 am: 06cc72b5ec
am: 48360082bc

Change-Id: Ie5c88f5b91248a5f069decc0708f17af4b649710
2017-07-04 04:07:56 +00:00
Joel Scherpelz
06cc72b5ec Merge "Wakeup packet mark/mask configuration option"
am: 728e787ba1

Change-Id: Ief60fa8a594931c8968db7a9ea2872c030794088
2017-07-04 03:47:14 +00:00
Treehugger Robot
728e787ba1 Merge "Wakeup packet mark/mask configuration option" 2017-07-04 03:38:34 +00:00
Hugo Benichi
d7310564b8 Merge "Networking unit tests: fix some flaky tests" am: 501bae6492 am: ae3dac0601
am: 741fdea598

Change-Id: Ie5d8f2e01d14c4dc4fc83d1645130258ba92998d
2017-07-03 09:51:26 +00:00
Hugo Benichi
ae3dac0601 Merge "Networking unit tests: fix some flaky tests"
am: 501bae6492

Change-Id: I6815e732f334d11208ff12af4023912593d96499
2017-07-03 09:35:06 +00:00
Hugo Benichi
44ceaa602e Networking unit tests: fix some flaky tests
- less strict regex for SharedLogTest: the subsecond part of the
   timestamp can have 0, 1, 2 or 3 digits.
 - refactor NetworkStatsServiceTest and NetworkStatsObserversTest to use
   waitForIdleHandler facility of ConnectivityServiceTest.
   NetworkStatsServiceTest was using a flaky custom version of
   waitForIdleHandler.

Bug: 62918393
Bug: 32561414
Test: runtest frameworks-net
Change-Id: I634acfb5f4fe1bd5267e3f14b9f645edc32d5d12
2017-07-03 16:29:01 +09:00
liangweikang@xiaomi.com
d5aa5a6063 Merge "[BUG] java.util.MissingFormatArgumentException: Format specifier '%d'" am: 755c6ea768 am: 81173713d7
am: a900930d58

Change-Id: I180c73a8dc41ea907c1e7fd76624fce0a4b523d3
2017-07-03 00:40:18 +00:00
liangweikang@xiaomi.com
81173713d7 Merge "[BUG] java.util.MissingFormatArgumentException: Format specifier '%d'"
am: 755c6ea768

Change-Id: I1687f90ae7d042db2575ca10b168833e27adc7cb
2017-07-03 00:26:47 +00:00
Treehugger Robot
755c6ea768 Merge "[BUG] java.util.MissingFormatArgumentException: Format specifier '%d'" 2017-07-03 00:17:57 +00:00
Joel Scherpelz
946a3c9d7c 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

Change-Id: I2380b2383a593da35880d81cbade6eae4f79a776
2017-06-30 04:58:41 +00:00
liangweikang@xiaomi.com
e3888bb177 [BUG] java.util.MissingFormatArgumentException: Format specifier '%d'
Bug: https://issuetracker.google.com/issues/63121293

Test: null

Change-Id: I2745c415e21a7f26535605cc5bef7eaf2109ae8e
Signed-off-by: liangweikang@xiaomi.com <liangweikang@xiaomi.com>
2017-06-30 01:32:46 +00:00
Hugo Benichi
83be1f8817 Merge changes I193297e0,I43beb966 am: c729ff8253 am: 5dec1df23b -s ours
am: 82cd773397

Change-Id: Ic54e19a430fb16732197f289b46e5a3c8669d26f
2017-06-24 00:51:09 +00:00
Hugo Benichi
82cd773397 Merge changes I193297e0,I43beb966 am: c729ff8253
am: 5dec1df23b  -s ours

Change-Id: If036f9c7b4219a20ddb21d5aa1b7f3e3b29bee51
2017-06-24 00:40:48 +00:00
Robert Quattlebaum
b4ddb16892 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
Merged-In: Ie4aa77496f8ff466fa1a5fbc556e9c029457a689

(cherry pick from commit 103292d0b7)

Change-Id: I21f9b41b8b31c63ceeb1bc9c965f6da2614c356a

Test: runtest frameworks-net (not in original commit message)
2017-06-23 16:08:45 +09:00
Hugo Benichi
cbe178fa80 Connectivity metrics: serialize networkId, transports, ifname
This patch adds translation from ConnectivityMetricsEvent to
IpConnectivityEvent of recently added fields:
 - top-level network id
 - top-level ifname
 - transports

Also adds inference of link layer from transports or ifname.

At the moment these new fields are not populated in
ConnectivityMetricsEvent. Follow-up patches will fill this gap for
the events of the android.net.metrics package.

Test: new unit tests, $ runtest frameworks-net passes
Bug: 34901696
Merged-In: I563a6a3183470bdfaabb7c781a1beaf6b1058bf0

(partial cherry pick from commit 45f6ef836d)

Change-Id: I6a00270e73a1bd07f23c367f2394d90a43ced47a

Test: runtest frameworks-net (not in original commit message)
2017-06-23 16:07:38 +09:00