kill app甚至在某些设备中使用START_STICKY后服务无法再次启动

Pha*_*inh 5 service android

在我服务,我已经回到START_STICKY让我Service重新启动后,再次我杀的应用程序.
我有测试,它在设备正常工作Samsung,Sony,LGXiaomi它无法正常工作(服务不可重新开始)

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    return START_STICKY;
}
Run Code Online (Sandbox Code Playgroud)

我该如何处理这个案子.任何帮助或建议将非常感谢?
来自Android文档

/**
 * Constant to return from {@link #onStartCommand}: if this service's
 * process is killed while it is started (after returning from
 * {@link #onStartCommand}), then leave it in the started state but
 * don't retain this delivered intent.  Later the system will try to
 * re-create the service.  Because it is in the started state, it will
 * guarantee to call {@link #onStartCommand} after creating the new
 * service instance; if there are not any pending start commands to be
 * delivered to the service, it will be called with a null intent
 * object, so you must take care to check for this.
 * 
 * <p>This mode makes sense for things that will be explicitly started
 * and stopped to run for arbitrary periods of time, such as a service
 * performing background music playback.
 */
public static final int START_STICKY = 1;
Run Code Online (Sandbox Code Playgroud)

nay*_*asu 2

一些设备(例如小米和 Vivo)有一个名为“自动启动”的额外权限,允许您的应用程序服务在被终止后自动重新启动。我猜你可以在小米的附加权限中找到它。