Commit Graph

3858 Commits

Author SHA1 Message Date
Lorenzo Colitti
2121eeec48 Merge "Address ConnectivityManager API comments." into oc-dev 2017-04-28 03:58:16 +00:00
Lorenzo Colitti
139a48c83c Address ConnectivityManager API comments.
Bug: 36370941
Test: marlin builds and boots
Change-Id: I693ee5270bf186c88c7c5056293519f7237504ff
2017-04-28 00:58:00 +09:00
Hugo Benichi
eebf240d12 Merge "NsdManager: unit tests for argument validation" am: 3cff7deecb am: d97e358f7a
am: 48947de481

Change-Id: I8a51ff51071adc60fe9f4d99ec629edabbed353d
2017-04-27 13:09:02 +00:00
Hugo Benichi
2018a29a88 Merge "NsdService: disentangle NativeDaemonConnector from ctor" am: fa97f11b20 am: 47748b754c
am: 5d0bd13538

Change-Id: Ic8ddf92c7c64d4214a75bea6d6e5083f4612a76a
2017-04-27 13:06:59 +00:00
Hugo Benichi
bad1bfedcd NsdManager: unit tests for argument validation
Test: new tests pass.
Bug: 37013369, 33298084
Change-Id: Ia514d2bbd967d46fed54e379f319b572ade22c62
2017-04-27 16:35:48 +09:00
Hugo Benichi
59ade871f8 NsdService: disentangle NativeDaemonConnector from ctor
This patch disentangles the creation of NativeDaemonConnector from the
creation of NsdService by introducing a wrapper type DaemonConnection.

This allows to mock this dependency in unit tests.

Test: enhanced previously introduced new tests.
Bug: 37013369, 33298084
Change-Id: I894b7cddfc509f86d0134d214c88c063b81b5e0a
2017-04-27 16:35:30 +09:00
Hugo Benichi
a5cd2bc5eb Merge "NsdService: bootstrap unit tests" am: 0f0ab71fb1 am: dd53c962b2
am: d29ce6ae8c

Change-Id: Iaf0679790e934baaaf48bcb04098aa18deca4d60
2017-04-27 05:49:47 +00:00
Hugo Benichi
0f0ab71fb1 Merge "NsdService: bootstrap unit tests" 2017-04-27 05:22:54 +00:00
Erik Kline
fecbdc5ce1 Merge "Clarify some IpManager/ApfFilter debugging output." into oc-dev
am: 40ccb1b5aa

Change-Id: Ie883f62bdc731c8da3b3d5ac1df827e1fd5b44be
2017-04-27 03:58:12 +00:00
Erik Kline
a069fc8481 Merge "Clarify some IpManager/ApfFilter debugging output." am: ce94c07ffd am: 3cc7ccfc69
am: b1914ebb50

Change-Id: If64f2b8a5cdf8b946a82a0c97a42cf61ef5e0b08
2017-04-27 00:35:25 +00:00
Erik Kline
6a14375cc2 Clarify some IpManager/ApfFilter debugging output.
Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passes
    - "adb shell dumpsys wifi ipmanager" shows updated output
Bug: 34793131
Change-Id: I6dec135b97343943efb421ef7b2e84c4751dd5ea
(cherry picked from commit af579eb5b516296a8ec0b02d824f2ba646e60ca2)
2017-04-26 17:17:04 +09:00
Erik Kline
aca4fac0db Clarify some IpManager/ApfFilter debugging output.
Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passes
    - "adb shell dumpsys wifi ipmanager" shows updated output
Bug: 34793131
Change-Id: I6dec135b97343943efb421ef7b2e84c4751dd5ea
2017-04-26 17:14:47 +09:00
Etan Cohen
e6d346bc06 Merge "[AWARE] Add UID checking to WifiAwareNetworkSpecifier" am: 7b6ba2b3ea am: 3c6305cc55
am: 887fd90742

Change-Id: I8480ac43d89dc85b541e6255c3cdc597393896cf
2017-04-25 13:40:42 +00:00
Etan Cohen
7b6ba2b3ea Merge "[AWARE] Add UID checking to WifiAwareNetworkSpecifier" 2017-04-25 13:21:36 +00:00
Hugo Benichi
8e8532c8f3 NetworkCapabilities: remove duplicated TRANSPORT_NAMES
Due to multi-branch automerging issue, TRANSPORT_NAMES got inserted
twice into NetworkCapabilities both by commits 45670bb37d and
21665ac809. This patch deletes one of the copy.

Test: no functionality change. Build is fixed.
Change-Id: I2adec1a9cb1ee6f1d61dfeec2d0b92b8141eed88
2017-04-25 16:31:06 +09:00
Hugo Benichi
91c45e4dbb NsdService: bootstrap unit tests
Test: new tests part of $ runtest frameworks-net
Bug: 37013369, 33298084
Change-Id: Ief45f838268380b4b2a128390fbf34d55a3b922b
2017-04-25 10:42:58 +09:00
Jeff Sharkey
1ee1487e29 Merge "Even more auto-doc work." into oc-dev
am: 880f4f4cc2

Change-Id: I78199f8366fbda65a4b4917675291d946e29285c
2017-04-24 21:38:03 +00:00
Jeff Sharkey
656584aa8d Even more auto-doc work.
Update docs based on what new lint detector found.  Add new @IntDef
to parameters or methods returning constants or flags, and add
@RequiresPermission to methods mentioning permissions.

Test: make -j32 offline-sdk-docs
Bug: 37526420
Change-Id: I7f640f7883fcb66b911a52ae93b83f77306571ec
2017-04-24 13:20:46 -06:00
Hugo Benichi
50ad9442a8 Merge "Move byte logics from ApfFilter into BitsUtil" am: 21b9b3a8ff am: 12c1074c8b
am: a80bb82b4e

Change-Id: I5f13b006b57cc8a3ab0560626077d003ce4fe8c8
2017-04-24 19:07:37 +00:00
Hugo Benichi
b22a842978 Merge "Add BitUtils bit packing methods (Connectivity metrics: add transports pretty printing)" am: 10b5024d5e am: 23d41ee68e
am: 876ebaa8e1

Change-Id: I0dfcea2b92287115c385f1b7678034f643d5daba
2017-04-24 19:06:20 +00:00
Hugo Benichi
330ae0ac78 Move byte logics from ApfFilter into BitsUtil
This patch extracts into BitUtils byte manipulation helper methods
and unsigned type manipulation helper methods from ApfFilter into
an independent and reusable structure.

Test: $ runtest frameworks-net
Change-Id: I0f33af10457a63dbde5983f14353a79b8cd877d9
2017-04-22 10:07:03 +09:00
Hugo Benichi
72ba66b48a Merge changes I5187d17c,I49a76582 am: 8b41dd0318 am: f2e5cf715d
am: 31259c219f

Change-Id: I174179db3a08ba51aef737cfb3956d1cf789b362
2017-04-22 00:59:36 +00:00
Hugo Benichi
21665ac809 Add BitUtils bit packing methods (Connectivity metrics: add transports pretty printing)
This patch is a partial cherry-pick from commit
cf83a3f4da for the BitUtils and
NetworkCapabilities classes.

Bug: 34901696
Test: none

(cherry picked from commit cf83a3f4da)

Merged-In: Id04f9080e7f75608deeb49306aec34941e71794c
Change-Id: I64eae49f646365b7cd1683a689315fe03bf0bdd9
2017-04-22 09:58:42 +09:00
Hugo Benichi
3fdd0bf76a Merge "NsdManager: add unit tests" am: dc1684ab07 am: 40ab8401b2
am: d2181235b9

Change-Id: I7a5202be0e6a6274f3bd11737f30fee0ef947235
2017-04-22 00:57:48 +00:00
Hugo Benichi
8b41dd0318 Merge changes I5187d17c,I49a76582
* changes:
  ConnectivityService: regroup bool <-> int conversions
  ConnectivityService: move reportNetworkConnectivity to handler
2017-04-22 00:34:07 +00:00
Hugo Benichi
dc1684ab07 Merge "NsdManager: add unit tests" 2017-04-22 00:31:28 +00:00
Robert Greenwalt
c99a35d0f7 Merge "Mark Restricted APN connections as restricted." am: a6a4f5589c am: 1778682242
am: 88a6acb9f6  -s ours

Change-Id: I7a0019557721593761ae605db8e28bf4e15c06b0
2017-04-21 23:36:13 +00:00
Treehugger Robot
a6a4f5589c Merge "Mark Restricted APN connections as restricted." 2017-04-21 23:12:52 +00:00
Robin Lee
8fc4ec1ec4 Merge "Use Vpn rules (not firewall) for always-on VPN" am: dcb162176e am: cd8557d15a
am: 4de3794c26

Change-Id: Ic1e96eac68ddc8a713b3c71b5c126cb8b99c59f5
2017-04-21 22:17:15 +00:00
Robert Greenwalt
1f4578fa86 Mark Restricted APN connections as restricted.
If anything unrestricted is bundled in the whole thing has to be
unrestricted (we can't restrict based on destination or intent)
but the NOT_METERED flag wasn't taken into account.

This wasn't a problem before because telephony set that statically
and late, but a change caused it to be marked NOT_METERED earlier
which exposed this bug.

bug: 37208956
Merged-In: I7b7a1c38621ce0ecde8cf041e82b1ebb7a9c6f15
Test: new NetworkCapabilitiesTest.  Fails without fix, works with.
Change-Id: I86c1b2854413a94662aa53e697d32380695ab9ac
2017-04-21 22:00:17 +00:00
Treehugger Robot
dcb162176e Merge "Use Vpn rules (not firewall) for always-on VPN" 2017-04-21 21:53:15 +00:00
Etan Cohen
1b6d418785 [AWARE] Add UID checking to WifiAwareNetworkSpecifier
Wifi Aware networks are per app - i.e. a requestor gets
a dedicated network. Change verifies that the only the
original requestor matches the created network (using UID).

Bug: 36053921
Test: Integration (sl4a) tests
Change-Id: I4ff3994731dd7ccb88e2bea333d1e6905b136f02
2017-04-21 18:47:35 +00:00
Erik Kline
1712602711 Merge "Add local-only hotspot info into tether state change broadcast" into oc-dev
am: 83e2a25461

Change-Id: I5c91199114ee1a48629523377fc06deda48f5579
2017-04-21 07:01:35 +00:00
Hugo Benichi
f4210294ac ConnectivityService: regroup bool <-> int conversions
This patch cleanups conversion of boolean values to ints when reading
configuration values or sending Messages whose arg1 or arg2 has boolean
semantics.

Test: runtest frameworks-net
Change-Id: I5187d17cd746486f63b1c410d191c30edd93ff6f
2017-04-21 15:18:51 +09:00
Hugo Benichi
d6b510a23e ConnectivityService: move reportNetworkConnectivity to handler
This patch moves reportNetworkConnectivity onto the handler of
ConnectivityService.

This allows:
  - to inspect NetworkAgentInfo on the ConnectivityService handler,
    which is always more correct than doing so on a Binder thread.
  - to improve locking policies around NetworkAgentInfo.

Test: $ runtest frameworks-net
Bug: 37119619, 36902662
Change-Id: I49a765826e65c29a1995242290e5e7544112c94e
2017-04-21 15:17:54 +09:00
Hugo Benichi
7f792c577a NsdManager: add unit tests
This prepares some refactoring and the addition of a timeout to
resolveService.

Test: new tests pass
Bug: 37013369, 33298084
Change-Id: Ie8277bd5983278507bfa70495b4ce7d13895b24b
2017-04-21 05:16:37 +00:00
Erik Kline
5dbf59c901 Add local-only hotspot info into tether state change broadcast
Test: as follows
    - build
    - flashed
    - booted
    - "runtest frameworks-net" passes
    - manually starting tethering shows Settings and icon updates
Bug: 31466854
Bug: 32163131

Change-Id: I938074587dfeec221c5cdb43a392802ad3fc3589
2017-04-21 13:26:04 +09:00
Erik Kline
015d03a4d1 Merge "Add local-only hotspot info into tether state change broadcast" am: 21a081bf34 am: 6af3dd0fc3
am: 3fa8908370

Change-Id: If3851c3f15314e3c0d357e154049aaa2b8b5c8e7
2017-04-20 14:02:24 +00:00
Hugo Benichi
6fa7889bd8 Merge "ConnectivityManager: remove obsolete callback types" am: afeeac07e2 am: 23ee1621c7
am: b51307e12e

Change-Id: I2f5fad0b559b972e82ecacdfcdd3805f0fbb2655
2017-04-20 13:59:32 +00:00
Erik Kline
278c771b04 Merge "Make tetherChangePermission to be secured for AppOps permission" am: d721dd8ebb am: 0d1f04384f
am: d9bfb83d96

Change-Id: I6dd418684b1a40292cd496ead3613cf938577c09
2017-04-20 13:52:35 +00:00
Hugo Benichi
981ee3f2c3 resolve merge conflicts of 7bbd03be361f to oc-dev-plus-aosp
Conflits were:
  - static import section of ConnectivityService
  - code deleted in commit 8d96292e08

Test: built.
Change-Id: I0e026522558f39d8ae6812b62a30f2501923ab86
2017-04-20 22:26:50 +09:00
Treehugger Robot
21a081bf34 Merge "Add local-only hotspot info into tether state change broadcast" 2017-04-20 12:47:55 +00:00
Hugo Benichi
afeeac07e2 Merge "ConnectivityManager: remove obsolete callback types" 2017-04-20 12:38:29 +00:00
Erik Kline
762fa8eb96 Add local-only hotspot info into tether state change broadcast
Test: as follows
    - build
    - flashed
    - booted
    - "runtest frameworks-net" passes
    - manually starting tethering shows Settings and icon updates
Bug: 31466854
Bug: 32163131

Change-Id: I938074587dfeec221c5cdb43a392802ad3fc3589
2017-04-20 19:44:01 +09:00
Erik Kline
d721dd8ebb Merge "Make tetherChangePermission to be secured for AppOps permission" 2017-04-20 04:28:53 +00:00
Hugo Benichi
9c7059e371 Merge "ConnectivityManager: unify prety printing of callback types." 2017-04-20 04:28:45 +00:00
Hugo Benichi
f8a0f9f873 ConnectivityManager: remove obsolete callback types
This patch also:
  - suppresses callback triggers from ConnectivityService for these
    obsolete callback types.
  - marginally refactors callCallbackForRequest().

Test: runtest frameworks-net
Change-Id: Idfb75640732943c599de4975f252f706d21ad594
2017-04-20 10:42:38 +09:00
Hugo Benichi
8d96292e08 ConnectivityManager: unify prety printing of callback types.
And also remove some small code duplication (checkNotNull).

Test: built, flashed, runtest frameworks-net
Change-Id: Id6c13bca9d12f70b88806032e0a4fa198efbedc6
2017-04-20 10:42:38 +09:00
Robert Greenwalt
c2a92c30ea Merge commit 'd6c9efa3323f3f5ae44abe312ae5a1e6ef3816ce' into manual_merge_d6c9efa3323f
Change-Id: I86d5e87cc3884d8fc3eb326a92b8871ef0926aa6
2017-04-19 11:24:03 -07:00
Tetsutoki Shiozawa
b47da283e7 Make tetherChangePermission to be secured for AppOps permission
Symptom:
AppOps verified the incorrect package of calling tether state
changing API.
It threw SecurityException by mistake.

Solution:
Pass the correct package name to enforceTetherChangePermission.

Bug: 32931147
Change-Id: Ia1167f26f556678b189a24a4a716f1a7e5cb12eb
2017-04-19 16:50:33 +09:00