我调试的问题的的Syncthing Android的包装.Android应用程序包装Syncthing项目的原生二进制文件,并提供一些附加功能,如基于连接WiFi,电源等启动/停止.
不幸的是,有关服务不再自动启动WiFi更新的问题,特别是对于已经升级到Android 6的手机.由于我的个人手机最近升级到6.0.1,我终于可以调试到问题,今天我注意到以下几点:
07-06 20:52:26.562 1181 1363 I ActivityManager: [BgDetect]chkExcessCpu doKills: true uptime: 300309 07-06 20:52:26.960 1181 1363 I ActivityManager: [BgDetect]detect excessive cpu on forked process libsyncthing.so(pid : 2758) plan to stop it 371060 during 300309 07-06 20:52:26.960 1181 1363 I ActivityManager: [BgDetect]force stop com.nutomic.syncthingandroid.debug (uid 10132) 07-06 20:52:26.965 1181 1363 I ActivityManager: Force stopping com.nutomic.syncthingandroid.debug appid=10132 user=0: from pid 1181 07-06 20:52:26.966 1181 1363 I ActivityManager: Killing 1360:com.nutomic.syncthingandroid.debug/u0a132 (adj 15): stop com.nutomic.syncthingandroid.debug 07-06 20:52:26.968 1181 1363 W ActivityManager: Scheduling restart of crashed service com.nutomic.syncthingandroid.debug/com.nutomic.syncthingandroid.syncthing.SyncthingService in 1000ms 07-06 20:52:26.968 1181 1354 V ActivityManager: killProcessGroupAsync took 1 ms for PID 1360 on thread 14 07-06 20:52:26.971 1181 6410 I libprocessgroup: Killing pid 2758 in uid 10132 as part of process group 1360 07-06 20:52:26.973 1181 6410 I libprocessgroup: Killing pid 2758 in uid 10132 as part of process group 1360 07-06 20:52:26.974 1181 1363 I ActivityManager: Force stopping service ServiceRecord{47304c8 u0 com.nutomic.syncthingandroid.debug/com.nutomic.syncthingandroid.syncthing.SyncthingService}
在CPU方面,Syncthing协议非常繁重,涉及加密,散列等.因此,由于分叉本机二进制文件的高CPU需求,服务似乎被强制停止.
该应用程序已标记为"无电池优化",但它仍然被杀死.有没有办法防止ActivityManager
由于分叉进程的CPU需求而导致应用程序被杀?