History log of /frameworks/base/core/java/android/net/metrics/IpManagerEvent.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ea1b8bd5a5647dd1cb65cac0100bac29e41ddc48 02-Mar-2018 Erik Kline <ek@google.com> Fail if the interface is not available when starting

Addresses a long-standing TODO. Now, when calling IpClient's
startProvisioning(), the interface has to be available (i.e.
InterfaceParams#getByName() must return non-null).

Also:
- add a test
- refactor for testability
- delete some constructors no longer used
- properly handle passed-in null IpClient.Callback
- some more IpManager -> IpClient renaming
- permit recording metrics before starting a provisioning
attempt (logging immediate errors) without Log.wtf().

Test: as follows
- built
- flashed
- booted
- runtest frameworks/opt/net/wifi/tests/wifitests/runtests.sh passes
- runtest frameworks-net passes
- basic WiFi IpClient connections works fine
Bug: 62476366
Bug: 73487570
Merged-In: I68e5e24122dc31e730cdbe8d75e33847e6332da4
Merged-In: Ifd27f5d908947cd7b4e1b8d54f9fa87e43ebb11b
Merged-In: Ief3c8e1652f69af0276fe35946ae1bf6e6b1b57e
Change-Id: Ic83ad2a65637277dcb273feb27b2d1bb7a11eb2b
(cherry picked from commit b152cd0aa4f333b721615bb17773b35a989245fb)
/frameworks/base/core/java/android/net/metrics/IpManagerEvent.java
2757fcf3a13b0addc4a168a12c72ac2fc418b012 23-Jun-2017 Hugo Benichi <hugobenichi@google.com> IpManager: define InitialConfiguration

This patch adds a InitialConfiguration class to IpManager for specifying
IP information in IpManager ProvisioningConfiguration at IpManager
startup.

At the moment this InitialConfiguration is not used, but is validated in
startProvsiioning if ProvisioningConfiguration includes one. It will be
integrated into IpManager IP provisioning logic in follow-up patches.

This patch also includes an example of data driven unit tests using a
table of test case. The highlights of this methodology are:
1) easy extensibility for new test case,
2) rich and informative error messages,
Unfortunately Java support for inlined data structure literals is poor
and some companion static methods for data generation are required for
enabling this methodology.

Bug: 62988545
Test: added new test in FrameworksNetTests,
$ runtest frameworks-net
$ runtest frameworks-wifi

Change-Id: I060b02603af7d73a6407df89344bf0c000574af2
/frameworks/base/core/java/android/net/metrics/IpManagerEvent.java
948a85948dcccea4aaa9d70a74405308581b0925 16-Mar-2017 Hugo Benichi <hugobenichi@google.com> Connectivity metrics: change how interface names are logged

This patch deprecates the ifname field for specific metrics events of
types DhcpClientEvent, DhcpErrorEvent, IpReachabilityEvent and
IpManagerEvent.

Instead ifnames are logged in ConnectivityMetricsEvent, allowing for
link layer inference.

Test: updated unit tests, $ runtest frameworks-net passes
Bug: 34901696
Change-Id: I8bfabcb115bbd5289471d653c153a40bb48f28cd
/frameworks/base/core/java/android/net/metrics/IpManagerEvent.java
95cb226c1a4ff47531da65ef2617ade0dea5c9b8 11-Jan-2017 Hugo Benichi <hugobenichi@google.com> IP connectivity metrics: cleanup obsolete code

This patch cleans obsolete code related to IP connectivity metrics:
- remove @SystemApi on android.net.metrics: now that metrics events
are processed and serialized in the frameworks only, event classes
should not appear in the system apis.
- remove obsolete Logger classes: ConnectivityMetrics app was the
unique user of ConnectivityMetricsLogger until nyc-mr1. From nyc-mr1
the app started using dumpsys to get metrics for IpConnectivity and
Telephony, which made ConnectivityMetricsLogger obsolete.
- simplifications in MetricsTestUtil

Test: - runtest frameworks-net
- manually verified $ adb shell dumpsys connmetrics
Bug: 30054585
Bug: 32648597
Change-Id: I85ef65f7f69eb9299e4636cc7af54067201d9daf
/frameworks/base/core/java/android/net/metrics/IpManagerEvent.java
e4526604664cb66ecdcbeca4d8f64e8c94750c31 14-Oct-2016 Erik Kline <ek@google.com> 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
/frameworks/base/core/java/android/net/metrics/IpManagerEvent.java
cf6b12f50aa3251a3fc9929c565f8a19eaaac49e 04-Jul-2016 Hugo Benichi <hugobenichi@google.com> IpConn metrics: use @IntDef

Change-Id: Iae23f04abd3d1a43e7217f4fd641cd5fa61a7a1b
/frameworks/base/core/java/android/net/metrics/IpManagerEvent.java
4fc3ee5be223122792ebc0ee8a05c93d93e26a52 02-Jun-2016 Hugo Benichi <hugobenichi@google.com> Log events at APF program generation

Example:
ConnectivityMetricsEvent(15:24:52.018, 0, 0): ApfProgramEvent(0/0 RAs 121B forever FLAG_MULTICAST_FILTER_ON)
ConnectivityMetricsEvent(15:24:53.036, 0, 0): ApfProgramEvent(1/1 RAs 334B 600s)
ConnectivityMetricsEvent(15:24:53.590, 0, 0): ApfProgramEvent(1/1 RAs 360B 600s FLAG_MULTICAST_FILTER_ON, FLAG_HAS_IPV4_ADDRESS)
ConnectivityMetricsEvent(15:24:58.157, 0, 0): ApfProgramEvent(1/1 RAs 294B 599s FLAG_HAS_IPV4_ADDRESS)

Bug: 28204408
Change-Id: I9c4c82861cf42eb2c7e7bf5471f05e8ff2fc560c
/frameworks/base/core/java/android/net/metrics/IpManagerEvent.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/IpManagerEvent.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/IpManagerEvent.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/IpManagerEvent.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/IpManagerEvent.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/IpManagerEvent.java
5b25a0f7960048cbf5929ba144e7a575eb4f7d32 12-Apr-2016 Erik Kline <ek@google.com> Add some more metrics: IpManager, IpReachabilityMonitor

Change-Id: Ibb7150c849715a42fc2c879589eaaf86e8a007e7
/frameworks/base/core/java/android/net/metrics/IpManagerEvent.java