Skip to content

[Actions] Restore device state changed by an automation #10

Description

@emi-ran

Feature

Let an automation restore system state captured before it changed it.

Scope

Initial restoreable state: sound profile, media volume, brightness plus auto-brightness, auto-rotate, DND, dark theme, Wi-Fi, and Bluetooth.

Design constraints

  • Capture only state that an action will change, immediately before that action succeeds. Record a provenance token tied to rule/run/action; do not snapshot unrelated device state.
  • Define restoration trigger explicitly: manual restore, rule completion, inverse trigger, profile deactivation, or configurable option. Avoid automatic rollback that overwrites a user change made after execution.
  • Before restoring, compare current state with value FlowPilot last applied. If user/OEM changed it, warn/skip rather than clobber it.
  • Store bounded, encrypted-at-rest snapshots with TTL and cleanup. Never include webhook, phone, SMS, notification, or clipboard data.
  • Every capture/restore needs capability checks and readback. Partial restore must be reported per field.

Acceptance criteria

  • Restore returns supported states to captured values when unchanged by user.
  • User change after automation prevents silent overwrite.
  • Process restart, expired token, missing permission, and unsupported state fail honestly.

Verification

  • Unit tests for snapshot lifecycle, compare-and-restore, TTL, and partial failures.
  • Xiaomi smoke tests per state, including Shizuku/permission denial and manual user override.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions