Fix default network validation overcounting
When switching from a validated default network to a new validated
default network (typically because of a better score),
DefaultNetworkMetrics would not reset the last validation timestamp.
This would cause the new default network to have a total recorded
validation time overcounted by the validation time of the previous
default network.
The following fix should be applied downstream for consumers of
previously recorded data:
validation_time = min validation_time, duration_time);
Test: runtest -x frameworks/base/tests/net/../IpConnectivityMetricsTest
Change-Id: I303d11023527c19435f5f5e796a0295ae3f76d9f
2 files changed