Overriding CPU Lock in Android
-
08-12-2019 - |
문제
I've been playing around with windowManager overrides of WakeLocks in android. I've got it to the point where I can power off the screen so that the video I'm running will "turn off". However, the CPU remains running and consequently so does the audio. I'd like to be able to put the device in sleep mode when I click the power button while the video is running. Is this possible? If so how?
해결책
I'm currently running a hack that tests the screen state at certain intervals and stops the video (hence the audio) and leaves the CPU running. I'd be happy if people have a better solution but this is part of the way there.
제휴하지 않습니다 StackOverflow