Skip to content

Automatically unlock device screen when possible#2789

Merged
hevrard merged 1 commit into
google:masterfrom
hevrard:adb-unlock
Jun 3, 2019
Merged

Automatically unlock device screen when possible#2789
hevrard merged 1 commit into
google:masterfrom
hevrard:adb-unlock

Conversation

@hevrard

@hevrard hevrard commented May 30, 2019

Copy link
Copy Markdown
Contributor

This is a refactor of the device screen unlock logic, to simplify it down to two functions:

  • UnlockScreen() which tries to get the screen on and unlocked

  • IsScreenUnlocked() which returns true if the screen is on and unlocked

When the screen cannot be automatically unlocked, the new error message clearly tells the user to unlock the device screen.

Along the way, this removes the feature of putting back the screen off if it was off before tracing. I argue this was hardly desirable in any case.

Fixes #2747

@hevrard

hevrard commented May 30, 2019

Copy link
Copy Markdown
Contributor Author

Arguably fix #2747

Comment thread gapis/perfetto/android/trace.go Outdated
Comment thread gapii/client/adb.go Outdated
Comment thread core/os/android/adb/screen.go Outdated
This is a refactor of the device screen unlock logic, to simplify it
down to UnlockScreen() which tries to get the screen on and unlocked,
and reports whether it succeeded.

When the screen cannot be automatically unlocked, the new error
message clearly tells the user to unlock the device screen.

Along the way, this removes the feature of putting back the screen off
if it was off before tracing. I argue this was hardly desirable in any
case.
@hevrard hevrard merged commit 7020fd4 into google:master Jun 3, 2019
@hevrard hevrard deleted the adb-unlock branch June 3, 2019 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracing Failed Cause: Could not start trace Cause: Cannot trace app on locked device

3 participants