Commit Graph

2277 Commits

Author SHA1 Message Date
Amin Shaikh
38724a234d Merge "Support multiple caches in NetworkScoreService." am: 78f3f0049e am: a7c0b73971 am: b45a4a5d1b
am: 5456cdbc27

Change-Id: I421cff1c47959c40088a31f72556630a8acd007e
2016-12-08 17:24:32 +00:00
Amin Shaikh
b45a4a5d1b Merge "Support multiple caches in NetworkScoreService." am: 78f3f0049e
am: a7c0b73971

Change-Id: Idf846f55436c44930f5db2a07b7362412274f46e
2016-12-08 02:24:59 +00:00
Amin Shaikh
972e236e84 Support multiple caches in NetworkScoreService.
- Use RemoteCallbackList for managing multiple callbacks
- Add unregisterNetworkScoreCache to the service interface
- Added NetworkScoreServiceTest

Test: runtest frameworks-services

Bug: 32913019
Change-Id: I16ca1682acca9cbe403812e520394688a026414b
2016-12-07 15:52:33 -08:00
Erik Kline
7549504970 Merge "Handle IpReachabilityMonitor errors better." am: 3af34c8e0a
am: 4467b79592

Change-Id: I5d4d2d9888d85a684425b8204785099f818e6546
2016-12-07 09:30:09 +00:00
Erik Kline
b406666cf5 Handle IpReachabilityMonitor errors better.
If construction of a new IpReachabilityMonitor throws an IAE then
log it and immediately call onProvisioningFailure().

Test: runtest frameworks-wifi
      passes, except for selectQualifiedNetworkDoesNotChooseDeletedEphemeral()
      which fails with an NPE for unrelated reasons.

Bug: 31038971
Bug: 31742703
Change-Id: Ie91b8bdd509d06ad54d062bf446e74c092eb096c
(cherry picked from commit e452660466)
2016-12-07 16:23:26 +09:00
Jeremy Joslin
33e8de479a Merge "API for requesting network recommendations." am: 800a4e753e
am: 2b57c69e25

Change-Id: I8f2357942919193a22e97e4f1d9ec415b736565c
2016-12-07 00:05:29 +00:00
Jeremy Joslin
2b57c69e25 Merge "API for requesting network recommendations."
am: 800a4e753e

Change-Id: Icda431682a283051d4f5f5052dc70b8ab8e01dc9
2016-12-06 23:58:13 +00:00
Bill Yi
82834baa35 Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD 2016-12-06 15:17:16 -08:00
Jeremy Joslin
d1daf6d22a API for requesting network recommendations.
Defining a new system API that will allow the system to request
network recommendations from a NetworkScoreService implementation.

Test: Coming in a future CL.
BUG: 32909424
Merged-In: I2d5c0a843b928b04e87c1862a78702a02fd54c31
Change-Id: Idd33095c6cd2f5b391796c900399f18a2c40fcc3
2016-12-06 12:48:30 -08:00
Jeremy Joslin
1397837af3 API for requesting network recommendations.
Defining a new system API that will allow the system to request
network recommendations from a NetworkScoreService implementation.

Test: Coming after the API is approved.
BUG: 32909424
Change-Id: I2d5c0a843b928b04e87c1862a78702a02fd54c31
2016-12-06 07:33:25 -08:00
TreeHugger Robot
c770b052ad Merge changes I71ed6927,If5687e31
* changes:
  NetworkMonitor: send one DNS probe per web probe
  NetworkMonitor metrics: add first validation information
2016-12-03 20:08:47 +00:00
Hugo Benichi
147aa6d53b NetworkMonitor metrics: add first validation information
This patch adds first validation information to:
  - ValidationProbeEvent, by extending the probe_type int field of to
    also include a bit indicating if the probe was part of a first
    validation attempt or not.
  - NetworkMonitorEvent, by defining new contants for the event_type
    field.

Test: $ runtest frameworks-net
      + manually generating events and inspecting the
        output of $ adb shell dumpsys connmetrics list
Bug: b/32198726
Change-Id: If5687e310ddd18ed3096f8ecbdfc2ef866519234
2016-12-04 03:38:54 +09:00
Jeff Sharkey
d3f689bf14 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
Change-Id: I66a8a78480e087acdcf8a11e79f80b7a7a4969c9
2016-12-02 12:25:03 -07:00
Jeff Sharkey
fb833f38a0 Detect content:// leaving apps without grants.
Developers regularly put content:// Uris into Intents, but they can
easily forget to add FLAG_GRANT_READ_URI_PERMISSION to actually
extend a permission grant to the receiving app.

Also fix NPE when path is missing.

Test: builds, boots, common actions work without triggering
Bug: 32447617, 31900890
Change-Id: Ic6054b1d73de50967cf7fe66abc293c60a41b97e
2016-12-01 15:01:19 -07:00
Amin Shaikh
fb0cd67264 Merge "Refactor NetworkScoreAppManager for testing." am: 3af97482f1 am: a8fc97d2de am: d136025272
am: f9f477454e

Change-Id: Ied1038387d5be28a4d723b71dc633ed035125c1b
2016-12-01 02:31:36 +00:00
Amin Shaikh
f9f477454e Merge "Refactor NetworkScoreAppManager for testing." am: 3af97482f1 am: a8fc97d2de
am: d136025272

Change-Id: I2190eb09039d7abc51d4752c410d1d38e220564b
2016-12-01 02:26:50 +00:00
Amin Shaikh
d136025272 Merge "Refactor NetworkScoreAppManager for testing." am: 3af97482f1
am: a8fc97d2de

Change-Id: I34ed2f31eaa1336990c941ee63eea0c1ddbc305c
2016-12-01 02:21:03 +00:00
Amin Shaikh
a8fc97d2de Merge "Refactor NetworkScoreAppManager for testing."
am: 3af97482f1

Change-Id: I99537b7841021704c162db6b8fe3d472ede1e991
2016-12-01 02:10:55 +00:00
Amin Shaikh
aa09aa0210 Refactor NetworkScoreAppManager for testing.
Test: runtest frameworks-services && runtest frameworks-core
Change-Id: Ie2172009e9ba0438050488fe0aea6408f852c2c2
2016-11-30 13:52:43 -08:00
TreeHugger Robot
776a2402fa Merge "Revert "Introduce RoughtimeClient"" 2016-11-28 17:54:37 +00:00
Darren Krahn
10a092d9a3 Revert "Introduce RoughtimeClient"
This reverts commit 89ef028898.

Change-Id: I74826aa6990891df3be4f931b242398824c370d1
2016-11-28 16:19:40 +00:00
Jeff Sharkey
f640cd318d Merge "StrictMode to detect untagged network traffic." am: 67fe28d925 am: db5ed5beb1 am: 3391f3376e
am: 55727aaede

Change-Id: I272964fc9c2a9e350bacc0586dd6b2d4a23c5f51
2016-11-21 23:05:12 +00:00
Jeff Sharkey
55727aaede Merge "StrictMode to detect untagged network traffic." am: 67fe28d925 am: db5ed5beb1
am: 3391f3376e

Change-Id: I942f9c44a8c3b1abf39694816a34790df3e224ad
2016-11-21 21:58:02 +00:00
Jeff Sharkey
3391f3376e Merge "StrictMode to detect untagged network traffic." am: 67fe28d925
am: db5ed5beb1

Change-Id: Id6ce5cfedab250f25c0eb8b0c49971e9e20cbeb2
2016-11-21 21:48:31 +00:00
Jeff Sharkey
db5ed5beb1 Merge "StrictMode to detect untagged network traffic."
am: 67fe28d925

Change-Id: I52cdce87d87ec503294e431c8f22e87235bdbf79
2016-11-21 21:43:58 +00:00
Treehugger Robot
67fe28d925 Merge "StrictMode to detect untagged network traffic." 2016-11-21 21:33:15 +00:00
Jeff Sharkey
763a140796 StrictMode to detect untagged network traffic.
Define some constants for early use in AOSP code.

Test: builds, boots, all common traffic tagged
Bug: 30943431
Change-Id: Ia58a8933bccfddbc027afb78c63ae65bd71ce562
2016-11-21 12:15:16 -07:00
Casey Dahlin
89ef028898 Introduce RoughtimeClient
Roughtime is Google's new network time protocol[1] and we'd like to
start using it for some devices in place of/in addition to NTP. This
patch gets the beginnings of an implementation off the ground, with tests.

[1] https://roughtime.googlesource.com/roughtime/

Test: New unit tests pass
Bug: 30834326
Change-Id: I401d8ad59c82dda514fd3c4be63804f46814251d
2016-11-18 13:16:35 -08:00
Erik Kline
5f4a37c9aa Handle IpReachabilityMonitor errors better. am: e452660466
am: d8a06fa28a

Change-Id: I820f887205de7565bbf70fe66de66680fa571475
2016-11-09 02:48:22 +00:00
Erik Kline
d8a06fa28a Handle IpReachabilityMonitor errors better.
am: e452660466

Change-Id: I3bb9ce7caa99e166ddc576399453fcc9e172d6a6
2016-11-09 02:37:17 +00:00
Erik Kline
e452660466 Handle IpReachabilityMonitor errors better.
If construction of a new IpReachabilityMonitor throws an IAE then
log it and immediately call onProvisioningFailure().

Test: runtest frameworks-wifi
      passes, except for selectQualifiedNetworkDoesNotChooseDeletedEphemeral()
      which fails with an NPE for unrelated reasons.

Bug: 31038971
Bug: 31742703
Change-Id: Ie91b8bdd509d06ad54d062bf446e74c092eb096c
2016-11-08 16:02:24 +09:00
Etan Cohen
a99a05982e Merge "[NAN-AWARE] Rename NAN to Aware" am: 74b1131cc8
am: 6571007101

Change-Id: Ief54b313dc5ca5d30645b55ed2ad0333036a1671
2016-11-06 03:21:37 +00:00
Etan Cohen
6571007101 Merge "[NAN-AWARE] Rename NAN to Aware"
am: 74b1131cc8

Change-Id: I2e788e19a11f2709f2e542dbdc4b58433a3574bf
2016-11-06 03:13:31 +00:00
Etan Cohen
0849ded008 [NAN-AWARE] Rename NAN to Aware
~Rename only (and any reformatting needed to pass lint) - no
functional changes!

Remove android.net.wifi.nan.STATE_CHANGED from manifest:
redundant/remnant of an older configuration.

(cherry-pick of commit a61b9fb569)

Bug: 32263750
Test: All unit tests and integration (sl4a) tests pass.
Merged-In: Ie4ff675fa61041e8fcf6a9bf9900ea835d0a7614
Change-Id: I4206d2fd722dc7dec9df4aee5c818101d7f9dccc
2016-11-05 09:41:38 -07:00
Etan Cohen
0413327d74 [NAN-AWARE] Rename NAN to Aware
~Rename only (and any reformatting needed to pass lint) - no
functional changes!

Remove android.net.wifi.nan.STATE_CHANGED from manifest:
redundant/remnant of an older configuration.

(cherry-pick of commit a61b9fb569)
(cherry-pick of commit b061f21e7e59a99834e163e2baa1c82229e419a6)

Bug: 32263750
Test: All unit tests and integration (sl4a) tests pass.
Change-Id: Ie4ff675fa61041e8fcf6a9bf9900ea835d0a7614
2016-11-04 15:42:08 -07:00
Stephen Chen
2514787897 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.

Change-Id: I968b9e3352d7880e3fc438f12de628a2da057e0a
2016-11-04 09:55:21 -07:00
Michal Karpinski
dd9bb4fdd9 [DPM] DO can start network logging and listen for events
This CL adds:
1) Setter and getter in DPM to manipulate logging switch (retrieval
method to come in a subsequent CL(s)).
2) A way for DPM to register to listen for events.
3) Skeleton of NetworkLogger class (more to come in subsequent CL(s)).

Bug: 29748723
Change-Id: I5c04662ccc6febd2ba294b0eaca1ed1da9c16e47
2016-11-02 08:52:53 +00:00
TreeHugger Robot
03db8e4b58 Merge changes I1a544a8d,Ie78d3fb0
* changes:
  IpConnectivityMetrics: rate limit ApfProgramEvents
  IpConnectivityMetrics reads buffer size in settings
2016-10-24 14:45:46 +00:00
Hugo Benichi
e1c173d224 IpConnectivityMetrics: rate limit ApfProgramEvents
This patch uses the previously introduced TokenBucket to rate limit
ApfProgramEvents, still allowing for burst of ApfProgramEvents when a
new interface is set up (due to ipv4 provisioning, multicast lock, ipv6 RAs
triggering new APF program events in short amounts of time).

Test: new test in IpConnectivityMetricsTest
Bug: 1550402
Change-Id: I1a544a8d62e6b02f0ed0088ab76c4bad338d2f44
2016-10-24 21:54:37 +09:00
Jeremy Joslin
807102d7ff VPN network stat accounting changes. am: 3f0d75afe8
am: 0d309b7a47

Change-Id: I797ac586581f83ada0e94639dd435122c987f1c1
2016-10-21 23:43:06 +00:00
Jeremy Joslin
3f0d75afe8 VPN network stat accounting changes.
Properly account for VPN apps that make heavy use of the tun
interface. Prior to this change a VPN app could be incorrectly charged
for more data than it actually used if it sent more traffic through
the tun interface than the underlying interface.

This change excludes VPN app traffic on the tun interface from the
adjustment pool and doesn't redistribute traffic to the VPN app.
Instead all of the redistributed traffic is deducted from the VPN app
which effectively represents any overhead incurred by the VPN app.

BUG: 30557871
Change-Id: I62a75a0c0c0111e052b7903baa9f5d6d94ef57fd
2016-10-21 18:47:57 +09:00
TreeHugger Robot
8d48570f45 Merge "ConnectivityManager: use ConnectivityThread looper" 2016-10-21 01:49:46 +00:00
Hugo Benichi
7724cdd8b9 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
Change-Id: I431afcee7c7155bd7bac23a2e1e97fd5d6520c74
2016-10-21 08:54:34 +09:00
Hugo Benichi
c9eb24ceab Merge "ConnectivityThread: use lazy holder idiom" 2016-10-20 23:49:03 +00:00
Hugo Benichi
5cc311774d Merge "ConnectivityManager: a simpler CallbackHandler" 2016-10-20 23:46:30 +00:00
Hugo Benichi
c4fe5d373c 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

Change-Id: I4d5672a3195d3af9a0a2c85f871695257abe782b
2016-10-20 09:30:13 +09:00
Hugo Benichi
d42650faaa 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
Change-Id: I5004da5b91498e6ff7f8b05057a9e24b975bb56e
2016-10-20 09:09:02 +09:00
Christopher Wiley
bfe052cb73 Merge "Use this.isUp() inside InterfaceConfiguration" am: 239df3cc5a am: c6e72b30c7
am: 31ac117bef

Change-Id: If2c93c4affbdb3c1f27f874c509147f2cf50337f
2016-10-19 19:53:15 +00:00
Christopher Wiley
c6e72b30c7 Merge "Use this.isUp() inside InterfaceConfiguration"
am: 239df3cc5a

Change-Id: Id6f064d7a74e41d757de2499653671fc830d217b
2016-10-19 19:31:57 +00:00
Christopher Wiley
87100cce39 Use this.isUp() inside InterfaceConfiguration
Bug: 31337216
Test: Compiles
Change-Id: I968a739f9ada47b1357932d2da76451eb26c3d5f
2016-10-17 10:32:40 -07:00