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

Exit on hal errors during initialization #26

Merged
merged 2 commits into from
May 13, 2024

Conversation

spiiroin
Copy link
Contributor

@spiiroin spiiroin commented May 8, 2024

No description provided.

In theory sensors API version 1 should provide batch() method and older
versions should provide setDelay() method. But there are hal libraries that
differ from that and/or report incorrect version information - which then
can lead to crashes when calls to null function pointers are made.

Check availability of both batch() and setDelay() methods. Use API version
information to decide which one to try first, and use fallback error code
for diagnostic logging if neither method is available.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jolla.com>
At what stage of bootup sensors can be accessed via android hal varies from
one device to another. If sensorfwd is started too early, it can end up
finding no sensors and still remain running without serving any useful
purpose.

Make sensorfwd exit if sensor hal probing fails in ways where no sensible
operation is not going to be possible.

Rate limit restart attempts by systemd to allow droid hal init some time to
reach state where sensors might be available.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jolla.com>
Copy link

@Thaodan Thaodan left a comment

Choose a reason for hiding this comment

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

LGTM

@spiiroin spiiroin merged commit bec350b into sailfishos:master May 13, 2024
@spiiroin spiiroin deleted the jb61939_hal_init branch May 13, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants