From 4dd34c1fc36c1bf33f27e54478baccfee84dfd33 Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Wed, 24 Nov 2021 16:10:54 +0000 Subject: [PATCH] Add fields for "enhanced metrics collection" Add metrics fields to record the state of the "enhanced metrics collection" server flags and the extra metrics that this feature enables. Bug: 200279201 Bug: 208789974 Test: build / manual testing Change-Id: I23a2745ba543b5f03920bf78e6b9b6d9beacc62b --- .../server/stats/pull/StatsPullAtomService.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java index 07a584913b0bc..e8c20ccba3d3b 100644 --- a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java +++ b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java @@ -3436,7 +3436,9 @@ public class StatsPullAtomService extends SystemService { metricsState.getLatestTelephonySuggestion()), convertTimeZoneSuggestionToProtoBytes( metricsState.getLatestGeolocationSuggestion()), - metricsState.isTelephonyTimeZoneFallbackSupported() + metricsState.isTelephonyTimeZoneFallbackSupported(), + metricsState.getDeviceTimeZoneId(), + metricsState.isEnhancedMetricsCollectionEnabled() )); } catch (RuntimeException e) { Slog.e(TAG, "Getting time zone detection state failed: ", e); @@ -3483,6 +3485,14 @@ public class StatsPullAtomService extends SystemService { android.app.time.MetricsTimeZoneSuggestion.TIME_ZONE_ORDINALS, zoneIdOrdinal); } + String[] zoneIds = suggestion.getZoneIds(); + if (zoneIds != null) { + for (String zoneId : zoneIds) { + protoOutputStream.write( + android.app.time.MetricsTimeZoneSuggestion.TIME_ZONE_IDS, + zoneId); + } + } } protoOutputStream.flush(); closeQuietly(byteArrayOutputStream);