Aegis icon indicating copy to clipboard operation
Aegis copied to clipboard

Quick settings shortcut doesn't work anymore

Open AdriandeLima opened this issue 3 months ago • 16 comments

Version

3.4.1

Source

Google Play

Vault encryption

Yes (with biometric unlock)

Device

Pixel 6

Android version

16 (BP3A.250905.014)

ROM

No response

Steps to reproduce

Add the quick settings tile - it shows unavailable. Nothing happens when tapping the tile

What do you expect to happen?

Tapping the tile should open the aegis vault

What happens instead?

Nothing

Log

Image

AdriandeLima avatar Sep 06 '25 16:09 AdriandeLima

experiencing this aswell

Miltora avatar Sep 08 '25 06:09 Miltora

Interesting... I can't reproduce this for the life of me while running the same Android version. Did you try re-adding the quick settings tile?

michaelschattgen avatar Sep 08 '25 18:09 michaelschattgen

Interesting... I can't reproduce this for the life of me while running the same Android version. Did you try re-adding the quick settings tile?

Hi Michael, silly me, didn't try that. That works actually, thank you. It happened after I updated it to Android 16 QPR 1, that it showed, that it is unavailable

Miltora avatar Sep 09 '25 06:09 Miltora

@Miltora I'm happy that it worked for you! Although I'm not convinced it will stay like this. We've had similar bug reports in the past where the quick setting tile became unavailable after a few days. Please let us know if that's the case.

michaelschattgen avatar Sep 09 '25 06:09 michaelschattgen

@michaelschattgen I experienced that in the past, the difference is, it showed it was unavailable, but when I double clicked it, it opened still anyway. I'll ping you, if it doesn't work anymore.

Miltora avatar Sep 09 '25 07:09 Miltora

Had the same issue after updating to Android 16 QPR 1. Re-adding solved it for now 👍

DerStimmler avatar Sep 10 '25 13:09 DerStimmler

It seems like re-adding the quick settings toggle works until the phone is rebooted, and it gets disabled again.

Pixel 9 Pro Android 16 (BP3A.250905.014)

Wanyal avatar Sep 12 '25 10:09 Wanyal

It seems like re-adding the quick settings toggle works until the phone is rebooted, and it gets disabled again.

Pixel 9 Pro Android 16 (BP3A.250905.014)

I see this same behavior on my P7 running the latest QPR1. Have to re-add after every reboot. It's an easy enough workaround for now but hope the bug is eventually fixed

c0l4bin avatar Sep 12 '25 22:09 c0l4bin

It seems like re-adding the quick settings toggle works until the phone is rebooted, and it gets disabled again. Pixel 9 Pro Android 16 (BP3A.250905.014)

Confirmed. On Android 15, the Quick Settings tile was greyed out, marked Unavailable, but still worked. On Android 16 it no longer works when marked Unavailable.

JNavas2 avatar Sep 16 '25 22:09 JNavas2

Any progress/hope?

JNavas2 avatar Oct 13 '25 14:10 JNavas2

Still doesn't work for me, the tile's completely broken, even after re-adding.

AdriandeLima avatar Oct 23 '25 20:10 AdriandeLima

Still doesn't work for me, the tile's completely broken, even after re-adding.

Still the same behavior here: works after being added but greyed out-stops working after a reboot until deleted and then added again.

JNavas2 avatar Oct 23 '25 20:10 JNavas2

Any update on this? 🥲

Kianda avatar Nov 05 '25 12:11 Kianda

Any prospect of this getting fixed?

JNavas2 avatar Nov 19 '25 22:11 JNavas2

No updates. Did not have the time to look into this and besides that I am still unable to reproduce this on my devices.

michaelschattgen avatar Nov 19 '25 22:11 michaelschattgen

@michaelschattgen Thanks for the quick response. It's reproducible on my Pixel 9 Pro (running Android 16) even after reinstalling your app from scratch, but I'm not able to reproduce it in the Android Studio emulator. Gemini 3 Pro assessment: Quick Settings Tile unavailable after reboot I'd be happy to help troubleshoot the issue if and when you get the time. Thanks.

JNavas2 avatar Nov 20 '25 01:11 JNavas2

Updated Gemini Pro assessment from considerable investigation and testing:

Title: Quick Settings Tile remains disabled after reboot when Biometric Unlock is enabled

Description

The Aegis Quick Settings tile fails to become enabled/active after a device reboot specifically when Biometric Unlock is enabled in the app settings. The tile appears grayed out and non-functional.

A unique observation: after applying a system update which forced a reboot, the tile was correctly enabled. This suggests a race condition where the TileService fails to bind or initialize its security layer during a standard boot sequence, but succeeds during the higher-priority refresh cycle that follows an OS update.

Steps to Reproduce

  1. Enable Biometric Unlock in Aegis (Settings > Security).
  2. Add the Aegis Quick Settings tile to the Android notification shade.
  3. Reboot the phone.
  4. Observe: The Aegis tile is disabled/grayed out. Manual app launch does not fix it.
  5. Workaround Test: Disable Biometric Unlock in Aegis settings.
  6. Reboot the phone.
  7. Observe: The Aegis tile is enabled and functional immediately across multiple reboots.

Expected Behavior

The TileService should successfully bind and transition to an enabled state after reboot regardless of the biometric configuration, possibly by deferring keystore-dependent checks until the service is fully bound or the user has performed the first unlock.

Actual Behavior

With Biometric Unlock enabled, the tile remains in a "stale" disabled state post-boot. It appears the TileService may be crashing or failing to register when it attempts to access biometric-backed keys in the Android Keystore before the system's biometric APIs are ready or before the initial post-boot decryption (Direct Boot).

Environment

  • Aegis Version: v3.4.1
  • Android Version: Android 16 (December 2025 update)
  • Device: Pixel 9 Pro (Caiman)

Additional Context

  • The "Calculator" comparison: A standard system calculator tile initially shows as disabled but becomes enabled within seconds of boot. This suggests the OS is broadcasting a signal that Aegis is either missing or failing to process.
  • The issue is 100% reproducible on this device when Biometrics are toggled ON, and 100% resolved when toggled OFF.

JNavas2 avatar Dec 20 '25 21:12 JNavas2

Technical Assessment & Suggested Fix

Based on the behavior where Biometric Unlock acts as the toggle for this bug, the root cause appears to be a SecurityException or a Initialization Failure within the AegisTileService during the Android "Direct Boot" or early-post-unlock phase.

The Root Cause

  1. Keystore Dependency: When Biometric Unlock is enabled, Aegis likely attempts to initialize its cryptographic providers or check vault status via the Android Keystore when the TileService receives the onStartListening() callback from the OS.
  2. The "Cold" Keystore: Immediately after a reboot, especially before the first unlock (Direct Boot), biometric-backed keys are hardware-locked. If the TileService attempts to access these keys or the BiometricPrompt API before the system service is ready, it likely triggers an unhandled exception or returns an unexpected null.
  3. Service Blacklisting: Android's TileManager is notoriously sensitive. If a TileService fails to respond correctly or crashes during its initial post-boot binding, the OS often "blacklists" the tile, rendering it grayed out/unavailable until the tile is manually removed and re-added (which forces a registry refresh).

Suggested Solution: "Lazy" Tile Initialization

To resolve this, the TileService should avoid any Keystore or Biometric API calls during the initial OS binding.

  • Implement a Fail-Safe State: In onStartListening(), the service should check UserManager.isUserUnlocked(). If the user is not yet unlocked, or if the vault is detected as locked, the tile should immediately set a default "Locked" state using static resources rather than attempting to initialize the full VaultManager or Biometric paths.
  • Deferred Refresh: Register a broadcast receiver for Intent.ACTION_USER_UNLOCKED. Once triggered, the app can then safely call TileService.requestListeningState() to refresh the tile icon and functionality when the Keystore is actually accessible.
  • Graceful Exception Handling: Wrap the TileService initialization logic in a try-catch block that catches android.security.keystore.KeyPermanentlyInvalidatedException or hardware availability errors, ensuring the service stays "alive" in the eyes of the OS even if the vault is unreachable.

JNavas2 avatar Dec 20 '25 21:12 JNavas2

I have submitted a Pull Request that addresses the Quick Settings tile disabling issue discussed here.

Based on the discovery that Biometric Unlock triggers a race condition during the boot sequence, the fix implements a "Direct Boot" aware strategy. It modifies LaunchAppTileService to handle the initial binding defensively and updates VaultLockReceiver to listen for the ACTION_USER_UNLOCKED broadcast. This ensures the tile is forcefully refreshed via requestListeningState() as soon as the Keystore and biometric hardware become available after the first post-reboot unlock.

You can find the PR here: https://github.com/beemdevelopment/Aegis/pull/1750 Code revisions were created using Google Gemini Pro AI.

JNavas2 avatar Dec 20 '25 22:12 JNavas2