mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-20 19:45:00 +00:00
Send wakeup keycode alongside trying to turn screen on when restoring
This commit is contained in:
parent
479d10dc22
commit
fcf5110df8
1 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
package com.genymobile.scrcpy;
|
||||
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import com.genymobile.scrcpy.wrappers.ContentProvider;
|
||||
import com.genymobile.scrcpy.wrappers.ServiceManager;
|
||||
|
||||
|
@ -78,7 +80,11 @@ public final class CleanUp {
|
|||
|
||||
if (restoreNormalPowerMode) {
|
||||
Ln.i("Restoring normal power mode");
|
||||
Device.setScreenPowerMode(Device.POWER_MODE_NORMAL);
|
||||
Device device = new Device(new Options());
|
||||
device.injectKeycode(KeyEvent.KEYCODE_WAKEUP);
|
||||
if(device.isScreenOn()){
|
||||
Device.setScreenPowerMode(Device.POWER_MODE_NORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue