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

RUMM-2931 prevent reporting ANR when app is in background #1239

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

xgouchet
Copy link
Member

What does this PR do?

Fixes #1067

This PR prevents reporting false positive ANRs when the application is in background.

Motivation

In some cases (#1067) the host application is in background and the SDK detekts multiple SDKs that are not actually perceived by the end user.

@xgouchet xgouchet marked this pull request as ready for review January 18, 2023 14:07
@xgouchet xgouchet requested a review from a team as a code owner January 18, 2023 14:07
@codecov-commenter
Copy link

codecov-commenter commented Jan 18, 2023

Codecov Report

Merging #1239 (9d3221b) into develop (a54ed7a) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop    #1239      +/-   ##
===========================================
+ Coverage    82.50%   82.53%   +0.04%     
===========================================
  Files          353      353              
  Lines        11832    11833       +1     
  Branches      2015     2016       +1     
===========================================
+ Hits          9761     9766       +5     
+ Misses        1461     1460       -1     
+ Partials       610      607       -3     
Impacted Files Coverage Δ
...d/rum/internal/domain/scope/RumViewManagerScope.kt 98.17% <100.00%> (+0.02%) ⬆️
.../android/rum/internal/monitor/DatadogRumMonitor.kt 92.82% <0.00%> (-0.55%) ⬇️
...android/rum/internal/ndk/DatadogNdkCrashHandler.kt 87.19% <0.00%> (-0.49%) ⬇️
...in/com/datadog/android/log/internal/LogsFeature.kt 88.71% <0.00%> (ø)
...android/log/internal/logger/TelemetryLogHandler.kt 85.71% <0.00%> (ø)
...android/v2/core/internal/DatadogContextProvider.kt 83.82% <0.00%> (ø)
.../kotlin/com/datadog/android/v2/core/DatadogCore.kt 90.32% <0.00%> (+0.46%) ⬆️
...android/log/internal/domain/DatadogLogGenerator.kt 97.39% <0.00%> (+0.65%) ⬆️
...ndroid/telemetry/internal/TelemetryEventHandler.kt 73.77% <0.00%> (+1.64%) ⬆️
...d/v2/core/internal/storage/FileEventBatchWriter.kt 97.62% <0.00%> (+2.38%) ⬆️
... and 1 more

@xgouchet xgouchet merged commit c059b67 into develop Jan 18, 2023
@xgouchet xgouchet deleted the xgouchet/RUMM-2931/discard_background_ANRs branch January 18, 2023 15:56
// Given
testedScope.applicationDisplayed = true
val fakeEvent = RumRawEvent.AddError(
message = ANRDetectorRunnable.ANR_MESSAGE,
Copy link

@emartynov emartynov Jan 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably off topic - from names ANRDetectorRunnable.ANR_MESSAGE and ANRException I can not draw an understanding that it is a background ANR.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, testedScope has applicationDisplayed as true, which sounds to me as if it is not in the background.

@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.

ANR reports number is significantly different from the Google Play
5 participants