Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen lock not recognized properly during screen recording via "mobile: startMediaProjectionRecording" on emulator #859

Open
a-kachurin opened this issue Jan 22, 2025 · 0 comments

Comments

@a-kachurin
Copy link

a-kachurin commented Jan 22, 2025

When screen recording is started via the startMediaProjectionRecording command, the emulator incorrectly detects the screen lock state. This issue causes the isLocked method to return False even when the screen lock command has been executed and the screen is truly locked. Consequently, the unlock functionality does not behave as expected during automated tests while screen recording is active.

Below is a minimal code snippet to reproduce the problem:

appium 2.15.0
uiautomator2@3.9.9

driver.execute_script("mobile: startMediaProjectionRecording", {})
driver.execute_script("mobile: lock", {"seconds": 0})
time.sleep(1.0)
print(driver.execute_script('mobile: isLocked'))
driver.execute_script("mobile: unlock", {})
video_data = driver.execute_script("mobile: stopMediaProjectionRecording", {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant