Repository navigation
feat(android): add a daily wallpaper schedule (3.7.0) - #88
Merged
Merged
Conversation
startDailySchedule caches every entry, applies the entry that owns the current local time, stops rotation and arms one inexact alarm for the next switch. Boot, clock, time zone and package-replace broadcasts apply the current entry and arm the alarm again. Starting rotation stops the schedule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kotlin tests cover the switch maths across midnight, DST days and time zones, the request validator and the store. Dart tests cover the API. The example app gains a Daily schedule section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Receivers could exceed their deadline, failed handoffs could destroy prior schedules, and clock-boundary starts could miss an interval. Preserve rollback sources and expose cache and persistence failures. Keep public stop cleanup unconditional and handoff cleanup reversible. Add 42 regression tests. Cross-mode process-death recovery remains open pending a policy for ambiguous persisted modes.
A queued job can wait for a Doze maintenance window, so the morning switch could land only when the phone wakes. Receivers now apply at once when the coordinator lock frees within 3 seconds, and queue the durable job only when it does not or the apply throws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ship the daily schedule in the unreleased 3.7.0 next to per-screen live wallpapers. Pigeon bindings are regenerated from the merged input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A returned FAILED outcome counted as handled, so only a busy lock or an exception reached the durable job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merge picked up a lockfile that a newer local Flutter SDK rewrote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Why
Prism's Day and night needs one wall by day and one by night on Android. 3.6.0 cannot switch at two times of day:
timeOfDayfires once a day on the hour, and every trigger moves a playlist cursor instead of reading the clock. This adds a daily schedule next to rotation, built to the spec in Hash-Studios/Prism#811 ("Android: what the plugin needs"). Hash-Studios/Prism#819 uses it.What changed
startDailySchedule(DailyScheduleRequest),stopDailySchedule(),applyCurrentScheduleEntry()andgetDailyScheduleStatus(). A request has 2 to 100{minuteOfDay, source}entries, a target, and the same URL and file sources as rotation. Every source is cached at start; one failure rejects the request and leaves the running mode alone.setAndAllowWhileIdlealarm is armed for the next switch (noSCHEDULE_EXACT_ALARM). Each delivery applies the entry that owns the current time, not a cursor, then arms the next one.DailyScheduleMathfinds the next switch by walking whole minutes with the zone's real offsets, so DST gaps, repeated hours and zone changes follow one rule.BOOT_COMPLETED,TIME_SET,TIMEZONE_CHANGEDandMY_PACKAGE_REPLACED(new in the manifest) apply the current entry and re-arm. Receivers apply at once inside the alarm's idle allowance. If another wallpaper change holds the lock for more than 3 seconds, or the apply throws, a WorkManager job applies it later.none,rotation,dailySchedule), the current and last applied entry, the next switch time and the last error.Scope
unsupportedand status modenone.Tradeoffs
java.time: minSdk is 24, andjava.timewould need core library desugaring in every app. The walk is at most 3 days of minutes, once per switch.Review
Codex (
gpt-6.1-sol, high) reviewed 3.6.0..HEAD before the proof. Boat refused sandbox creation (403), so it ran locally. It reproduced each defect with a test first, then fixed it (42 tests):lastErrorat once, apply returnsfailed, andnextSwitchEpochMsis 0.Codex had moved receivers to queue-only WorkManager recovery. I put back the direct apply with a 3 second lock wait and kept the job as the fallback (
cc6552c, 3 tests).One finding needs your call. A process death between the rotation commit and the daily commit can restart both schedules. Options:
AutoRotateMode. I would pick this one.Verification
:async_wallpaper:testDebugUnitTest, 257 tests, 0 failures.DailyScheduleMathTestchecks midnight, the New York spring gap and fall back, London DST days minute by minute, Kolkata and Kathmandu offsets, and a zone change for the same instant.flutter test82 passed (19 intest/daily_schedule_test.dart),flutter analyzeno issues, exampleflutter test11 passed.flutter build apk --debugbuiltapp-debug.apk.Release order
fvm flutter pub getin feat(day-night): run Day and night on Android with the async_wallpaper daily schedule Hash-Studios/Prism#819, which already asks for^3.7.0, then merge it.🤖 Generated with Claude Code