Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Fix foreground state emissions (DEV) #2112

Merged
merged 1 commit into from Jan 15, 2021

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Jan 15, 2021

While working on the statistics I noticed that the foreground detection just wasn't working.
We did not emit the values and relied on setting the static property.

@d4rken d4rken requested a review from a team January 15, 2021 14:50
@d4rken d4rken added this to the 1.11.0 milestone Jan 15, 2021
@d4rken d4rken added bug Something isn't working maintainers Tag pull requests created by maintainers labels Jan 15, 2021
@sonarcloud
Copy link

sonarcloud bot commented Jan 15, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

50.0% 50.0% Coverage
0.0% 0.0% Duplication

@ralfgehrer ralfgehrer self-assigned this Jan 15, 2021
Copy link
Contributor

@ralfgehrer ralfgehrer left a comment

Choose a reason for hiding this comment

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

LGTM.

@Qualifier
@MustBeDocumented
@Retention(AnnotationRetention.RUNTIME)
annotation class ProcessLifecycle
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this?

Copy link
Member Author

@d4rken d4rken Jan 15, 2021

Choose a reason for hiding this comment

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

ProcressLifecycleOwner.get(): LifecycleOwner, the interface is generic and there are multiple types of LifecycleOwner, so they don't get mixed up in the DI graph, we qualify this specific type of LifecycleOwner with the annotation, similar to how we handle Context.

Copy link
Member Author

Choose a reason for hiding this comment

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

class Example constructor(@ProcessLifecycle val lifecycleOwner: LifecycleOwner)

@d4rken d4rken merged commit a36cf7e into release/1.11.x Jan 15, 2021
@d4rken d4rken deleted the fix/DEV-foreground-state-emissions branch January 15, 2021 15:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working maintainers Tag pull requests created by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants