-
Notifications
You must be signed in to change notification settings - Fork 71
RUM-11120: Add battery and display attributes #2815
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77d3e69
to
aa393a5
Compare
39b52d4
to
9f737d7
Compare
...rc/main/kotlin/com/datadog/android/rum/internal/domain/battery/DefaultBatteryInfoProvider.kt
Outdated
Show resolved
Hide resolved
...rc/main/kotlin/com/datadog/android/rum/internal/domain/display/DefaultDisplayInfoProvider.kt
Outdated
Show resolved
Hide resolved
satween
reviewed
Aug 13, 2025
features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/RumFeature.kt
Show resolved
Hide resolved
satween
reviewed
Aug 13, 2025
...k-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/battery/BatteryInfo.kt
Outdated
Show resolved
Hide resolved
satween
reviewed
Aug 13, 2025
...rc/main/kotlin/com/datadog/android/rum/internal/domain/battery/DefaultBatteryInfoProvider.kt
Show resolved
Hide resolved
satween
reviewed
Aug 13, 2025
...rc/main/kotlin/com/datadog/android/rum/internal/domain/battery/DefaultBatteryInfoProvider.kt
Outdated
Show resolved
Hide resolved
jonathanmos
commented
Aug 13, 2025
...s/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/InfoProvider.kt
Outdated
Show resolved
Hide resolved
aleksandr-gringauz
previously approved these changes
Aug 14, 2025
aleksandr-gringauz
approved these changes
Aug 18, 2025
satween
approved these changes
Aug 18, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds some battery and display attributes to view updates. The following fields were added:
battery_level
: The current battery charge level, expressed as a float from 0.0 (empty) to 1.0 (full). This is to align with ios, so we lose some granularity as android can measure to within 1% of the battery level while ios shows only to the nearest 10%. Monitored by polling once every 60 seconds - it didn't seem a good idea to register a listener as the listener was firing sometimes multiple times per second.low_power_mode
: A boolean indicating whether the device is currently in Low Power Mode. Monitored with a broadcast receiver.brightness_level
: The current screen brightness, normalized as a float between 0.0 (darkest) and 1.0 (brightest). Monitored with a content observer.Motivation
Part of adding metadata fields.
Additional Notes
Refactor of the architecture of the info providers since we now have three providers (accessibility/battery/display) - all classes now implement the InfoProvider interface and use the same generic NoOp class. The generic interface returns a kv map and we use the concrete data classes to convert between the objects and this representation.
Review checklist (to be filled by reviewers)