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

Wear OS 4, Passive Data, Heart Rate collecting not working in background #101

Closed
amoledwatchfaces opened this issue Aug 5, 2023 · 5 comments

Comments

@amoledwatchfaces
Copy link

Background Heart Rate collection is not working on Wear OS 4. Tried with own app (PassiveListenerCallback) but also with PassiveData sample (PassiveDataService.kt)

@amoledwatchfaces amoledwatchfaces changed the title Wear OS 4, Passive Data, PassiveListenerCallback not working in background Wear OS 4, Passive Data, Heart Rate collecting not working in background Aug 5, 2023
@jluebbe
Copy link

jluebbe commented Oct 20, 2023

@amoledwatchfaces Did you get this to work on Wear OS 4? I think I have the same issue.

@amoledwatchfaces
Copy link
Author

Hi, it's not really an issue. Wear OS is killing app in the background after some time of inactivity. This applies for both PassiveListenerCallback / PassiveListenerService. I though that PassiveListenerService will work like WearableListenerService so it wont be killed by system but unfortunately, it's not the case.

@breanatate
Copy link
Collaborator

@jluebbe Are you also requesting the body sensors background permission?

@cancan101
Copy link
Contributor

I solved this problem by requesting the BODY_SENSORS_BACKGROUND permission. Without doing so, once the app was closed, I no longer received updates (either data points or user activity).

I was a bit confused by the linked docs, however. It states that the app should "Check if BODY_SENSORS_BACKGROUND is granted. If not, request the permission" but then down below it states "the runtime permission dialog doesn't include the "Allow all the time" option. Instead, users must enable all-the-time background sensor access from system settings".

What is the point of checking (and requesting) the BODY_SENSORS_BACKGROUND if the user needs to enable it manually?

@amoledwatchfaces
Copy link
Author

From my experience, even with BODY_SENSORS_BACKGROUND, Passive Listener Service is killed after few hours of inactivity on Wear OS 4. Callback is killed right after app is closed.

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

No branches or pull requests

4 participants