Skip to content

RUMM-3094 fix unreliable plugged battery info#1315

Merged
xgouchet merged 1 commit into
release/1.17.0from
xgouchet/RUMM-3094/unreliable_plugged_deevices
Mar 6, 2023
Merged

RUMM-3094 fix unreliable plugged battery info#1315
xgouchet merged 1 commit into
release/1.17.0from
xgouchet/RUMM-3094/unreliable_plugged_deevices

Conversation

@xgouchet

@xgouchet xgouchet commented Mar 3, 2023

Copy link
Copy Markdown
Contributor

What does this PR do?

On some devices (e.g. Fire TV on OS 7.6.2.4), the BatteryManager.EXTRA_PLUGGED returns 0, when the device is clearly plugged. Because we only upload tracked data when the device as enough power (battery > 10% or device is plugged), the device doesn't upload anything on those devices.

The fix relies on the BatteryManager.EXTRA_PRESENT that tells if a battery is present on the device. We can then assume that if the battery is not present, and the device is alive running the app, that it has another power source.

@xgouchet
xgouchet requested a review from a team as a code owner March 3, 2023 17:08
@xgouchet
xgouchet changed the base branch from develop to release/1.17.0 March 3, 2023 17:08
@codecov-commenter

codecov-commenter commented Mar 3, 2023

Copy link
Copy Markdown

Codecov Report

Merging #1315 (dad6505) into release/1.17.0 (16543f7) will decrease coverage by 0.12%.
The diff coverage is 100.00%.

@@                Coverage Diff                 @@
##           release/1.17.0    #1315      +/-   ##
==================================================
- Coverage           82.11%   81.99%   -0.12%     
==================================================
  Files                 361      361              
  Lines               12832    12833       +1     
  Branches             2153     2154       +1     
==================================================
- Hits                10536    10522      -14     
- Misses               1653     1658       +5     
- Partials              643      653      +10     
Impacted Files Coverage Δ
...rnal/system/BroadcastReceiverSystemInfoProvider.kt 98.08% <100.00%> (+0.04%) ⬆️
.../datadog/android/sessionreplay/utils/ThemeUtils.kt 83.33% <0.00%> (-16.67%) ⬇️
...main/java/com/datadog/exec/CommonTaskExecutor.java 45.83% <0.00%> (-4.17%) ⬇️
...droid/rum/tracking/FragmentViewTrackingStrategy.kt 75.00% <0.00%> (-3.85%) ⬇️
...id/rum/internal/ndk/DatadogNdkCrashEventHandler.kt 91.00% <0.00%> (-3.00%) ⬇️
...in/com/datadog/android/log/internal/LogsFeature.kt 86.92% <0.00%> (-2.31%) ⬇️
...ain/java/com/datadog/opentracing/PendingTrace.java 58.62% <0.00%> (-1.72%) ⬇️
...ndroid/telemetry/internal/TelemetryEventHandler.kt 73.44% <0.00%> (-0.78%) ⬇️
.../kotlin/com/datadog/android/v2/core/DatadogCore.kt 85.59% <0.00%> (-0.42%) ⬇️
.../android/rum/internal/domain/scope/RumViewScope.kt 95.20% <0.00%> (-0.18%) ⬇️
... and 2 more

@xgouchet
xgouchet merged commit acb2661 into release/1.17.0 Mar 6, 2023
@xgouchet
xgouchet deleted the xgouchet/RUMM-3094/unreliable_plugged_deevices branch March 6, 2023 09:37
@xgouchet xgouchet added this to the 1.17.0 milestone Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants