feat: 优化锁屏解锁

This commit is contained in:
余泓铮
2024-09-30 17:09:57 +08:00
parent 6125115625
commit dad3919a70
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
v5.0.0-beta-2409301134 v4.6.8
+2 -1
View File
@@ -22,6 +22,7 @@ type PowerStatus string
const ( const (
POWER_STATUS_SUSPEND PowerStatus = "POWER_STATUS_SUSPEND" POWER_STATUS_SUSPEND PowerStatus = "POWER_STATUS_SUSPEND"
POWER_STATUS_OFF PowerStatus = "POWER_STATUS_OFF"
POWER_STATUS_ON PowerStatus = "POWER_STATUS_ON" POWER_STATUS_ON PowerStatus = "POWER_STATUS_ON"
) )
@@ -107,7 +108,7 @@ func (hd *hdcDriver) Unlock() (err error) {
if len(match) <= 1 { if len(match) <= 1 {
return fmt.Errorf("failed to unlock; failed to find powerstatus") return fmt.Errorf("failed to unlock; failed to find powerstatus")
} }
if match[1] == string(POWER_STATUS_SUSPEND) { if match[1] == string(POWER_STATUS_SUSPEND) || match[1] == string(POWER_STATUS_OFF) {
err = hd.uiDriver.PressPowerKey() err = hd.uiDriver.PressPowerKey()
if err != nil { if err != nil {
return err return err