markusfisch / ScreenTime

Displays your screen time in a permanent notification.
The Unlicense
115 stars 11 forks source link

Permission not even asked #23

Open Inlife-raphael opened 1 year ago

Inlife-raphael commented 1 year ago

I use the OS /e/ version 1.13-s-20230724313396-stable-FP3 and there is no screen time app built-in.

I tried this app since it's the only FOSS one available but it does not work. I thought it was the OS but actually I just used proprietary garbage to be sure and the proprietary garbage sent me to the parameter app for a permission that made it work. This app isn't even on the list of apps that asked this permission ! ("Usage permission" something like that)

markusfisch commented 1 year ago

Hm, that's weird 🤔 Thanks for filing an issue! 👍

The app should ask for permission to post notifications at the first start.

What is "proprietary garbage"? And what permission did you have to grant manually to make it work?

Inlife-raphael commented 1 year ago

Thanks for your reply :+1:

Proprietary garbage is software which is not opensource

Actually the permission name is "usage access", in apps> special app access.

The proprietary app shows up in this menu but not ScreenTime does not appear at all.

Inlife-raphael commented 1 year ago

I researched about this parameters and I've seen multiple times that the permission PACKAGE_USAGE_STATS should be asked somewhere (or put in the list of permissions required something like that). But I searched it on the code of the repository, GitHub did not find anything.

markusfisch commented 1 year ago

Very strange! 🤔

PACKAGE_USAGE_STATS has a protection level of "signature|privileged|development|appop|retailDemo" what essentially means it's only available for system apps.

And Screen Time doesn't really need it, because it does not request any usage statistics. All it does is listening for ACTION_SCREEN_ON and ACTION_SCREEN_OFF broadcasts, basically (actually, it also listens to some other broadcasts but that shouldn't matter here).

So, frankly I have no idea what's going on 😬

7heMech commented 7 months ago

@markusfisch Usage permission is a very interesting feature which you should look into, I've encountered it only once on an app I downloaded from the playstore, but once I allowed that permission it let me see for how much time I've used different apps each day, (even in the past when I hadn't installed the app) so it's a permission which lets the app access some app tracking which is kept by the OS itself. Could be useful to let you see not only how much time you've used your phone, but what you were doing during that time.

The app didn't need to work in the background once it had that permission. (Meaning it could also save battery)

https://github.com/markusfisch/ScreenTime/assets/83923848/362d8d61-38ac-4187-a610-da7bf08287d8