Add logging for ambient light.

Bug: 243369305
Test: statsd_testdrive

Change-Id: I7b3a823f116b68a349d398b9cd2dab465e27ea9c
This commit is contained in:
silviavinyes
2022-07-29 13:46:07 +01:00
committed by Silvia Vinyes
parent 62a62a509e
commit 642112e475

View File

@@ -27,6 +27,7 @@ import android.util.TypedXmlSerializer;
import android.util.Xml;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.FrameworkStatsLog;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -287,6 +288,14 @@ public class AmbientBrightnessStatsTracker {
localDate)) {
return lastBrightnessStats;
} else {
// It is a new day, and we have available data, so log data. The daily boundary
// might not be right if the user changes timezones but that is fine, since it
// won't be that frequent.
if (lastBrightnessStats != null) {
FrameworkStatsLog.write(FrameworkStatsLog.AMBIENT_BRIGHTNESS_STATS_REPORTED,
lastBrightnessStats.getStats(),
lastBrightnessStats.getBucketBoundaries());
}
AmbientBrightnessDayStats dayStats = new AmbientBrightnessDayStats(localDate,
BUCKET_BOUNDARIES_FOR_NEW_STATS);
if (userStats.size() == MAX_DAYS_TO_TRACK) {