Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5250 : Add support for logging device DPI events #5270

Merged
merged 8 commits into from
Jan 30, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ class EventBundleCreator @Inject constructor(
private val appVersionCode by lazy { context.getVersionCode() }
private val appVersionName by lazy { context.getVersionName() }
private val eventCount by lazy { AtomicInteger() }
private val screenDensity by lazy {
context.resources.displayMetrics.densityDpi
}
adhiamboperes marked this conversation as resolved.
Show resolved Hide resolved

/**
* Fills the specified [bundle] with a logging-ready representation of [eventLog] and returns a
Expand All @@ -150,6 +153,9 @@ class EventBundleCreator @Inject constructor(
bundle.putString(
"oppia_audio_lang", eventLog.audioTranslationLanguageSelection.toAnalyticsText()
)
bundle.putInt(
"screen_density", screenDensity
)
return eventLog.context.convertToActivityContext().also { eventContext ->
// Only allow user IDs to be logged when the learner study feature is enabled.
eventContext.storeValue(
Expand Down
Loading
Loading