Add logging for ambient light.
Bug: 243369305 Test: statsd_testdrive Change-Id: I7b3a823f116b68a349d398b9cd2dab465e27ea9c
This commit is contained in:
committed by
Silvia Vinyes
parent
62a62a509e
commit
642112e475
@@ -27,6 +27,7 @@ import android.util.TypedXmlSerializer;
|
|||||||
import android.util.Xml;
|
import android.util.Xml;
|
||||||
|
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
|
import com.android.internal.util.FrameworkStatsLog;
|
||||||
|
|
||||||
import org.xmlpull.v1.XmlPullParser;
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
@@ -287,6 +288,14 @@ public class AmbientBrightnessStatsTracker {
|
|||||||
localDate)) {
|
localDate)) {
|
||||||
return lastBrightnessStats;
|
return lastBrightnessStats;
|
||||||
} else {
|
} 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,
|
AmbientBrightnessDayStats dayStats = new AmbientBrightnessDayStats(localDate,
|
||||||
BUCKET_BOUNDARIES_FOR_NEW_STATS);
|
BUCKET_BOUNDARIES_FOR_NEW_STATS);
|
||||||
if (userStats.size() == MAX_DAYS_TO_TRACK) {
|
if (userStats.size() == MAX_DAYS_TO_TRACK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user