Skip to content

Replace dual tracking with Accessibility-Only approach#200

Draft
akaMrNagar wants to merge 2 commits intomainfrom
e/usageTracking
Draft

Replace dual tracking with Accessibility-Only approach#200
akaMrNagar wants to merge 2 commits intomainfrom
e/usageTracking

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 : 30 Jan, 2025

Expected alpha : Feb starting week

@anasalzuvix
Copy link

Any Progress (2) @akaMrNagar

@guguss-31
Copy link

Any updates @akaMrNagar ?

@akaMrNagar
Copy link
Owner Author

I was unavailable for last 2 weeks, my cousin passed away but now I'm back to work

Planning to release alpha next week

@WreckingBANG
Copy link

I was unavailable for last 2 weeks, my cousin passed away but now I'm back to work

Planning to release alpha next week

Sorry for your loss, take your time.

@Clover-14
Copy link

Clover-14 commented Feb 8, 2026

α ? @akaMrNagar

@akaMrNagar
Copy link
Owner Author

akaMrNagar commented Feb 8, 2026

Turns out we need to wait for google's review to resume alpha track then maybe for initial release too (Not sure)

@Clover-14
Copy link

Clover-14 commented Feb 8, 2026

Turns out we need to wait for google's review to resume alpha track then maybe for initial release too (Not sure)

Release here?@akaMrNagar

@akaMrNagar
Copy link
Owner Author

Can't otherwise people will keep creating new issues even for alpha.

Are you not in Telegram channel?

@Clover-14
Copy link

Yeah not there, will join

@Clover-14
Copy link

@akaMrNagar can you send via email?

@akaMrNagar
Copy link
Owner Author

akaMrNagar commented Feb 8, 2026

Why are you in so much hurry??

Why don't you understand releasing with less bugs is more important then hurrying that's it I'm tired of trying and working over the clock....

Let me be very clear i don't know how much time it's gonna take to get reviewed and all. I will first release alpha to only selected users then will go to BETA on both play store and github.

That's the sole reason I'm not pushing the code which i am working on, otherwise some random dev will try to add AI slop or worse keep pinging to get the code working.

If you think this is too much then i don't know what to do. I barely got some time after office still i trying really hard to get to work on Mindful.

It really sad :(

@Clover-14
Copy link

Clover-14 commented Feb 8, 2026

Hey, it's my fault I got impatient since it was supposed to be released in Dec/Jan. I did not look at your situation. Sorry and no worries, take your time.

@akaMrNagar
Copy link
Owner Author

Sorry for the rude behaviour but patience is all i am asking for. We have already waited for it this long just a little more.

One thing i can promise will that the features will simply smash up all the similar apps..

I have some better plans too, maybe i start to work on it full time...

Let's hope for the best🤞

@Clover-14 Clover-14 mentioned this pull request Feb 9, 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.

5 participants