History log of /frameworks/base/core/java/android/net/metrics/DhcpErrorEvent.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
006e0613016c1a0e0627f992f5a93a7b7198edba 05-Oct-2016 Hugo Benichi <hugobenichi@google.com> Reject DHCP packets with no magic cookie

This patch adds an explicit check in the DHCP packet parser for
rejecting packets without a magic cookie, instead of relying on the
top-level try-catch-all in the parser.

This allows to add to DHCP error metrics this specific error.

It also allows to add two poor man's fuzzing tests that tries to find
additional gaps in the DHCP packet parser by
- trying to parse all subslices of a valid offer packet.
- trying to parse random byte arrays.

Test: covered by previously introduced malformed DHCP packet unit tests
+ additional fuzzing tests.
Bug: 31850211
Change-Id: If53c9ba9df78d7604ec018c9d67c237ae59c4833
/frameworks/base/core/java/android/net/metrics/DhcpErrorEvent.java
e0ea7fecd63002ac2d3df18490fd1c16578d1935 05-Oct-2016 Hugo Benichi <hugobenichi@google.com> Catch runtime exceptions when parsing DHCP packets

This patch adds a try catch all to DHCP packet parsing so that
DhcpClient does not choke on malformed packets, brinding down with it
the whole framework.

Test: added new unit tests catching the issue fixed in this patch.
Bug: 31850211
Change-Id: I3c50a149fed6b2cbc4f40bb4f0e5bb2b56859b44
/frameworks/base/core/java/android/net/metrics/DhcpErrorEvent.java
cf6b12f50aa3251a3fc9929c565f8a19eaaac49e 04-Jul-2016 Hugo Benichi <hugobenichi@google.com> IpConn metrics: use @IntDef

Change-Id: Iae23f04abd3d1a43e7217f4fd641cd5fa61a7a1b
/frameworks/base/core/java/android/net/metrics/DhcpErrorEvent.java
cfddd6879283860bb4d2cf2972ea086f585a37ec 31-May-2016 Hugo Benichi <hugobenichi@google.com> Refactor IP connectivity event logging

This patch removes static methods for logging IP connectivity events
defined in android.net.metrics and replaces them with a single log()
instance method defined on IpConnectivityLog. Event constructors are
now public also. Every classes logging such events now create an
instance of IpConnectivityLog for logging event objects directly
instantiated with new.

Removing static dependencies allow straightforward testing of logging.

This patch also removes the base IpConnectivityEvent class which is not
needed any more.

Bug: 29035129
Change-Id: I3de700f93f46deaa48a759f938f7d00e1d8bff98
/frameworks/base/core/java/android/net/metrics/DhcpErrorEvent.java
61cbccc2bf7983b50e7a7f1fdb1858caeab6fd96 26-Apr-2016 Hugo Benichi <hugobenichi@google.com> Remove unused event tags of IpConnectivityEvent

Bug: 28204408
Change-Id: I8de95add30cdf5c35c8129ee1b95d2d648b3316d
/frameworks/base/core/java/android/net/metrics/DhcpErrorEvent.java
5df9d729f6c78215f287701d7e136dfc922e2bd3 25-Apr-2016 Hugo Benichi <hugobenichi@google.com> 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
/frameworks/base/core/java/android/net/metrics/DhcpErrorEvent.java
23e0e805c543f3edad54ec71c6bc21147946511d 19-Apr-2016 Hugo Benichi <hugobenichi@google.com> 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
/frameworks/base/core/java/android/net/metrics/DhcpErrorEvent.java
4b6dfc2ef54723768a67887ce2a42d4f8f64d0f4 14-Apr-2016 Hugo Benichi <hugobenichi@google.com> Make android.net.metrics Event classes @SystemApi

Bug: 28204408
Change-Id: I8ffe833213bbc03a7f70c51789f4899ee08f6e08
/frameworks/base/core/java/android/net/metrics/DhcpErrorEvent.java
627b42494d82eca4fd51abfc0a5d7f330862b881 15-Apr-2016 Hugo Benichi <hugobenichi@google.com> 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
/frameworks/base/core/java/android/net/metrics/DhcpErrorEvent.java
2677b1957b444e2dae5737feee989109b811547c 18-Apr-2016 Hugo Benichi <hugobenichi@google.com> 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
/frameworks/base/core/java/android/net/metrics/DhcpErrorEvent.java
6241874355c0e0d9ff04e993ad1d522c66b8c50b 13-Apr-2016 Hugo Benichi <hugobenichi@google.com> Add DHCP error event class and record DHCP errors.

This patch adds an event class derived from IpConnectivityEvent that
records parsing errors of DHCP response packets.

Change-Id: I19516cf05e3419c4262e3236899e52987e5f2264
/frameworks/base/core/java/android/net/metrics/DhcpErrorEvent.java