Battery not low constraint#30
Merged
rteyssandier merged 9 commits intoJan 13, 2026
Merged
Conversation
…ery-not-low-constraint
rteyssandier
approved these changes
Jan 13, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for a new "require battery not low" constraint throughout the Lorraine job scheduling library, including both data model and platform-specific implementations. The main changes include updating the constraints data structures, database schema, and adding iOS-specific logic for checking battery state.
Constraint Model and Entity Updates:
requireBatteryNotLowproperty toLorraineConstraints,ConstraintEntity, and their conversion functions, allowing jobs to specify this constraint. [1] [2]LorraineConstraintsDefinition) to support the new constraint.Database Schema Migration:
require_battery_not_lowfield in theworkertable. [1] [2]Android and iOS Platform Integration:
asWorkManagerConstraints) to setrequiresBatteryNotLowbased on the new property.BatteryNotLowCheckconstraint check on iOS, integrating it into the platform's constraint checks. [1] [2]iOS Battery Constraint Implementation:
BatteryNotLowCheckandAppleBatteryObserverclasses to monitor battery state and expose the "not low" status to the scheduler, using UIKit battery notifications.