This commit is contained in:
2021-12-11 02:04:45 +01:00
parent 20acd563e7
commit 03c8a1ff60
11 changed files with 59 additions and 24 deletions

View File

@@ -1156,10 +1156,13 @@ public class Actions
{
Class c = Class.forName("android.os.PowerManager");
PowerManager mPowerManager = (PowerManager) this.getSystemService(Context.POWER_SERVICE);
for(Method m : c.getDeclaredMethods()){
if(m.getName().equals("goToSleep")){
for(Method m : c.getDeclaredMethods())
{
if(m.getName().equals("goToSleep"))
{
m.setAccessible(true);
if(m.getParameterTypes().length == 1){
if(m.getParameterTypes().length == 1)
{
m.invoke(mPowerManager,SystemClock.uptimeMillis()-2);
}
}