JobIntentService:无法安排其他应用程序的作业 - 奥利奥

hac*_*ker 5 android intentservice android-backup-service android-8.1-oreo

我正在尝试安排JobIntentService另一个应用程序(2个不同的进程)的工作.

ComponentName componentName = new ComponentName(context.getPackageName(),
                   "com.anotherapp.service.MyJobIntentService");

JobIntentService.enqueueWork(this,componentName,100,new Intent());
Run Code Online (Sandbox Code Playgroud)

这给出了以下例外.

java.lang.IllegalArgumentException:uid 10000无法将作业调度到"com.anotherapp.service"

问题是,我们是否能够与JobIntentService我们的应用程序之外进行通信?

注意:在应用程序中,可以安排作业.

小智 0

我可能是错的,但我相信为了让应用程序(自动)调用其他应用程序,您在执行所述应用程序时必须具有 root 权限。

因为这是一种相当可疑的行为,甚至您的防病毒软件也可能会抑制其执行(如果您在真实手机上运行),我相信在模拟手机的情况下,这不应该成为问题。