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

Separate lifecycle callbacks for activity + process state #69

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

fractalwrench
Copy link
Contributor

Goal

Separates the lifecycle callbacks for the activity + process state. Currently these are implemented together in the same class (ActivityService) but these are distinct responsibilities so we should separate them.

I have refactored the implementation so that ProcessStateService is responsible for tracking the process foreground/background state, and that ActivityTracker is responsible for tracking activity lifecycle callbacks.

Testing

Updated existing test coverage.

@fractalwrench fractalwrench requested a review from a team as a code owner November 14, 2023 16:55
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Merging #69 (d364e76) into master (5168910) will decrease coverage by 0.01%.
Report is 2 commits behind head on master.
The diff coverage is 81.81%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #69      +/-   ##
==========================================
- Coverage   76.06%   76.05%   -0.01%     
==========================================
  Files         309      311       +2     
  Lines       10046    10074      +28     
  Branches     1447     1450       +3     
==========================================
+ Hits         7641     7662      +21     
- Misses       1817     1824       +7     
  Partials      588      588              
Files Coverage Δ
...mbrace/android/embracesdk/anr/EmbraceAnrService.kt 90.16% <ø> (ø)
...racesdk/capture/crumbs/EmbraceBreadcrumbService.kt 74.41% <ø> (ø)
...k/capture/crumbs/PushNotificationCaptureService.kt 78.00% <ø> (ø)
...racesdk/capture/metadata/EmbraceMetadataService.kt 84.61% <100.00%> (ø)
...k/capture/powersave/EmbracePowerSaveModeService.kt 71.73% <100.00%> (ø)
...roid/embracesdk/capture/user/EmbraceUserService.kt 70.17% <ø> (ø)
.../android/embracesdk/config/EmbraceConfigService.kt 85.44% <ø> (ø)
...ce/android/embracesdk/event/EmbraceEventService.kt 86.36% <ø> (ø)
...oid/embracesdk/injection/EssentialServiceModule.kt 95.65% <100.00%> (+0.06%) ⬆️
...oid/embracesdk/injection/SdkObservabilityModule.kt 100.00% <100.00%> (ø)
... and 15 more

}

@Nullable
ActivityTracker getActivityLifecycleTracker() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Who calls this? If we don't need this I'd rather not have it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

EmbraceAutomaticVerification calls it (and other services) unfortunately

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ack....

Copy link
Collaborator

@bidetofevil bidetofevil left a comment

Choose a reason for hiding this comment

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

Looks good to me

@fractalwrench fractalwrench merged commit eb47bec into master Nov 15, 2023
4 checks passed
@fractalwrench fractalwrench deleted the process-state-tracker branch November 15, 2023 08:02
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.

2 participants