How to implement it in Android Studio(API LEVEL >= 17) in my App(System-App + rooted device)?
I know it is possible because my phone(Lenovo A516) and some others have this feature --->>>Screenshot<<<---
..need some ideas to start with.. Can i use AlarmClock for this?
Here is a solution(tested on Lenovo A516, API LEVEL 17, but it should work similar for other devices with "Scheduled power On/Off feature" like described here):
Uninstall /system/app/SchedulePowerOnOff.apk
Compile and install this code
enableAlertPowerOn(...) is the function where the magic happens:
SchPwrOnReceiver.java:
build.gradle(:app), applicationId has to be "com.mediatek.schpwronoff":
AndroidManifest.xml:
Example how to call enableAlertPowerOn(Context context, long atTimeInMillis) from Activity: