Wake the current instance after device pause on iOS

This commit is contained in:
世界
2026-09-14 23:18:09 +08:00
parent c827ec8303
commit 54e5c497bb
+12 -1
View File
@@ -193,6 +193,9 @@ func (s *CommandServer) Start() error {
}
func (s *CommandServer) Close() {
if s.endPauseTimer != nil {
s.endPauseTimer.Stop()
}
if s.grpcServer != nil {
s.grpcServer.Stop()
}
@@ -264,13 +267,21 @@ func (s *CommandServer) Pause() {
instance.PauseManager().DevicePause()
if C.IsIos {
if s.endPauseTimer == nil {
s.endPauseTimer = time.AfterFunc(time.Minute, instance.PauseManager().DeviceWake)
s.endPauseTimer = time.AfterFunc(time.Minute, s.endDevicePause)
} else {
s.endPauseTimer.Reset(time.Minute)
}
}
}
func (s *CommandServer) endDevicePause() {
instance := s.StartedService.Instance()
if instance == nil || instance.PauseManager() == nil {
return
}
instance.PauseManager().DeviceWake()
}
func (s *CommandServer) Wake() {
recorder := s.powerManager.Recorder()
if recorder != nil {