Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[usb_moded] Implement and use common mode selection logic. Fixes JB#5…
…3122 When device is booted up with cable connected and device lock code is not used, usb-mode is left at fallback_charging. This happens because usb-mode is re-evaluated on device unlock event, which does not occur when device lock is not used. Due to duplication of mode selection logic in various notification handlers, similar hard to find corner cases are likely to occur also when order of events is not as expected. Collect all mode selection logic into a single function and refactor control flow so that all triggers that might require a mode change are directed there. Additional changes to existing logic: - All mode changes are blocked until usb-moded enters mainloop - When shutdown is initiated, dynamic mode changes are blocked - Dynamic modes are canceled when user change is started, and - Re-evaluated / activated after user change is finished - Exception: already active rescue mode persists over user changes Reduce the amount of conditional MEEGOLOCK code by adding abstract helper functions in usb_moded.c and using those instead of functions that might not be available based on configuration options. Clean up unnecessary header file includes resulting from these and earlier changes. Signed-off-by: Simo Piiroinen <simo.piiroinen@jolla.com>
- Loading branch information
Showing
30 changed files
with
775 additions
and
393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.