Commit Graph

2485 Commits

Author SHA1 Message Date
Elliot Waite
0ce4b0e4c3 Fix @links in reference docs. am: 54de77470d am: ab978c035e am: 28ba4722a9
am: 9b21265b2c

Change-Id: If246ebdb36cf2832d5a6c42cbe752e290b6fb6e8
2017-01-26 04:49:33 +00:00
Elliot Waite
9b21265b2c Fix @links in reference docs. am: 54de77470d am: ab978c035e
am: 28ba4722a9

Change-Id: I98177a8cf0a20677e140406bb7371474ca259e5b
2017-01-26 04:44:54 +00:00
Elliot Waite
28ba4722a9 Fix @links in reference docs. am: 54de77470d
am: ab978c035e

Change-Id: If0d0613362e0ea95cf48eaf9a16d3eea48b589ea
2017-01-26 04:39:57 +00:00
Elliot Waite
54de77470d Fix @links in reference docs.
Change-Id: I40cea46efd80c448640ff69753698fe8404da40b
2017-01-25 17:00:55 -08:00
TreeHugger Robot
dc4ffdabc6 Merge "Create an API for retrieving a badged wifi icon." 2017-01-26 00:59:20 +00:00
Jeremy Joslin
ba24273401 Implemented network score cache filtering.
NetworkScoreCaches registered with a filter type will now only
receive updates that match their filter criteria.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34127291
Change-Id: I3d5e6e57b6682707b0734259a2530658ad75dbb7
2017-01-24 17:33:47 -08:00
Amin Shaikh
15902eef8b Create an API for retrieving a badged wifi icon.
Bug: 34202067
Test: ./gts-tradefed run gts -m GtsNetTestCases -t com.google.android.net.gts.wifi.NetworkBadgingTest
Change-Id: Ia3bf9c0a489ae08de8d635aa620cbccca22af1b2
2017-01-24 14:34:19 -08:00
Jeremy Joslin
5c5747e541 Merge "Mark the INetworkScoreCache as oneway." am: edadb3efc3 am: 4fcc44dc9a am: ea65f9d392
am: 577aac1385

Change-Id: I9044cfa8445014d08bc416e46811c57e5972d653
2017-01-24 18:41:47 +00:00
Jeremy Joslin
577aac1385 Merge "Mark the INetworkScoreCache as oneway." am: edadb3efc3 am: 4fcc44dc9a
am: ea65f9d392

Change-Id: I54af428743c036da20a0adbaa38d00ca348364fc
2017-01-23 21:42:00 +00:00
Jeremy Joslin
ea65f9d392 Merge "Mark the INetworkScoreCache as oneway." am: edadb3efc3
am: 4fcc44dc9a

Change-Id: I4d2dc6446f347643f654799094ac7f6fb7529438
2017-01-23 21:35:27 +00:00
Jeremy Joslin
4fcc44dc9a Merge "Mark the INetworkScoreCache as oneway."
am: edadb3efc3

Change-Id: I3b71e154f49b354ead2bf734da4a94e332f87a33
2017-01-23 21:31:21 +00:00
Jeremy Joslin
84fae83f8c Mark the INetworkScoreCache as oneway.
Test: built & run
Bug: 34522097
Change-Id: I7d2075febe6c3cdc24b56df255f8ba59e13322bf
2017-01-23 10:51:41 -08:00
Amin Shaikh
746a4de692 Merge "Add additional fields to RecommendationRequest." am: b8f0e69ef0 am: ac05acad45
am: b7b9c6f889

Change-Id: Ieade1643bfc4c9039d6d4f702bf3ec527679ce74
2017-01-20 23:30:39 +00:00
Amin Shaikh
b7b9c6f889 Merge "Add additional fields to RecommendationRequest." am: b8f0e69ef0
am: ac05acad45

Change-Id: I1062446bbd085b794bfe61843e670dc5af689d32
2017-01-20 23:23:39 +00:00
Amin Shaikh
ac05acad45 Merge "Add additional fields to RecommendationRequest."
am: b8f0e69ef0

Change-Id: I9a50c8aca36cf740abbc62af6879b4e6ea736855
2017-01-20 23:18:02 +00:00
Amin Shaikh
b50ade8bb0 Add additional fields to RecommendationRequest.
- Add networkId and timestamp for the last user selected network

Bug: 34467596
Test: runtest --path core/tests/coretests/src/android/net/RecommendationRequestTest.java
Change-Id: Ic81c1beede1a643cd428b6e5c57ed430a6b1ccc0
Merged-In: Ic81c1beede1a643cd428b6e5c57ed430a6b1ccc0
2017-01-20 09:37:59 -08:00
Jeff Sharkey
8e8269fc11 Merge "StrictMode to detect untagged network traffic." 2017-01-20 17:31:59 +00:00
TreeHugger Robot
459692adad Merge "Add additional fields to RecommendationRequest." 2017-01-20 17:30:02 +00:00
Jeff Sharkey
619a511d4f StrictMode to detect untagged network traffic.
Network usage is tracked by the kernel at the UID level, which is
granular enough for normal apps, but large components (such as the
system server) are impossible to debug without adding additional
socket tagging to help identify subsystems within a UID.

To help ensure that system components tag all their network traffic,
this change offers a new StrictMode option to detect and report
untagged sockets.

Test: builds, boots, all common traffic tagged
Bug: 30943431, 30414041
Change-Id: I825c7941076054732264690247de2863342638e2
2017-01-19 20:52:05 -07:00
Jeremy Joslin
261b5c4c49 Merge "Pass more data through the recommendation request." am: 00514f1dc0 am: ddfbe07e96
am: ec630d0bf0

Change-Id: I20ce25072262a7aef36b9fdaa317210283ca495f
2017-01-20 02:07:53 +00:00
Jeremy Joslin
ec630d0bf0 Merge "Pass more data through the recommendation request." am: 00514f1dc0
am: ddfbe07e96

Change-Id: Ib831f420dd6ca976f9ce72476028b18ea61e2211
2017-01-20 02:02:03 +00:00
Amin Shaikh
d47e6e9067 Add additional fields to RecommendationRequest.
- Add networkId and timestamp for the last user selected network

Bug: 34467596
Test: runtest --path core/tests/coretests/src/android/net/RecommendationRequestTest.java
Change-Id: Ic81c1beede1a643cd428b6e5c57ed430a6b1ccc0
2017-01-19 18:00:37 -08:00
Jeremy Joslin
ddfbe07e96 Merge "Pass more data through the recommendation request."
am: 00514f1dc0

Change-Id: I97e11e876bcb7ccdb55a333b31f9970ae5edd001
2017-01-20 01:52:38 +00:00
Jeremy Joslin
122957b0b0 Pass more data through the recommendation request.
Expanding the API so it can accept the WiFi config of the currently
connected network (if any) and the set of connectable WiFi
configurations. Also renamed currentRecommendedWifiConfig to
defaultWifiConfig so the name was more representative of the
parameter's purpose and added more documentation throughout.

Test: adb shell am instrument -e class android.net.RecommendationRequestTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: adb shell am instrument -w com.android.networkrecommendation.tests/android.support.test.runner.AndroidJUnitRunner
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34387385
Change-Id: Ib8c3cab8f92b5c9da806070d32412f688690f82f
Merged-In: I1089b70303b0396def7e6bf3737fdc67e40c9dcd
2017-01-19 16:14:21 -08:00
Jeremy Joslin
43be63722b Merge "Have requestRecommendation return a CompletableFuture." am: f48d0bb2dc am: 887ee2c32a
am: 40f432a56b

Change-Id: I6936bd7bd64ae5da665ece4d9f401849feceed3e
2017-01-20 00:02:14 +00:00
Jeremy Joslin
40f432a56b Merge "Have requestRecommendation return a CompletableFuture." am: f48d0bb2dc
am: 887ee2c32a

Change-Id: Ia9252f5375da2a4292293a7d895ec3cbd0c9203e
2017-01-19 23:46:45 +00:00
Jeremy Joslin
887ee2c32a Merge "Have requestRecommendation return a CompletableFuture."
am: f48d0bb2dc

Change-Id: I409c6c46144cbbfc147df7c3d3e251bd6b5fbe62
2017-01-19 23:37:46 +00:00
Jeremy Joslin
53526459dd Async network recommendation requests. am: cb925074d3 am: c9d378e212
am: 428e6cd1db

Change-Id: Ifb0d27a912c2ca82d6dc18b513e1bc12c0215df1
2017-01-19 23:21:09 +00:00
Sundeep Ghuman
5519b7b873 Add rankingScores and badges to WifiPicker.
Adds support to request scores in WifiTracker and then plumb
those scores via AccessPoint.java. AccessPoints will sort on
ranking scores. Show badging in WifiSettings picker.

Bug: 33457699, 33778046
Test: Unit tests
Change-Id: Icc3161cf147b3a9715d6e9f56af574e52ae6c832
2017-01-19 15:13:09 -08:00
Jeremy Joslin
428e6cd1db Async network recommendation requests. am: cb925074d3
am: c9d378e212

Change-Id: I66ea5246f35e6665c1ffb01e6314293a59f6acca
2017-01-19 23:11:08 +00:00
Jeremy Joslin
c9d378e212 Async network recommendation requests.
am: cb925074d3

Change-Id: I9e3ac1f778d6e9bfe817225423f80540230633e3
2017-01-19 23:03:06 +00:00
Jeremy Joslin
88f50a5a08 Have requestRecommendation return a CompletableFuture.
Reworked the new requestRecommendation call to return a
CompletableFuture instead of using a custom callback.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 33784158
Change-Id: Ib12f0674d45ad6e2e21449bc3665467b3c20f49d
Merged-In: If24a94eb6289cb1952052b2cc3bc7856ce2192a5
2017-01-19 13:31:16 -08:00
Jeremy Joslin
cb925074d3 Async network recommendation requests.
Exposing a new hidden API method that allows network recommendations
to be requested asynchronously.

Test: Built & run.
BUG:33784158
Change-Id: I8d210b686138cb42bf69185f0b2f2d25dfcb9dd1
Merged-In: I8f84b09f43a6c5fae5d8f03ec01e75c25b4b62d6
2017-01-19 13:18:21 -08:00
Jeremy Joslin
3ef77d3d0c Remove NetworkScorerAppManager.isCallerActiveScorer().
The method is no longer used.

Test: adb shell am instrument -e class android.net.NetworkScorerAppManagerTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Bug: 33781558
Change-Id: I2b4acd54a747bd480a4a91bac424d39e264ea882
2017-01-19 09:55:26 -08:00
TreeHugger Robot
96415fb603 Merge "Pass more data through the recommendation request." 2017-01-19 15:29:42 +00:00
TreeHugger Robot
488c294ad9 Merge "Have requestRecommendation return a CompletableFuture." 2017-01-18 23:42:56 +00:00
Jeremy Joslin
26a45e5b13 Pass more data through the recommendation request.
Expanding the API so it can accept the WiFi config of the currently
connected network (if any) and the set of connectable WiFi
configurations. Also renamed currentRecommendedWifiConfig to
defaultWifiConfig so the name was more representative of the
parameter's purpose and added more documentation throughout.

Test: adb shell am instrument -e class android.net.RecommendationRequestTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: adb shell am instrument -w com.android.networkrecommendation.tests/android.support.test.runner.AndroidJUnitRunner
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34387385
Change-Id: I1089b70303b0396def7e6bf3737fdc67e40c9dcd
2017-01-18 15:00:06 -08:00
Jeremy Joslin
a480795e34 Have requestRecommendation return a CompletableFuture.
Reworked the new requestRecommendation call to return a
CompletableFuture instead of using a custom callback.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 33784158
Change-Id: If24a94eb6289cb1952052b2cc3bc7856ce2192a5
2017-01-18 14:27:43 -08:00
Makoto Onuki
20b0af8099 Merge "Support protofied dumpsys for NetStats" 2017-01-18 21:30:20 +00:00
Stephen Chen
c926b7399a DO NOT MERGE: Implement metered tracking for NetworkStats summary queries.
Dependent on ag/1550196 where API is defined.

Bug: 31015360
Bug: 26545374
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkStatsTest.java,
other test classes.

(cherry picked from commit 2514787897)

(cherry picked from commit 963e8ddf6d)

Change-Id: I79e401fc4159264a075febba82bd8c295b8e677f
2017-01-18 19:08:41 +09:00
Jeff Sharkey
389b853bc8 DO NOT MERGE: Switch over to new "time.android.com" NTP pool.
Also add logging to measure success/failure details.

Test: builds, boots, and NTP fix obtained
Bug: 32969463

(cherry picked from commit d3f689bf14)

(cherry picked from commit dda938a698)

Change-Id: I67e4f54f8f2ec69b6522fbbe06ef196b1084f44a
2017-01-18 19:08:35 +09:00
Hugo Benichi
0f1f54d4d1 DO NOT MERGE: ConnectivityThread: use lazy holder idiom
This patch changes the way that the ConnectivityThread is lazily
instantiated by using the "lazy initialization holder class idiom".

The first code point that tries to obtain a reference to the unique
ConnectivityThread instance will trigger the creation of the Singleton
class, which will guarantee a thread-safe initialization of the static
INSTANCE field inside Singleton according to the language specs.

This is the Item #71 of Effective Java.

The unique static instance of ConnectivityThread is not stored directly
inside ConnectivityThread class but is stored in a static nested class.
This is to avoid triggering the creation of that unique instance when
Zygote does class preloading at phone startup. Otherwise this would lead
to Zygote creating a new OS thread during preloading, which is a fatal
error.

Test: frameworks-wifi tests pass
Bug: 26749700
Bug: 28537383
Bug: 32130437

(cherry picked from commit c4fe5d373c)

(cherry picked from commit ce765b7a51)

Change-Id: Ic9a31809ef19e618246f9aa17f5df29bd65f8510
2017-01-18 19:08:23 +09:00
Hugo Benichi
e804d3773c DO NOT MERGE: ConnectivityManager: use ConnectivityThread looper
This patch removes the static singleton looper used by
ConnectivityManager and instead uses the common ConnectivityThread.

This allows to removes the static atomic counter used to track
the number of registered NetworkCallback in ConnectivityManager, because
the looper is not turned off anymore when no callbacks are registered.

Also an overloaded version of sendRequestForNetwork is added taking as a
new parameter a Handler. This will allow to overload various callback
and request related API calls with user provided Handlers.

Test: ConnectivityServiceTest passes
Bug: 26749700
Bug: 28537383
Bug: 32130437

(cherry picked from commit 7724cdd8b9)

(cherry picked from commit 1853f78d76)

Change-Id: If5c1e46ca6c4a09ef526cbe09654c5f55ef8d6ce
2017-01-18 19:08:21 +09:00
Hugo Benichi
791ee32a62 DO NOT MERGE: ConnectivityManager: a simpler CallbackHandler
This patch simplifies CallbackHandler in the following way:
  - CallbackHandler directly uses the static references to
    sNetworkCallback and sCallbackRefCount. This allows to remove
    instance fields in CallbackHandler.
  - CallbackHandler does not have a reference to ConnectivityManager
    anymore
  - CallbackHandler.getObject() is now generic in a type-safe way.

Test: ConnectivityServiceTest passes
Bug: 28537383
Bug: 32130437

(cherry picked from commit d42650faaa)

(cherry picked from commit 4983e55853)

Change-Id: I4d0b2441b6af76bc56b19218210a2a381532a3c4
2017-01-18 19:08:18 +09:00
Philip P. Moltmann
81deef84fb DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
Fixes: 28530428

(cherry picked from commit 7d5da4b044)

(cherry picked from commit 29154b000f)

Change-Id: Ib8f8da947af804c8b203928e57ed6a8aedbf0684
2017-01-18 19:08:16 +09:00
Jeremy Klein
27089aadfb DO NOT MERGE: Add a null check for the OnStartTetheringCallback.
This avoids a NullPointerException when trying to call the callback
and gives a more readable error message.

(cherry picked from commit 5f277e1667)

(cherry picked from commit c8e4cc8e99)

Change-Id: Ia5f328c4b25aa6624dc3c8493eb0c7bbab99904c
2017-01-18 19:08:14 +09:00
Erik Kline
e9e251fcfb DO NOT MERGE: Support timeouts for requestNetwork() invocations.
(cherry-pick of 06c3ef1367)
(cherry picked from commit 57faba9ec7)

Bug: 21414325

(cherry picked from commit 3841a48d0a)

Change-Id: I640c43315a071ecbf881e5ce898164915e0b787f
2017-01-18 19:07:33 +09:00
Makoto Onuki
da65a52f87 Support protofied dumpsys for NetStats
Bug 34228873
Test: manual tests with "incident_report netstats"

Change-Id: I359b364c64d9798fd4229018a905658d5d46ea5c
2017-01-17 14:16:01 -08:00
Jeremy Joslin
998d7ca56a Async network recommendation requests.
Exposing a new hidden API method that allows network recommendations
to be requested asynchronously.

Test: Built & run.
BUG:33784158
Change-Id: I8f84b09f43a6c5fae5d8f03ec01e75c25b4b62d6
2017-01-17 12:37:07 -08:00
Sundeep Ghuman
7a9612f032 Fix ScoredNetwork: unparcel bundle in toString.
Calling isEmpty will ensure the bundle is unparceled before converting
to a string.

Test: dumped network_score
Change-Id: Icaa4e736af55c6112805a2ce0e829739bbb5b312
2017-01-12 18:45:52 -08:00