Skip to content

fix: move storage and system queries off the UI thread - #33

Merged
andre487 merged 2 commits into
mainfrom
fix/ui-thread-io
Oct 15, 2026
Merged

andre487 merged 2 commits into
mainfrom
fix/ui-thread-io

Conversation

@andre487

Copy link
Copy Markdown
Owner

Changes

Cold startup and several UI callbacks synchronously loaded preferences, decrypted the token, created directories, queried system services, or inspected APK files. Move this work off the main thread, load connection settings before enabling edits, and preserve stored values when an update occurs before loading completes.

  • Defer outbox/log-directory access and initialize WorkManager from background recovery.
  • Move update preferences, installer detection, notification/permission queries, APK installation preparation, and crash-dialog persistence to background execution. Use completed preference writes instead of pending apply() writes that lifecycle transitions can await.
  • Make capture-error reporting asynchronous and coalesce concurrent reports. Ensure cold-start capture and delivery load settings before evaluating them.
  • Debounce numeric settings without disabling the input, avoid writes for unchanged settings, and compute app search results in the background using a package-name set instead of nested scans.
  • Add debug StrictMode logging and device coverage with main-thread disk/network violations terminating the test process; real Keystore calls additionally assert their thread. Document the checks and their limits.

Validation

  • 121 unit tests passed; Android lint passed.
  • Debug APK, instrumentation APK, and release APK built successfully.
  • 8 instrumentation tests passed on each of API 26 and API 35. The UI scenario covers persisted-token initialization, navigation, numeric input, diagnostics, update settings/dialogs, crash-dialog dismissal, lifecycle refresh, and capture-error reporting under StrictMode.
  • A cold launch of the regular app on API 35 produced no StrictMode violations or crashes; background WorkManager recovery completed.
  • Diff whitespace checks passed. Disposable test emulators were removed afterward.

StrictMode coverage is scenario-based and does not establish a universal frame-time guarantee or detect every native/platform operation.

@andre487
andre487 merged commit 6134c16 into main Oct 15, 2026
17 checks passed
@andre487
andre487 deleted the fix/ui-thread-io branch October 15, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant