HanteIsHante / file

file note
4 stars 0 forks source link

Android 8.0 启动Service 时发生异常 #39

Open HanteIsHante opened 6 years ago

HanteIsHante commented 6 years ago
Caused by java.lang.IllegalStateException: Not allowed to start service Intent { act=start cmp=PKGN/com.github.dawndiy.proxy.ProxyService }: app is in background uid UidRecord{3551e9b u0a465 SVC  idle procs:2 seq(0,0,0)}
       at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1505)
       at android.app.ContextImpl.startService(ContextImpl.java:1461)
       at android.content.ContextWrapper.startService(ContextWrapper.java:644)
       at world.letsgo.booster.android.service.VpnConnectionService.bindVpnService(VpnConnectionService.java:294)
       at world.letsgo.booster.android.service.VpnConnectionService.onBind(VpnConnectionService.java:178)
       at android.app.ActivityThread.handleBindService(ActivityThread.java:3436)
       at android.app.ActivityThread.-wrap2(Unknown Source)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1693)
HanteIsHante commented 6 years ago

Android O对应用在后台运行时可以执行的操作施加了限制,称为后台执行限制(Background Execution Limits),这可以大大减少应用的内存使用和耗电量,提高用户体验。后台执行限制分为两个部分:后台服务限制(Background Service Limitations)、广播限制(BroadcastLimitations)。

HanteIsHante commented 6 years ago

参考 URL

HanteIsHante commented 6 years ago

Google Android 8.0 后台限制

HanteIsHante commented 6 years ago

参考解决方案