Track and build KeepaliveLifetimePerCarrier.

Create a nested class KeepaliveStats to store and track the carrier info
and lifetime metrics for each keepalive where a keepalive is identified
by its network and slot number. Then aggregate the metrics using
(carrierId, transportTypes, intervalMs) as the key before writing the
metrics into the KeepaliveLifetimePerCarrier proto. Also aggregates the
metrics whenever a keepalive is stopped to free up the (network, slot).

Bug: 273451360
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:ad03b887e63e2ad0678fe7fc4394d23a690a14d5)
Merged-In: I113ec68053710a7f41f64a9d6fa4dd83bd924225
Change-Id: I113ec68053710a7f41f64a9d6fa4dd83bd924225
4 files changed