Fix: resolve Quick Settings tile disabling after reboot #1750
+65
−96
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.
Description
This PR resolves the issue where the Aegis Quick Settings tile remains in a disabled/grayed-out state after a device reboot. The issue is consistently reproducible when Biometric Unlock is enabled.
The Problem
During a standard Android boot sequence, the
LaunchAppTileServiceattempts to bind to the system. When Biometric Unlock is active, the app's security layer interacts with the Android Keystore. Early in the boot process (the "Direct Boot" or Credential Encrypted phase), these hardware-backed APIs are often unavailable or return security exceptions.When the Android
TileManagerencounters an unhandled exception or a bind failure during this initial scan, it often "blacklists" the tile, rendering it unavailable until the user manually removes and re-adds it.The Fix
This PR implements a "defensive" Direct Boot strategy to ensure the tile remains stable regardless of the boot timing:
VaultLockReceiverasdirectBootAware="true"in the Manifest to allow it to receive system signals before the first unlock.LaunchAppTileServiceto checkUserManager.isUserUnlocked(). If the device is still encrypted, it sets a safeSTATE_INACTIVEinstead of attempting to access protected resources.Intent.ACTION_USER_UNLOCKEDto theVaultLockReceiver. This ensures that as soon as the user provides their first PIN/biometric unlock and the Keystore becomes available, the app forces a tile refresh viaTileService.requestListeningState().Testing Performed