首页 > 解决方案 > Android:Finsky 强制停止我的应用程序

问题描述

我有一个具有前台服务的 Android 应用程序。

该服务还会向抽屉发布Ongoing 通知,因为

前台服务必须显示通知。

它开始很粘:

public int onStartCommand(Intent intent, int flags, int startId) {
    ...
    return START_STICKY;
}

所以Android应该保持这个,因为

如果此服务的进程在启动时被终止,则将其保持在启动状态(...)。稍后系统将尝试重新创建服务。

然而,出于某种未知原因,Finsky有时会阻止这一点:

12-02 20:06:27.276 D/CCodecBuffers(23988): [c2.android.aac.decoder#777:1D-Input.Impl[N]] codec released a buffer owned by client (index 0)
12-02 20:06:27.393 I/Finsky  ( 4126): [2664] aliq.b(1): Attempting to stop application: net.MYAPP.android
12-02 20:06:27.396 I/ActivityManager( 1245): Force stopping net.MYAPP.android appid=10222 user=0: from pid 4126
12-02 20:06:27.397 I/ActivityManager( 1245): Killing 30598:net.MYAPP.android/u0a222 (adj 200): stop net.MYAPP.android
12-02 20:06:27.400 W/ActivityManager( 1245): Scheduling restart of crashed service net.MYAPP.android/.MYAPPService in 1000ms
12-02 20:06:27.403 I/ActivityManager( 1245):   Force stopping service ServiceRecord{ace11d1 u0 net.MYAPP.android/.MYAPPService}
12-02 20:06:27.406 I/EdgeLightingManager( 1245): isCallingUserSupported : callingUserId=0, mUserId=0, isDualAppId=false
12-02 20:06:27.406 I/EdgeLightingManager( 1245): hideForNotification : packageName = net.MYAPP.android
12-02 20:06:27.406 I/EdgeLightingPolicyManager:NotificationGroup( 1245): remove : sbn : StatusBarNotification(pkg=net.MYAPP.android user=UserHandle{0} id=1337 tag=null key=0|net.MYAPP.android|1337|null|10222: Notification(channel=MYAPP_SYSTEM_NOTIFICATION pri=0 contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x272 color=0x00000000 groupKey=MYAPP_SYSTEM_NOTIFICATION vis=PRIVATE semFlags=0x8 semPriority=0 semMissedCount=0))
12-02 20:06:27.406 I/EdgeLightingPolicyManager.NotificationGroup( 1245): group notification count : 1
12-02 20:06:27.406 I/EdgeLightingManager( 1245): hideForNotification : isInteractive is true
12-02 20:06:27.406 W/Finsky  ( 4126): [2664] alqs.a(41): Unwanted app (MUwS) without is_muws flag was returned with verdict POTENTIALLY_UNWANTED on autoscan: net.MYAPP.android
12-02 20:06:27.410 D/SamsungAlarmManager( 1245): Remove alarm for next reason : android.intent.action.PACKAGE_RESTARTED : package: net.MYAPP.android

我的应用程序没有上传到商店,它还处于开发阶段。

Finsky实际上是一个什么样的应用程序?

Finsky 似乎只是认为它是不需要的,因为它ActivityManager正在安排我崩溃的服务的重新启动。我的服务崩溃了,因为Finksy它试图停止应用程序,并因此而ActivityManager强制停止。

我相信应该找出根本原因,即:为什么 Finsky 试图首先阻止我的申请?

标签: android

解决方案


我遇到了同样的问题,即每天同时强制停止应用程序。在设备日志中(由 shell 检索到设备然后 logcat),有一个日志说“Finsky : [414] afha.j(1): Attempting to stop application' 我不得不去 Play Store -> Play Protect -> 使用 Play Protect 扫描应用程序并关闭此设置。这解决了问题,我的应用程序不再被强制停止。显然 Google Play 商店将我的应用程序视为不需要的应用程序并强制停止它。


推荐阅读