Commit Graph

2027 Commits

Author SHA1 Message Date
Robin Lee
4632c0c9a8 Merge "Merge "Add lockdownEnabled parameter to always-on VPN API" into nyc-dev am: 7ec93a1ee2 am: 78d0888e8c" into nyc-mr1-dev-plus-aosp
am: 062a28b6a4

* commit '062a28b6a403a48d6f5f88e109a899c9c60581c1':
  Add lockdownEnabled parameter to always-on VPN API

Change-Id: I9ebd6221451ee10649a1f340031d62c6483832f1
2016-05-04 22:04:40 +00:00
Robin Lee
7ec93a1ee2 Merge "Add lockdownEnabled parameter to always-on VPN API" into nyc-dev 2016-05-04 18:38:30 +00:00
Robin Lee
dc67971a99 Add lockdownEnabled parameter to always-on VPN API
Allows callers to opt-out of blockading network traffic during boot and
on VPN app failure.

Bug: 26694104
Change-Id: Ibfbd43ad09a25f2e38053fcd6306df3711f8bde2
2016-05-03 13:24:42 +01:00
Jeff Sharkey
64e0c99814 Merge "Flag to mark foreground jobs, fix data saver." into nyc-dev am: 9a977b7d45 am: 478806946f
am: 98d57313f2

* commit '98d57313f247a80928b6358dda05a16c3b4000dc':
  Flag to mark foreground jobs, fix data saver.

Change-Id: Id863d0ff4f8e7f13049231298feaab9839b4667c
2016-04-29 23:04:05 +00:00
Jeff Sharkey
1b6519bd87 Flag to mark foreground jobs, fix data saver.
When a job will eventually run in the foreground, the internal
scheduling needs to ignore any background network restrictions when
satisfying constraints.  This also means the job should ignore the
current device doze state, since the requesting app could get the
same behavior by starting their own foreground service.

Always dispatch network policy changes to ConnectivityService first
to ensure that it has up-to-date information.  Fix bugs around data
saver that were causing networks to not be marked as BLOCKED for
background apps; before this fix apps would have been spinning in
internal connectivity loops, thinking that the network was actually
connected when the kernel was actually blocking their traffic.

Offer new ConnectivityService method overloads to ignore the blocked
state for a specific UID.

Print unsatisfied job constraints to aid debugging.

Bug: 26571724
Change-Id: Iaaa17933e6dc1bf6d3dff26d0bfc12222e51e241
2016-04-29 13:44:07 -06:00
Lorenzo Colitti
f77b381b9b Merge "Make isCaptivePortal perform both HTTP and HTTPS probes." into nyc-dev am: 1d3c594 am: 7146d02
am: c097c93

* commit 'c097c9377e6a7e2f6577dd374dc218ef4f57c2eb':
  Make isCaptivePortal perform both HTTP and HTTPS probes.

Change-Id: Iced513171ceb6e3e1c4fea545786e59b8c64b40a
2016-04-28 05:30:58 +00:00
Lorenzo Colitti
c5be12e7ac Make isCaptivePortal perform both HTTP and HTTPS probes.
Also a couple of minor cleanups and logging tweaks.

Bug: 26075613
Change-Id: I67b09e96d72764179339b616072bb2ce06aabf33
2016-04-28 11:23:10 +09:00
Felipe Leme
d5890f2f7d Merge "Tethering and Data Saver: There Can Be Only One!" into nyc-dev am: 0db93ce am: 3b17597
am: 479c9bb

* commit '479c9bbaf971aab9d3ac50acebe41158e53ee342':
  Tethering and Data Saver: There Can Be Only One!

Change-Id: I184d03847abe86dd2f5e10c10bd12f90f7cc14d8
2016-04-28 00:52:46 +00:00
TreeHugger Robot
0db93cea0f Merge "Tethering and Data Saver: There Can Be Only One!" into nyc-dev 2016-04-27 22:41:13 +00:00
Hugo Benichi
9b7a3b5d53 Merge changes I8de95add,Ia6f4ccfd into nyc-dev am: 24b6e2b am: 74db646
am: 37aa948

* commit '37aa94838105990ad54ef197bd4bfde21b4a5dc9':
  Remove unused event tags of IpConnectivityEvent
  Better ConnectivityMetricsEvent printing

Change-Id: I8625da2af299337f385596f8015a8f7255aa2c37
2016-04-27 02:51:44 +00:00
TreeHugger Robot
24b6e2bcc8 Merge changes I8de95add,Ia6f4ccfd into nyc-dev
* changes:
  Remove unused event tags of IpConnectivityEvent
  Better ConnectivityMetricsEvent printing
2016-04-27 01:49:53 +00:00
Hugo Benichi
61cbccc2bf Remove unused event tags of IpConnectivityEvent
Bug: 28204408
Change-Id: I8de95add30cdf5c35c8129ee1b95d2d648b3316d
2016-04-27 09:12:40 +09:00
Hugo Benichi
5df9d729f6 Better ConnectivityMetricsEvent printing
This patch adds more information printing for IpConnectivity event
classes in android.net.metrics.

example:

ConnectivityMetricsEvent(14:36:35.799, 0, 1026): DhcpClientEvent(wlan0, DhcpRequestingState)
ConnectivityMetricsEvent(14:36:35.805, 0, 1026): DhcpClientEvent(wlan0, DhcpHaveAddressState)
ConnectivityMetricsEvent(14:36:35.809, 0, 4096): IpManagerEvent(wlan0, PROVISIONING_OK, 155ms)
ConnectivityMetricsEvent(14:36:35.810, 0, 1026): DhcpClientEvent(wlan0, DhcpBoundState)
ConnectivityMetricsEvent(14:36:35.871, 0, 2048): NetworkEvent(101, NETWORK_CONNECTED, 0ms)
ConnectivityMetricsEvent(14:36:35.874, 0, 2051): ValidationProbeEvent(101, PROBE_HTTP:599, 3ms)
ConnectivityMetricsEvent(14:36:35.874, 0, 2048): NetworkEvent(101, NETWORK_VALIDATION_FAILED, 0ms)
ConnectivityMetricsEvent(14:36:35.928, 0, 3072): DefaultNetworkEvent(0 -> 101, [WIFI], IPv4: false, IPv6: false)
ConnectivityMetricsEvent(14:36:37.008, 0, 2051): ValidationProbeEvent(101, PROBE_HTTP:204, 134ms)
ConnectivityMetricsEvent(14:36:37.008, 0, 2050): NetworkEvent(101, NETWORK_VALIDATED, 1137ms)

Also fixes a couple of event logging issues:
  - do no record spurious receive DhcpErrorEvent when a network goes down.
  - add an eventType field to IpManagerEvent instead of using the
    loggger component tag.

Bug: 28204408
Change-Id: Ia6f4ccfd7a0c63a5ccec18825f226c0b5781217b
2016-04-27 09:11:29 +09:00
Andreas Gampe
37f11ecd43 Merge "Frameworks/base: Make debug helper lazy in ConnectivityManager" into nyc-dev am: 396c590 am: 12aea50
am: d8998a4

* commit 'd8998a48c9ff362aaf081b1fd74877903c2dab11':
  Frameworks/base: Make debug helper lazy in ConnectivityManager

Change-Id: Iae09599af115044fd6e1c37c0f0222fe766281f0
2016-04-26 16:15:18 +00:00
TreeHugger Robot
396c590c42 Merge "Frameworks/base: Make debug helper lazy in ConnectivityManager" into nyc-dev 2016-04-26 15:25:44 +00:00
Lorenzo Colitti
35ffc550dd Merge "Merge "When dumping connectivity metrics events, print data as well." into nyc-dev am: e4860f0 am: 8711593" into nyc-mr1-dev-plus-aosp
am: 05b4399

* commit '05b4399242ae4759143c7ca3bd72565c1bbee74e':
  When dumping connectivity metrics events, print data as well.

Change-Id: I094e96703fba00a24ce90670b3966ebc9f5e392d
2016-04-26 03:58:41 +00:00
Lorenzo Colitti
e4860f0256 Merge "When dumping connectivity metrics events, print data as well." into nyc-dev 2016-04-26 03:22:26 +00:00
Jeff Sharkey
596e8588b1 resolve merge conflicts of d1153a3 to master
Change-Id: Iec9a4a76d0db0fbebdca8a732b4666cfaad70267
2016-04-25 16:40:38 -06:00
Felipe Leme
70c8b9b660 Tethering and Data Saver: There Can Be Only One!
If tethering is on when Data Saver mode is turned on, tethering should
be disabled, and vice-versa.

BUG: 28313291
Change-Id: I7f3dadbd97ea1492ab76b41043dea7487c1db02d
2016-04-25 15:36:25 -07:00
Andreas Gampe
3480213054 Frameworks/base: Make debug helper lazy in ConnectivityManager
Place helper map for callback field names into a holder. This avoids
the reflective calls in static initialization of ConnectivityManager
in the common (non-debug) case, which means the class can be
compile-time initialized. Also saves the storage necessary (both
the storage array as well as the reflection metadata).

Follow-up to fcfa7d921a.

Bug: 27265238
Change-Id: Ib4bfaf27acd234a035a5d198458340099a156a4c
2016-04-25 10:30:53 -07:00
Lorenzo Colitti
0a082e2c38 When dumping connectivity metrics events, print data as well.
Currently the output is not very interesting, looking like:

ConnectivityMetricsEvent(1461591945223, 4, 5): Bundle[mParcelledData.dataSize=340]
ConnectivityMetricsEvent(1461591945289, 0, 2048): android.net.metrics.NetworkEvent@b76cd61
ConnectivityMetricsEvent(1461591945296, 4, 5): Bundle[mParcelledData.dataSize=340]
ConnectivityMetricsEvent(1461591945299, 0, 3072): android.net.metrics.DefaultNetworkEvent@e2f3086
ConnectivityMetricsEvent(1461591945527, 0, 2051): android.net.metrics.ValidationProbeEvent@884ad47

but at least it's better than nothing, and event logger users can
always implement a better toString method on their events.

This is only enabled if --events is passed into the dump.

Bug: 28204408
Change-Id: Ife96b8d54e5e91317d86b622d5efc29724969f63
2016-04-25 22:55:09 +09:00
Jeff Sharkey
f07c7b9fd0 API changes for DownloadManager and JobScheduler.
To support moving DownloadManager, add new JobScheduler network type
constraint that matches "any network except roaming."  Also add an
API to get a specific JobInfo by ID.

Since the default network can be different on a per-app basis, and
individual apps may be blocked due to app standby, evaluate job
connectivity constraints on a per-UID basis.  To implement this
cleanly, add NetworkInfo.isMetered() to match the isRoaming() API.

Add new DownloadManager APIs to support charging and device idle
constraints, which are plumbed through to JobScheduler under the
hood when scheduled.

Add filtering to JobScheduler dumpsys to omit noisy details for
packages the caller isn't interested in.

Bug: 28098882, 26571724, 19821935
Change-Id: I09ca7184ef7ce6adba399f579d415a5fb2ea6110
2016-04-24 14:39:34 -06:00
Hugo Benichi
02a28abfd5 Merge "Split network monitoring and portal probe events" into nyc-dev am: 784c93e372 am: cbb0d77bcd
am: 03c0efa3a4

* commit '03c0efa3a4256b19871d6f8d08c4bff5e89aa8bd':
  Split network monitoring and portal probe events

Change-Id: I4cd3eeb25f63fe3731883ec2cc4fbfc3602bfba8
2016-04-22 09:55:38 +00:00
Hugo Benichi
cc92c6e877 Split network monitoring and portal probe events
This patches changes how captive portal tests and network lifecycle
events are logged as connectivity events:
  - it splits NetworkMonitorEvent into two event classes:
      - ValidationProbeEvent for logging individual probe events.
      - NetworkEvent for logging network connection, validation,
        lingering, and disconnection.
  - it removes the redundant CaptivePortalCheckResultEvent class.
    The information logged in CaptivePortalCheckResultEvent was already
    logged by NetworkMonitorEvent, but missing the evaluation durations.
    It is now logged by ValidationProbeEvent.
  - it removes the CaptivePortalStateChangeEvent class, which is now
    redundant with NetworkEvent, but missing evaluation durations.

In addition, it adds event logging when ConnectivityService puts a
network into lingering or removes a network from lingering.

Bug: 28204408
Change-Id: I8f9752e4d36175ecfcbd1545a01a41bad6e06ea4
2016-04-22 17:08:56 +09:00
Erik Kline
8124d17dfc Merge "Expand NetworkMonitor metrics" into nyc-dev am: b99d6af3ab am: 0f155c5778
am: 9d73518433

* commit '9d7351843349945be98a712a2cfa27b85b57c72a':
  Expand NetworkMonitor metrics

Change-Id: I5ae6a60c774386f60cdb1a390ae7f9fac3f0d300
2016-04-21 05:32:59 +00:00
TreeHugger Robot
b99d6af3ab Merge "Expand NetworkMonitor metrics" into nyc-dev 2016-04-21 05:24:40 +00:00
Hugo Benichi
a27a918e03 Merge "Some fixes in ConnectivityService event logging" into nyc-dev am: 7261fb27de am: eb8372d38c
am: 51d6d7ad5e

* commit '51d6d7ad5e866e7201c4d843a497b78f8a0607f8':
  Some fixes in ConnectivityService event logging

Change-Id: Icb50bdab260da6476c1d1148fa2d8995b106a809
2016-04-21 04:19:53 +00:00
Hugo Benichi
dced5552ef Merge "Various fixes in IpReachability event logging" into nyc-dev am: 75f0346167 am: d8a8ea1e29
am: c3795b94a3

* commit 'c3795b94a3d48a5184d13cea43a02aebcd31bb48':
  Various fixes in IpReachability event logging

Change-Id: I5b25861f1010ac008c3cafc51a720b42cb961fba
2016-04-21 04:08:25 +00:00
Hugo Benichi
7261fb27de Merge "Some fixes in ConnectivityService event logging" into nyc-dev 2016-04-21 04:02:55 +00:00
Erik Kline
a488c23dd5 Expand NetworkMonitor metrics
- add netid to CaptivePortalStateChangeEvent
    - add NetworkMonitorEvent for simple duration measurements

Bug: 28204408
Change-Id: I62035e07d64013878a0bce30c67c929c2c7e7a85
2016-04-21 13:02:55 +09:00
Hugo Benichi
5f16f760ad Some fixes in ConnectivityService event logging
Bug: 28204408
Change-Id: I44ed9539bb213a845c2bcc2861c947af7c3c9ef4
2016-04-21 11:03:08 +09:00
Hugo Benichi
25bf8f5d56 Various fixes in IpReachability event logging
- fold IpReachabilityMonitor* classes into a single IpReachabilityEvent.
- only log an event for NUD_FAILED Netlink answers.
- distinguish between NUD_FAILED with or without lost of provisioning.
- do not record host ip addresses.
- record interface name instead of interface index when losing
  provisioning.

- also return an error code when probeNeighbor fails, and log this error
  code in IpReachability events.

Bug: 28204408
Change-Id: I5f0def0ab1ace7e467a0c69b3b82d07ef2252307
2016-04-21 09:18:50 +09:00
Felipe Leme
b756f6ed34 Merge "Added onRestrictBackgroundWhitelistChanged callback." into nyc-dev am: 9724fba am: 0627850
am: 9acf151

* commit '9acf1516eb00827464fce1ab6c893de9721081e4':
  Added onRestrictBackgroundWhitelistChanged callback.

Change-Id: Iae1c0af0aec6dba501249c0db08ade5a36f99607
2016-04-20 21:29:18 +00:00
TreeHugger Robot
9724fba835 Merge "Added onRestrictBackgroundWhitelistChanged callback." into nyc-dev 2016-04-20 17:44:56 +00:00
Robin Lee
e1ee098ab2 Merge "Move UidRange aidl declaration to system/netd" into nyc-dev am: c618468 am: e7c7d77
am: 5d16439

* commit '5d1643989218a132f570c8d002213089a33ef5ce':
  Move UidRange aidl declaration to system/netd

Change-Id: I899574d6e8ec88049a8bb72e8dc451ebd407bc3a
2016-04-19 19:34:50 +00:00
Robin Lee
c6184685d8 Merge "Move UidRange aidl declaration to system/netd" into nyc-dev 2016-04-19 19:19:43 +00:00
Felipe Leme
019fcd2bec Added onRestrictBackgroundWhitelistChanged callback.
When users add or remove an app to the Data Saver Mode whitelist, the
app is notified through a
ConnectivityManager.ACTION_RESTRICT_BACKGROUND_CHANGED. But besides this
broadcast, it's also necessary to notify internal apps such Settings,
hence a new method is being added to INetworkPolicyListener.

BUG: 27481520
Change-Id: I1537a77becf6b7da1535ed5faabdc894fd9f7084
2016-04-19 12:06:00 -07:00
Pavel Zhamaitsiak
ea7984231f Merge "Add wrappers for IConnectivityMetricsLogger functions" into nyc-dev am: 6e08a62 am: d42b900
am: f060af8

* commit 'f060af887bf516fe11b979b1f822f9e559bdc6eb':
  Add wrappers for IConnectivityMetricsLogger functions

Change-Id: I54ba063dc51e5b27a60c8bbe9c3a6bcefa0cda51
2016-04-19 18:01:29 +00:00
Pavel Zhamaitsiak
6e08a629c4 Merge "Add wrappers for IConnectivityMetricsLogger functions" into nyc-dev 2016-04-19 17:41:42 +00:00
Hugo Benichi
f2450e5b5c Merge "Remove unused DHCP timeout event tag." into nyc-dev am: 6e1d1db am: 48b8d14
am: 9deef0c

* commit '9deef0ceb7668d0029ebc4bb2682edae3b1a63c3':
  Remove unused DHCP timeout event tag.

Change-Id: Ie6381a65faf36894d498ec36b231ede0f0fc0e52
2016-04-19 07:17:43 +00:00
Hugo Benichi
23e0e805c5 Remove unused DHCP timeout event tag.
DHCP timeouts should not be logged at DHCPClient level but as a timeout
event in IpManager.

Bug: 28204408
Change-Id: Ia12619e3bf71102cf289cbbcdec53fd5e7e8efff
2016-04-19 14:26:53 +09:00
Pavel Zhamaitsiak
c2c39e28f3 Add wrappers for IConnectivityMetricsLogger functions
Bug: 25691077
Change-Id: I51fa34a4815fb04e33d3b02f0134e3555afc3900
2016-04-18 17:41:19 -07:00
Robin Lee
106069412d Move UidRange aidl declaration to system/netd
Which owns the native UidRange.cpp, so it makes more sense for the
declaration to live there since frameworks/base depends on netd but not
vice versa.

Bug: 26694104
Change-Id: I0efda77713ee6f0ec8070fb0e09a694b95f6cd25
2016-04-18 15:26:47 +01:00
Hugo Benichi
e78f7544fd Merge "Make android.net.metrics Event classes @SystemApi am: 4b6dfc2 am: 9cae985" into nyc-mr1-dev-plus-aosp
am: ab317e3

* commit 'ab317e363f35e75cb64175707e6a4f058d95321e':
  Make android.net.metrics Event classes @SystemApi

Change-Id: Iaa17df5b1c40f399be22133ecddb3a2440023329
2016-04-18 04:25:20 +00:00
Hugo Benichi
4cc6157ec6 Merge "Fixes fatal linter errors in android.net.metrics am: 627b424 am: 4acf772" into nyc-mr1-dev-plus-aosp
am: 99e19f0

* commit '99e19f05f3db1de280e1647c52ddb96a93beb2c1':
  Fixes fatal linter errors in android.net.metrics

Change-Id: I258c7b4f163f60d38ac86985b6b6cdf8dc92199e
2016-04-18 04:25:15 +00:00
Hugo Benichi
d06bcb897c Fix spurious DHCP parse error logging. am: 2677b19 am: 2fd113f
am: 41be6c6

* commit '41be6c6e29dd171508fdd932fcd7e38185253b2f':
  Fix spurious DHCP parse error logging.

Change-Id: I341b0067062ca83baa0b14a5eaba6ac863b51006
2016-04-18 04:25:02 +00:00
Hugo Benichi
4b6dfc2ef5 Make android.net.metrics Event classes @SystemApi
Bug: 28204408
Change-Id: I8ffe833213bbc03a7f70c51789f4899ee08f6e08
2016-04-18 11:36:42 +09:00
Hugo Benichi
627b42494d Fixes fatal linter errors in android.net.metrics
This patch changes how Event classes are organized:
 - Base IpConnectivityEvent class does not implement Parcelable because
   it cannot be final (has children). It also becomes abstract because
   it is not supposed to be instantiated and logged directly.
 - All children classes becomes final because they are Parcelable.
 - All constructors of all children classes become private, because they
   are supposed to be instantiated with their associated logEvent()
   methods.
 - All instance fields of all children classes become public final.
      Rational: if private, the ConnectivityMetrics app cannot read
      their data.

Bug: 28204408
Change-Id: I1a4689c422230c6ed034307dec54a61daf8a6598
2016-04-18 11:29:03 +09:00
Hugo Benichi
2677b1957b Fix spurious DHCP parse error logging.
This patch moves the event logging of DHCP response packet parse errors
to DHCPClient in a single place. It also logs receive IO errors as
DHCPErrors instead of DHCPClientEvents.

BUG=28197345

Change-Id: I7ad666cff4d8b97915880477347fbb3f588fdb2a
2016-04-18 11:27:35 +09:00
Pavel Zhamaitsiak
ccfa19f139 Merge "Make ConnectivityMetricsLogger and related classes @SystemApi" into nyc-dev am: 74870c4
am: 229e517

* commit '229e5179ba1915b5beb86b0d7989fb356bef9966':
  Make ConnectivityMetricsLogger and related classes @SystemApi

Change-Id: Ia33ecf02187f0c945c0e70d6d939c310cca3c6e1
2016-04-15 18:57:18 +00:00