Repository navigation
Description
What happened?
App.observeAppForeground() never receives a lifecycle event, so the hardware-wallet hooks it drives never run:
HwWalletRepo.onAppBackgrounded()→JadeRepo.onAppBackgrounded(), which releases an open Jade Bluetooth link 30 s after the app goes to the background.HwWalletRepo.onAppForegrounded()→JadeRepo/TrezorRepo.onAppForegrounded(), which cancels that pending release and auto-reconnects a known Bluetooth device when the app comes back.
The observer is attached to ProcessLifecycleOwner (App.kt:70-80). ProcessLifecycleOwner only follows activities once ProcessLifecycleInitializer has attached it, and that initializer runs from androidx.startup's InitializationProvider. AndroidManifest.xml:231-235 removes that provider (tools:node="remove", there since d17f43255). Nothing calls AppInitializer instead, so the registry stays at INITIALIZED, and ON_START and ON_STOP never fire.
This is the only ProcessLifecycleOwner user on master. It came up in review of #1838, which uses a started-activity counter in App.CurrentActivity (hasStartedActivity) for the same reason.
Expected behavior
Backgrounding the app releases an idle Jade Bluetooth link after 30 s. Returning to the app cancels that release and auto-reconnects a known Bluetooth Jade or Trezor.
Steps to Reproduce
- Pair a Jade over Bluetooth and leave it connected.
- Send Bitkit to the background for more than 30 s.
- The log never shows
Releasing the Jade bluetooth link while the app is in the background, and the link stays open. - Disconnect the device, then return to the app. The log never shows
Attempting Jade bluetooth auto-reconnect after app foregrounded(or the Trezor equivalent).
Logs / Screenshots / Recordings
Not captured. Found by reading the code and checking the lifecycle-process 2.10.0 sources and the merged devDebug manifest, which has no InitializationProvider and no ProcessLifecycleInitializer. Not yet confirmed on a device with a hardware wallet.
Bitkit Version
master 816f08ed7
Device / OS
All. Comes from the manifest, not the device.
Reproducibility
Always
Additional context
Two possible fixes:
- Keep the provider and remove only the initializers the app doesn't want (for example
androidx.work.WorkManagerInitializeras atools:node="remove"meta-data entry), soProcessLifecycleInitializerruns again. Check first why the whole provider was removed. - Drive these hooks from
App.CurrentActivity.hasStartedActivityonce fix: exit instead of releasing a detached node #1838 merges. That has no 700 ms debounce for configuration changes.
Activity
ovitrif commentedon Nov 10, 2026
Triage: in 3.2.0 at 📋 To do. The Jade and Trezor background release and auto-reconnect it describes are on master and ship in 3.2.0, so a fix belongs in this release.