Skip to content

Conversation

@akaMrNagar
Copy link
Owner

@akaMrNagar akaMrNagar commented Aug 3, 2025

We're transitioning from the current dual-tracking system (Usage Stats + Accessibility) to a more reliable and efficient Accessibility Service-only setup for tracking app usage and enforcing restrictions.

🧩 Problem with Current Implementation

At present, Mindful uses both Usage Stats and Accessibility Service to track app usage and apply restrictions. This results in a lot of redundant and boilerplate code.

However, there are a few critical issues:

  • Inconsistent behavior on custom ROMs: For example, on some Samsung devices, Usage Stats fails to detect the active app.
  • Foreground service limitations: Foreground services require an ongoing notification. If the user revokes notification permission, the system may kill the service - breaking usage tracking.
  • Notification Permission Requirement: Due to Android’s restrictions, Mindful is forced to request notification permission just to keep its tracking service alive - not ideal for user experience.

✨ The New Approach

We’re switching to an Accessibility Service-only model to simplify and strengthen the tracking

  • No need for a persistent notification - so no more dependency on notification permission.
  • Better service persistence - Accessibility services are managed by the system and are less likely to be killed, even on custom ROMs.
  • Improved tamper protection - Even if users disable overlay permissions, Mindful can still take users to the home screen when they try to open blocked content.
  • Modern and modular - This approach is now standard among many apps with similar functionality.

Overall, this results in a more reliable, robust, and maintainable tracking mechanism.

⚠️ Caveats

  • This is a significant shift and will likely introduce bugs and edge cases in the beginning.
  • It will require time for debugging and stabilization - I’ll release this in beta first.
  • Once fully tested and stable, we’ll roll it out to production.
  • Accessibility permission will now be required during onboarding - it will no longer be optional.

Your support during this transition will be crucial ❤️
I’m working on Mindful alongside a full-time job and other responsibilities, so progress may be slower than usual. I’ll try to squeeze in as much time as possible during weekdays and weekends - thank you in advance for your patience and understanding

📌 Tasks

  • Implement the new Accessibility Service
  • Detect active app accurately
  • Enforce app usage restrictions
  • Enforce focus mode
  • Enforce bedtime restrictions
  • Enforce short-form content restrictions (YouTube Shorts, Instagram Reels, etc.)
  • Enforce web content restrictions (may include new time-based rules)
  • Implement new database tables schema
  • Design UI for new features
  • Test manually
  • Release BETA for mass testing
  • Release in Production

✨ New Features

  • Separate restrictions for each days
  • Multiple schedules in a day
  • Session and cool-down for each day
  • Same restrictions and grouping on web too.
  • Keywords blocking (web)
  • Bulk websites and keywords import
  • Custom day start or restriction reset time (default 12 midnight)
  • and much more related to restrictions and wellbeing

😶‍🌫️ Sneak peak

Screenshot From 2025-11-03 19-58-30 Screenshot From 2025-11-03 19-58-40
Screenshot From 2025-11-03 19-58-52 Screenshot From 2025-11-03 20-01-48

Last updated : 13 Dec, 2025

Expected alpha : End of Dec 2025 or Mid Jan 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request high priority This is a top priority task or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants