Loading core/jni/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,7 @@ LOCAL_SHARED_LIBRARIES := \ libusbhost \ libharfbuzz \ libz \ libsuspend \ ifeq ($(USE_OPENGL_RENDERER),true) LOCAL_SHARED_LIBRARIES += libhwui Loading core/jni/android_os_Power.cpp +9 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include <hardware/power.h> #include <hardware_legacy/power.h> #include <cutils/android_reboot.h> #include <suspend/autosuspend.h> static struct power_module *sPowerModule; Loading Loading @@ -70,8 +71,14 @@ setLastUserActivityTimeout(JNIEnv *env, jobject clazz, jlong timeMS) static int setScreenState(JNIEnv *env, jobject clazz, jboolean on) { if (sPowerModule) sPowerModule->setInteractive(sPowerModule, on); if (on) { autosuspend_disable(); sPowerModule->setInteractive(sPowerModule, true); } else { sPowerModule->setInteractive(sPowerModule, false); autosuspend_enable(); } return 0; } Loading Loading
core/jni/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,7 @@ LOCAL_SHARED_LIBRARIES := \ libusbhost \ libharfbuzz \ libz \ libsuspend \ ifeq ($(USE_OPENGL_RENDERER),true) LOCAL_SHARED_LIBRARIES += libhwui Loading
core/jni/android_os_Power.cpp +9 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include <hardware/power.h> #include <hardware_legacy/power.h> #include <cutils/android_reboot.h> #include <suspend/autosuspend.h> static struct power_module *sPowerModule; Loading Loading @@ -70,8 +71,14 @@ setLastUserActivityTimeout(JNIEnv *env, jobject clazz, jlong timeMS) static int setScreenState(JNIEnv *env, jobject clazz, jboolean on) { if (sPowerModule) sPowerModule->setInteractive(sPowerModule, on); if (on) { autosuspend_disable(); sPowerModule->setInteractive(sPowerModule, true); } else { sPowerModule->setInteractive(sPowerModule, false); autosuspend_enable(); } return 0; } Loading