I am working in Android App that should prevent the user to use the mobile in some-cases . So I tried to lock the screen I used the PowerManger goToSleeo() Method but it needs DEVICE_POWER permission. which is allowed only for the System apps, but my app is not a system app what should I do ?
here is my code
PowerManager manager = (PowerManager) getSystemService(Context.POWER_SERVICE);
manager.goToSleep(600000);