Commit graph android_packages_modules_Co.../core
Message SHA1
Merge "ConnectivityManager: fix style issue" am: e74f3adba5 am: ec54a40339
am: 84e0cbf218

Change-Id: Iecf5399d77ae742cc66ac7a3cab4570464c4e95f

Hugo Benichi   authored and   android-build-merger   commited 2017-06-22 19:46:28 +00:00
dd05bd6dbe
Merge "ConnectivityManager: fix style issue" am: e74f3adba5
am: ec54a40339

Change-Id: I5a420534268a0daec19f1f0677dcfe7abd8faf73

Hugo Benichi   authored and   android-build-merger   commited 2017-06-22 08:03:46 +00:00
84e0cbf218
Merge "Better errors from unregisterNetworkCallback" am: 04e89ad631 am: ca6ebb0f39
am: 3ff91f42c1

Change-Id: Ia959388c875c22e56f5f2867f33a7329ce4b3535

Hugo Benichi   authored and   android-build-merger   commited 2017-06-20 05:26:40 +00:00
c436380ebf
Merge "Better errors from unregisterNetworkCallback" am: 04e89ad631
am: ca6ebb0f39

Change-Id: Ib380ee7c3fc85db353682ee7abfe97842eaeeb29

Hugo Benichi   authored and   android-build-merger   commited 2017-06-20 05:19:46 +00:00
3ff91f42c1
ConnectivityManager: fix style issue
Simple style fix flagged by linter.

Test: no functional change.
Change-Id: I2cb19912cba149eeaffdd157616d210259d42959

Hugo Benichi   commited 2017-06-20 14:11:57 +09:00
7ab07a36c9
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

Hugo Benichi   commited 2017-06-19 22:11:50 +09:00
bee30fe597
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

Robert Quattlebaum   commited 2017-06-06 18:38:31 +00:00
103292d0b7
Merge "Annotate @SystemApi with required permissions." into oc-dev
am: c1406978a4

Change-Id: I305967cad945a807c3f8234efabaad0ef8b591d1

Jeff Sharkey   authored and   android-build-merger   commited 2017-06-05 22:28:21 +00:00
53d8c2b663
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

Jeff Sharkey   commited 2017-06-05 13:27:11 -06:00
9b39e9abdb
Merge "ConnectivityManager: simplify callback handler" am: 5e6af581e4 am: 7bce658dd6
am: a67fb638fa

Change-Id: I3934666df4a02101351993f7f83fb0a42124a2f5

Hugo Benichi   authored and   android-build-merger   commited 2017-05-23 06:37:24 +00:00
0b379f7f69
Merge "ConnectivityManager: improve argument validation" am: 3ca6c89b37 am: 0187514f74
am: b800e8520e

Change-Id: Idfc0938025c633c89f5bfddd88b3721876d085ef

Hugo Benichi   authored and   android-build-merger   commited 2017-05-23 03:41:52 +00:00
ea0c83ccb7
ConnectivityManager: simplify callback handler
Bug: 36701874
Test: $ runtest frameworks-net
Change-Id: I4d5f08903a54f8dced7cb6ae86703847b908b784

Hugo Benichi   commited 2017-05-23 10:39:46 +09:00
b6c2406c4c
ConnectivityManager: improve argument validation
Using Preconditions and dedicated static methods for checking arguments
to improve error stack traces without error messages.

Test: covered by previously added unit test
Bug: 36701874
Change-Id: Id872b2c887a4bca43a8c3644622add1c2ee57c6d

Hugo Benichi   commited 2017-05-23 10:39:45 +09:00
bc1104b465
Merge "Address ConnectivityManager API comments." am: 37c09c96b9 am: b57db6ef97
am: 08ab9ea526

Change-Id: I8e5e44043bb7efde3e21650e7edf3f121aff1e6e

Hugo Benichi   authored and   android-build-merger   commited 2017-05-19 23:36:09 +00:00
85c5572cc2
Merge "Address ConnectivityManager API comments."
Hugo Benichi   authored and   Gerrit Code Review   commited 2017-05-19 23:05:57 +00:00
37c09c96b9
Add a method to start the captive portal login app.
Bug: 36203355
Bug: 36656914
Test: ConnectivityServiceTest (including new test) passes
Change-Id: Ide82858af67024623560ab79beea27c201b63447
Merged-In: I82a9a9a8da47870ba3f1bbef5941b37e970c844f

(cherry picked from commit 500dbae1b5)

Lorenzo Colitti   authored and   Hugo Benichi   commited 2017-05-19 00:58:41 +00:00
de1e515306
Address ConnectivityManager API comments.
This patch is a cherry pick of the two following commits:
  - 139a48c83c which addresses several
    issues in the public api of ConnectivityManager.
  - 4c11db0fdd which fixes the documentation
    of several methods in ConnectivityManager public api.

Because the first commit change the public api that is referenced in
the documentation fixed by the second commit, it is not possible to one
without the other. In both cases trying to cherry pick only one of them
results in a build error.

The first commit was submitted successfully on an internal branch before
the checks done in the built got stricter.

Bug: 36370941
Test: marlin builds and boots
Change-Id: I86dcf056e6b165e527c3ee88dbabc2764ac09a08
Merged-In: I693ee5270bf186c88c7c5056293519f7237504ff

(cherry picked from commit 139a48c83c)

Hugo Benichi   commited 2017-05-17 21:48:05 +09:00
5ac64c51f5
Merge "Remove unused import in ConnectivityManager" am: db6fc1afe8 am: fe098f8207
am: e13c192d0f

Change-Id: Ib8368c5a8538914cba2723368c03618401ac159f

Hugo Benichi   authored and   android-build-merger   commited 2017-05-16 13:25:09 +00:00
216aae5188
Remove unused import in ConnectivityManager
This makes the pre-upload verification pass.

Test: no functional change.
Change-Id: I6beccea10ccfcb39d975cb8f6f34fc9d79f1e170

Hugo Benichi   commited 2017-05-16 11:39:08 +09:00
5d426da614
Merge changes Ie762ce75,I611fd791 am: 21a57f263f am: cc9f695ba0
am: 164854bde2

Change-Id: I1495249f1ced84438dbd5dd0ad6678e2ee4062cb

Hugo Benichi   authored and   android-build-merger   commited 2017-05-11 14:28:23 +00:00
39294ce0cd
ConnectivityManager: uses service error codes and exceptions
This patch introduces between ConnectivityManager and
ConnectivityService a mechanism for propagating back to clients
informative errors in the form of error codes and associated custom
runtime exceptions.

Without error code, the service can only throw a limited number of
different exceptions over Binder. Furthermore the throw site stack
traces are always loss. Although for individual instances of a throw,
the error message can be inspected, aggregations of stack traces from
app crashes sanitize error messages and only leaves the stack traces.

This makes debugging dificult for some service calls such as
requestNetwork that can have a variety of failure modes.

In this patch only one failure mode is codified. More can be added later
at a light cost by: 1) defining an error code, 2) defining an
associated exception, 3) mapping the code to the exception. This patch
can serves as a template for doing so.

Test: $ runtest frameworks-net,
      #testNetworkRequestMaximum() detects the new exception type.
Bug:  36556809, 36701874
Change-Id: I611fd7915575c9e418f7149fcdc8a879d2a3716d

Hugo Benichi   commited 2017-05-11 14:15:15 +09:00
a590ab8373
Move some NetworkStats tests to tests/net.
This groups them together with the rest of the networking unit
tests. It also speeds up compile/test cycles ("runtest -x" of one
file goes from 1m15s to 30s).

Bug: 33681750
Test: runtest frameworks-net passes on internal tree
Merged-In: I53cb0c51355fe4b4b30e451fa09fbbf58da39efd
Change-Id: I5ae5dbf74c94feb0fe3759681e5e6d6fba62fa32

(cherry picked from commit c86013be936f36c61fa0cdfad95141f6de3c6ef7)

Lorenzo Colitti   authored and   Hugo Benichi   commited 2017-05-08 08:38:08 +00:00
f7ffa460e4
Merge "Add a method to start the captive portal login app." into oc-dev
am: 5555b1e3d1

Change-Id: Ic7c14bd3dfd07f97c04901f043ed1cd3b1eee6e4

Lorenzo Colitti   authored and   android-build-merger   commited 2017-05-02 04:44:31 +00:00
d388cbb9e4
Add a method to start the captive portal login app.
Bug: 36203355
Bug: 36656914
Test: ConnectivityServiceTest (including new test) passes
Change-Id: I82a9a9a8da47870ba3f1bbef5941b37e970c844f

Lorenzo Colitti   commited 2017-05-01 16:01:15 +09:00
500dbae1b5
Merge "Address ConnectivityManager API comments." into oc-dev
am: 2121eeec48

Change-Id: I7024b4fe23ab12760fb452a59929df886912b104

Lorenzo Colitti   authored and   android-build-merger   commited 2017-04-28 04:04:21 +00:00
a75dc7e122
Address ConnectivityManager API comments.
Bug: 36370941
Test: marlin builds and boots
Change-Id: I693ee5270bf186c88c7c5056293519f7237504ff

Lorenzo Colitti   commited 2017-04-28 00:58:00 +09:00
139a48c83c
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

Hugo Benichi   commited 2017-04-25 16:31:06 +09:00
8e8532c8f3
Merge "Even more auto-doc work." into oc-dev
am: 880f4f4cc2

Change-Id: I78199f8366fbda65a4b4917675291d946e29285c

Jeff Sharkey   authored and   android-build-merger   commited 2017-04-24 21:38:03 +00:00
1ee1487e29
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

Jeff Sharkey   commited 2017-04-24 13:20:46 -06:00
656584aa8d
Merge "Add BitUtils bit packing methods (Connectivity metrics: add transports pretty printing)" am: 10b5024d5e am: 23d41ee68e
am: 876ebaa8e1

Change-Id: I0dfcea2b92287115c385f1b7678034f643d5daba

Hugo Benichi   authored and   android-build-merger   commited 2017-04-24 19:06:20 +00:00
b22a842978
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

Hugo Benichi   commited 2017-04-22 09:58:42 +09:00
21665ac809
Merge "Mark Restricted APN connections as restricted."
Treehugger Robot   authored and   Gerrit Code Review   commited 2017-04-21 23:12:52 +00:00
a6a4f5589c
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

Robert Greenwalt   commited 2017-04-21 22:00:17 +00:00
1f4578fa86
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

Erik Kline   commited 2017-04-21 13:26:04 +09:00
5dbf59c901
Merge "Add local-only hotspot info into tether state change broadcast" am: 21a081bf34 am: 6af3dd0fc3
am: 3fa8908370

Change-Id: If3851c3f15314e3c0d357e154049aaa2b8b5c8e7

Erik Kline   authored and   android-build-merger   commited 2017-04-20 14:02:24 +00:00
015d03a4d1
Merge "ConnectivityManager: remove obsolete callback types" am: afeeac07e2 am: 23ee1621c7
am: b51307e12e

Change-Id: I2f5fad0b559b972e82ecacdfcdd3805f0fbb2655

Hugo Benichi   authored and   android-build-merger   commited 2017-04-20 13:59:32 +00:00
6fa7889bd8
Merge "Make tetherChangePermission to be secured for AppOps permission" am: d721dd8ebb am: 0d1f04384f
am: d9bfb83d96

Change-Id: I6dd418684b1a40292cd496ead3613cf938577c09

Erik Kline   authored and   android-build-merger   commited 2017-04-20 13:52:35 +00:00
278c771b04
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

Hugo Benichi   commited 2017-04-20 22:26:50 +09:00
981ee3f2c3
Merge "Add local-only hotspot info into tether state change broadcast"
Treehugger Robot   authored and   Gerrit Code Review   commited 2017-04-20 12:47:55 +00:00
21a081bf34
Merge "ConnectivityManager: remove obsolete callback types"
Hugo Benichi   authored and   Gerrit Code Review   commited 2017-04-20 12:38:29 +00:00
afeeac07e2
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

Erik Kline   commited 2017-04-20 19:44:01 +09:00
762fa8eb96
Merge "Make tetherChangePermission to be secured for AppOps permission"
Erik Kline   authored and   Gerrit Code Review   commited 2017-04-20 04:28:53 +00:00
d721dd8ebb
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

Hugo Benichi   commited 2017-04-20 10:42:38 +09:00
f8a0f9f873
ConnectivityManager: unify prety printing of callback types.
And also remove some small code duplication (checkNotNull).

Test: built, flashed, runtest frameworks-net
Change-Id: Id6c13bca9d12f70b88806032e0a4fa198efbedc6

Hugo Benichi   commited 2017-04-20 10:42:38 +09:00
8d96292e08
Merge commit 'd6c9efa3323f3f5ae44abe312ae5a1e6ef3816ce' into manual_merge_d6c9efa3323f
Change-Id: I86d5e87cc3884d8fc3eb326a92b8871ef0926aa6

Robert Greenwalt   commited 2017-04-19 11:24:03 -07:00
c2a92c30ea
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

Tetsutoki Shiozawa   authored and   Shunta Sato   commited 2017-04-19 16:50:33 +09:00
b47da283e7
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
Test: new NetworkCapabilitiesTest.  Fails without fix, works with.
Change-Id: I7b7a1c38621ce0ecde8cf041e82b1ebb7a9c6f15

Robert Greenwalt   commited 2017-04-18 11:29:20 -07:00
7316f068a7
Merge "ConnectivityManager: release all requests mapping to a callback." am: 1a8f04b1b2 am: 4d80366762
am: e505b37ec5

Change-Id: I99267e14ab04ce62c5c2385f24f5865e791a24a0

Hugo Benichi   authored and   android-build-merger   commited 2017-04-14 15:36:10 +00:00
82ed0de810
ConnectivityManager: release all requests mapping to a callback.
This patch changes how callback unregistration works in order to be
consistent with undocumented use cases currently de-facto supported
by the API (although in a buggy way):
  - callback recycling: releasing then reregistering a callback again.
  - multiple request registrations with the same callback.

The second use case is not desirable but needs to be taken into account
for now for the purpose of correctly releasing NetworkRequests
registered in ConnectivityService.

In order to support request release in both use cases with minimal
amount of complexity for the time being the following changes are done:
  - request to callback unmapping is done synchronously at callback
    release time.
  - all requests associated to a callback are unmapped at callback
    release time.

This fixes the following issues:
  - a callback stops being triggered as soon as it is released.
    Otherwise when recycling the callback immediately, it is possible
    the previous request associated with it triggers it, confusing the
    app.
  - when a callback is registered multiple times, the requests are not
    leaked.
  - when a callback is registered multiple times and then released, the
    N-1 first registrations do not trigger the callback anymore.

In the future it would be desirable to enforce the intended 1:1 mapping
between callbacks and requests at registration time.

Bug: 35921499, 35955593, 20701525
Test: - added new tests in ConnectivityManagerTest to test releasing,
      recycling, and a disabled test for no multiple regristration.
      - new tests catch regression causing b/35921499, b/35955593.
Change-Id: Ia0917ac322fc049f76adb4743bc745989fed6d26

Hugo Benichi   commited 2017-04-14 22:17:21 +09:00
2aa65af966
[CM] Unhide the NetworkSpecifier as object API
API visibility change: unhide allowing NetworkSpecifier
to be an arbitrary object.

Bug: 27533960
Bug: 36053921
Bug: 36275276
Test: builds and runs
Change-Id: I1d1705cca7ece077ef8d7c674c62d5369fedbb03
Merged-In: I7535495681da8f168c46d6d95e13925cffecc99b
Merged-In: I6500639ae839ee9ad5af34d1292d1539c943e2ad

Etan Cohen   authored and   Lorenzo Colitti   commited 2017-04-14 18:23:45 +09:00
fedaf00fa3