Commit Graph

3859 Commits

Author SHA1 Message Date
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
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
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
Hugo Benichi
dd05bd6dbe Merge "ConnectivityManager: fix style issue" am: e74f3adba5 am: ec54a40339
am: 84e0cbf218

Change-Id: Iecf5399d77ae742cc66ac7a3cab4570464c4e95f
2017-06-22 19:46:28 +00:00
Hugo Benichi
84e0cbf218 Merge "ConnectivityManager: fix style issue" am: e74f3adba5
am: ec54a40339

Change-Id: I5a420534268a0daec19f1f0677dcfe7abd8faf73
2017-06-22 08:03:46 +00:00
Hugo Benichi
7300842496 Merge changes I4d2be5d9,I34706201 into oc-dr1-dev
am: c649a9978a  -s ours

Change-Id: I576c2ff37bcf2885f0b126b9d66a3d3d23974146
2017-06-20 08:45:56 +00:00
Hugo Benichi
c436380ebf Merge "Better errors from unregisterNetworkCallback" am: 04e89ad631 am: ca6ebb0f39
am: 3ff91f42c1

Change-Id: Ia959388c875c22e56f5f2867f33a7329ce4b3535
2017-06-20 05:26:40 +00:00
Hugo Benichi
3ff91f42c1 Merge "Better errors from unregisterNetworkCallback" am: 04e89ad631
am: ca6ebb0f39

Change-Id: Ib380ee7c3fc85db353682ee7abfe97842eaeeb29
2017-06-20 05:19:46 +00:00
Hugo Benichi
7ab07a36c9 ConnectivityManager: fix style issue
Simple style fix flagged by linter.

Test: no functional change.
Change-Id: I2cb19912cba149eeaffdd157616d210259d42959
2017-06-20 14:11:57 +09:00
Hugo Benichi
412a2ee8a1 Better errors from unregisterNetworkCallback
This patch changes the validation of unregisterNetworkCallback in
ConnectivityManager so that the caller can better distinguish the case
of a callback that was never registered from the case of a callback that
has already been unregistered.

Bug: 62497809
Test: runtest frameworks-net passes
Merged-In: I58eda22725dd4e67dc4b64207e38cf482032df10

(cherry picked from commit 605b295011be74c786a2eef586d31ccb07160422)

Change-Id: I4d2be5d9037cfec03218b702d707f50808ee0694
2017-06-20 10:06:44 +09:00
Hugo Benichi
bee30fe597 Better errors from unregisterNetworkCallback
This patch changes the validation of unregisterNetworkCallback in
ConnectivityManager so that the caller can better distinguish the case
of a callback that was never registered from the case of a callback that
has already been unregistered.

Bug: 62497809
Test: runtest frameworks-net passes
Change-Id: I58eda22725dd4e67dc4b64207e38cf482032df10
2017-06-19 22:11:50 +09:00
Android Build Merger (Role)
8a822d3269 Merge "Update captive portal notif for Android TV am: e8e9dbcc23 am: e7ad4b1828" into oc-dr1-dev-plus-aosp 2017-06-10 07:36:23 +00:00
Rhiannon Malia
ea766e295b Update captive portal notif for Android TV am: e8e9dbcc23
am: 7ae4669125

Change-Id: I258a24b9069f5ded14c3cec53be3039086cbf0ba
2017-06-10 07:32:47 +00:00
Rhiannon Malia
e7ad4b1828 Update captive portal notif for Android TV
am: e8e9dbcc23

Change-Id: I60a67b0f22aa186e8b738b8a9ee002b2b5b04e42
2017-06-10 07:26:51 +00:00
Rhiannon Malia
7ae4669125 Update captive portal notif for Android TV
am: e8e9dbcc23

Change-Id: I2096324e76770fee698507c2681d9c2fd92165b9
2017-06-10 07:26:46 +00:00
Rhiannon Malia
e8e9dbcc23 Update captive portal notif for Android TV
Test: Connect to captive portal, notification appears in side panel

BUG:38453402
Change-Id: I39baf90897f2f3d67b8b03c31dd74fa1d39d39de
2017-06-10 05:22:42 +00:00
Robert Quattlebaum
103292d0b7 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
Change-Id: Ie4aa77496f8ff466fa1a5fbc556e9c029457a689
2017-06-06 18:38:31 +00:00
Jeff Sharkey
2cb5aedc15 Merge "Annotate @SystemApi with required permissions." into oc-dev am: c1406978a4
am: 53d8c2b663

Change-Id: Ib629e25dbf047c110feaf03e4ff744b5c6df9aeb
2017-06-06 15:48:24 +00:00
Jeff Sharkey
53d8c2b663 Merge "Annotate @SystemApi with required permissions." into oc-dev
am: c1406978a4

Change-Id: I305967cad945a807c3f8234efabaad0ef8b591d1
2017-06-05 22:28:21 +00:00
Jeff Sharkey
9b39e9abdb Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
2017-06-05 13:27:11 -06:00
Hugo Benichi
76fab4b83c Merge "Fix race condition in NsdManagerTest" am: f2383db747 am: 2dfb494827 am: ba82d646a6
am: ac7ad05464

Change-Id: Ia9237e9be9db7447985726be06a3d9020ab72087
2017-05-31 13:34:20 +00:00