Skip to content

[WIP] Add Quick Settings Tile - Logic Updated and Crash Fix Applied#3155

Draft
JNavas2 wants to merge 10 commits intoPhilippC:mainfrom
JNavas2:feature/quick-settings-tile-v2
Draft

[WIP] Add Quick Settings Tile - Logic Updated and Crash Fix Applied#3155
JNavas2 wants to merge 10 commits intoPhilippC:mainfrom
JNavas2:feature/quick-settings-tile-v2

Conversation

@JNavas2
Copy link

@JNavas2 JNavas2 commented Jan 19, 2026

[WIP] Add Quick Settings Tile - Implementation Updated

⚠️ WORK IN PROGRESS (DRAFT)

This PR adds a System Quick Settings Tile to the Android notification shade to allow users to quickly launch the application.

Technical Changes

  • Corrected Entry Point: The launch intent now targets SelectCurrentDbActivity, resolving the previous compilation error.
  • Crash Prevention: Added ActivityFlags.NewTask to the Intent. This is mandatory when starting an Activity from a Service context and fixes the CallingContextException reported earlier.
  • System Theming: Added android:tint="?android:attr/colorControlNormal" to the vector asset to ensure the icon is visible across various system themes (Light/Dark mode).
  • Repository Structure: Verified and corrected the file locations to align with the project structure (graphics/ and src/).

Status

I am submitting this as a Draft to provide the updated files and logic for initial review. Due to the time required for environment setup, I have not yet performed local compilation and functional testing on this specific branch. I intend to complete local validation soon, but wanted to share the logic improvements in the meantime.

Files Modified:

  1. graphics/quick_settings/ic_quick_settings_tile.svg
  2. src/keepass2android-app/Resources/drawable/ic_quick_settings_tile.xml
  3. src/keepass2android-app/QuickSettingsTileService.cs
  4. src/keepass2android-app/Manifests/AndroidManifest_debug.xml
  5. src/keepass2android-app/Manifests/AndroidManifest_net.xml
  6. src/keepass2android-app/Manifests/AndroidManifest_nonet.xml

@JNavas2
Copy link
Author

JNavas2 commented Jan 19, 2026

While I'm working on getting a local environment set up for full validation, would you mind triggering the automated build (CI) for this PR? That would help me confirm the compilation and repository structure are correct in the meantime.

Update: I would have tested it immediately if it were written in JavaScript or Kotlin, but setting up a full Xamarin/MAUI environment is a heavy lift for a single contribution. That is why I am asking for the automated build validation and testing at this stage.

Thanks!

Required to support Quick Settings Tile
Required for Quick Settings Tile
Required for Quick Settings Tile
@JNavas2
Copy link
Author

JNavas2 commented Jan 19, 2026

I’ve raised the minSdkVersion from 21 to 24 as part of the Quick Settings Tile implementation.
TileService, IsLocked, and UnlockAndRun() are all API‑24+ features, and keeping the old minSdk would require reflection or conditional guards to avoid class‑loading issues on older devices. Since Android 7.0+ now represents the overwhelming majority of active devices, moving to API 24 provides a cleaner, safer implementation with no compatibility hacks.
This change ensures the tile works reliably across all supported devices and simplifies long‑term maintenance.

@PhilippC
Copy link
Owner

you can of course start testing with the increased api level. But even if API levels 21..23 covers only 1-2% of devices, this is still more than 10.000 affected installations which wouldn't get any update more. Therefore, the production code should use Target API and Check the Version SDK as is done in other places as well.

@JNavas2
Copy link
Author

JNavas2 commented Jan 26, 2026

you can of course start testing with the increased api level. But even if API levels 21..23 covers only 1-2% of devices, this is still more than 10.000 affected installations which wouldn't get any update more. Therefore, the production code should use Target API and Check the Version SDK as is done in other places as well.

You're the boss, so I will revert the API level for production,
but first please approve the workflow for testing. Thank you.

@JNavas2
Copy link
Author

JNavas2 commented Feb 2, 2026

Please approve the workflow for testing. Thank you.

@JNavas2
Copy link
Author

JNavas2 commented Feb 4, 2026

Thank you for the build, which failed due to the project API version requirement.
Since the project requires a baseline of API 21, adding the necessary runtime guards and manifest overrides to support TileService safely on older devices is a refactoring task I cannot validate without a local Xamarin environment.
I think it's probably best to leave it until the project API is updated to 24 or higher.
I’ll leave this PR in draft so the logic is available to pick up or adapt.

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.

2 participants