-
Notifications
You must be signed in to change notification settings - Fork 786
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
How to handle screenlock / power botton ? #864
Comments
Hi Sachin,
Try the keyevent 26 for power button
…On 08-Feb-2017 7:14 PM, "Sachin G" ***@***.***> wrote:
How to handle screen lock/ power botton ?
I have a test case that needs to lock screen and unlock screen, how i can
handle it using robotium.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#864>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEW59zZJkKwlh_czfjtu_Aw4chYLO8DPks5racbEgaJpZM4L61d1>
.
|
@vikramuk I tryed using keyevent but it not works. I am able to unlock using activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD); Window window = this.getWindow(); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD); Iam trying to use PARTIAL_WAKE_LOCK to lock but not getting it. |
Is there any way you can add permission for keeping screen awake?. Then
check keyevent for power button
Regards
…On 09-Feb-2017 12:11 AM, "Sachin G" ***@***.***> wrote:
@vikramuk <https://github.com/vikramuk> I tryed using keyevent but it not
works.
I am able to unlock using activity.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
Window window = this.getWindow();
window.addFlags(LayoutParams.FLAG_DISMISS_KEYGUARD);
window.addFlags(LayoutParams.FLAG_SHOW_WHEN_LOCKED);
window.addFlags(LayoutParams.FLAG_TURN_SCREEN_ON);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
is there any other specific code to lock screen.
Iam trying to use PARTIAL_WAKE_LOCK
<https://developer.android.com/reference/android/os/PowerManager.html> to
lock but not getting it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#864 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEW590ROj2qEb4O8yYJlz2PgQ3BVj_2qks5ragxygaJpZM4L61d1>
.
|
How to handle screen lock/ power botton ?
I have a test case that needs to lock screen and unlock screen, how i can handle it using robotium.
The text was updated successfully, but these errors were encountered: