[appium-android-driver] light up device before unlock with password on some device(xiaomi or meizu) is not working for using keyevent 4; I tried using command line, using keyevent 3 works fine on xiaomi & meizu, can we add adb.goToHome() to handle this situation? #10649
Labels
The problem
appium-android-driver has added unlocking device with password/pin/pattern etc.
adding unlockType and unlockKey in caps, on nexus and pixel it works fine, but on MeiZu & XiaoMi, it didn't light up the device at all
Environment
Details
I checkout the code in appium-android-driver/lib/unlock-helpers.js, method : helpers.passwordUnlock
while lighting up the device logic is in method: helpers.dismissKeyguard
in method: helpers.dismissKeyguard, use adb.back() to light up device(which is adb shell input keyevent 4), while it doesn't work on my Xiaomi and Meizu.
I thought we could change and use keyevent 26(26 --> "KEYCODE_POWER") to light up device, but find it not workable: if device is lighted, using 26 would dark screen
and I found using keyevent 3 would light up my xiaomi & Meizu, so I add adb.goToHome() and it works on Xiaomi & Meizu. can we do it this way? or it there a better way?
sincerely for your help, thanks so much!
The text was updated successfully, but these errors were encountered: