Android Question Screen time out


Out of frustration to remedy my phone addiction i want to use an app that limits my phone use. However, i can not find a good one. My old Huawei had such a feature baked in the android operating system. One that worked perfectly.

In the huawei app you could enter the hour of screen on time per day, for example 2 hours. Then you can select apps that will be blocked and apps that still can be used if the phone was blocked such as calling or using an agenda app or timer.

Since i can not find a good one i want to make a simple one. The app must:
* read the screen on time from the phone. On every android this can be found in the settings menu (battery)
* block the screen off all apps when screen on time is more than X time (not menu) and only allow the calling app.
* lock the settings with a password so that your friend can unlock the phone if needed in emergency.
* and as a bonus select other apps that are always allowed.

It would be fantastic if the first 3 can be done in a simple way. So does someone have an idea how to do the first 3 (and maybe the fourth)?

Best regards,