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

[sensorfw] Activate sensors on sensorfwd restart. Fixes JB#41999 #2

Merged
merged 1 commit into from
May 7, 2024

Conversation

spiiroin
Copy link
Contributor

@spiiroin spiiroin commented May 7, 2024

Sometimes lipstick does not react to orientation changes and sensorfwd restarts do not help. Looks the fault is triggered when sensorfwd is not running or orientation sensor is not available during lipstick startup. The reason is that m_attemptRestart flag is set only when a start attempt fails due to sensorfwd not being present - within a conditional block that is not entered until sensorfwd has been seen to be available. Which then means that any initial start failure can get locked in, and no retries are made by qtsensors code within the application's life time.

When application calls sensor start, always set m_attemptRestart. So that an attempt is made to start the sensor whenever sensorfwd startup is detected, regardless of whether it succeeded earlier or not.

Sometimes lipstick does not react to orientation changes and sensorfwd
restarts do not help. Looks the fault is triggered when sensorfwd is not
running or orientation sensor is not available during lipstick startup.
The reason is that m_attemptRestart flag is set only when a start attempt
fails due to sensorfwd not being present - within a conditional block that
is not entered until sensorfwd has been seen to be available. Which then
means that any initial start failure can get locked in, and no retries are
made by qtsensors code within the application's life time.

Rename m_attemptRestart to m_startRequested. Set/clear it unconditionally
on start()/stop() call. When sensorfwd startup is detected, make an
attempt to start flagged sensors.

Also drop the practically unused "running" member variable.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jolla.com>
@spiiroin spiiroin merged commit 983da98 into sailfishos:mer-5.6 May 7, 2024
@spiiroin spiiroin deleted the jb41999_initial_start branch May 7, 2024 10:04
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