Skip to content
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

“定时同步”无法真正定时 #1297

Open
Iey4iej3 opened this issue Mar 17, 2024 · 3 comments
Open

“定时同步”无法真正定时 #1297

Iey4iej3 opened this issue Mar 17, 2024 · 3 comments

Comments

@Iey4iej3
Copy link

Describe the bug
设置了“定时同步”,但无法真正每天定时同步。

To Reproduce
Steps to reproduce the bug:

  1. 设置“定时同步”,例如把同步时间设置成 2:00。
  2. 第二天使用 Trime 输入。

Expected behavior
每天 2:00 同步。
现在情况:当第二天使用 Trime 时开始同步,然后进入设置发现同步时间变成了第二天使用 Trime 的时间。

Smartphone (please complete the following information):

  • Device: Xiaomi 11
  • OS: LineageOS 20
  • Theme: trime
  • Version: v3.2.16-0-g5738657b-release
  • Build info:
    You could find build info in About Activity and click it to copy.
    e.g. 
    Build: F-Droid
    Date: 2022-01-02 21:32:20
    Commit: v3.2.16-0-g5738657b
    Branch: release
    Repository: https://github.com/osfans/trime
    
@goofyz
Copy link
Collaborator

goofyz commented Mar 22, 2024

每個系統對「定時」的支援都不一樣。現在同文使用的是 AlarmManager.setExactAndAllowWhileIdle(),理論上是最「準時」但「耗電」的,但 OS 還是有機會殺掉這排程。
個人認為用 AndroidX Work Manager 來控制排程較為理想,但它不能設定特定時間去執行,需要先計算時間。而且,它還是有低概率被殺。

@Iey4iej3
Copy link
Author

我的猜测是目前的同步模式在 Doze 下会被 kill,下次用时才被唤醒,所以刚尝试 Trime 输入时就同步。一个很明显的问题是,设置的同步时间,在那时同步后会修改成那个时间,也就是说连设置里面的那个同步时间每天都会变。

@wxyzh
Copy link

wxyzh commented Mar 23, 2024

我这两天观察了下,com.osfans.trime.sync也不能正常工作

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants