Android 在睡眠中从后台启动的活动不会出现

Android 在睡眠中从后台启动的活动不会出现,android,android-activity,android-service,android-wake-lock,Android,Android Activity,Android Service,Android Wake Lock,在我的sipApp中,我有一个服务在后台运行,等待来电。 在IncomingCall中,我尝试启动一个显示通话的活动: Intent intent = new Intent(this, InCallActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Int

在我的sipApp中,我有一个服务在后台运行,等待来电。 在IncomingCall中,我尝试启动一个显示通话的活动:

    Intent intent = new Intent(this, InCallActivity.class);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP |
        Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_FROM_BACKGROUND);
    startActivity(intent);
这在大多数情况下都很有效。InCallActivity出现并打开屏幕并启动wakelock

但在某些情况下,当设备处于深度睡眠状态且来电时,服务会被正确触发。日志告诉我们它正在建立意图并启动它,但它最终启动了默认的HomeActivity,屏幕保持黑色,而不是显示InCallActivity。 几秒钟后,所有的活动似乎都被清理干净了,但从未出现过

10:41:06.809  9711  9741 D CallClient: onCallControllerChanged: CS_INCOMING listener: 1
10:41:06.989  9711  9741 I Timeline: Timeline: Activity_launch_request id:com.company.product.brand time:8047180
10:41:06.989   830  1228 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x34000004 cmp=com.company.product.brand/com.company.product.call.InCallActivity_ (has extras)} from uid 12231 on display 0
10:41:07.039   830   830 V ActivityManager: Display changed displayId=0
10:41:07.149  9711  9711 D MyVoip: ! onActivityStarted: com.company.product.home.HomeActivity_@14ddfbae
10:41:07.149  9711  9711 D HomeActivity: onResume
10:41:07.149  9711  9711 D MyVoip: ! onActivityResumed: com.company.product.home.HomeActivity_@14ddfbae
[...]
10:41:18.715   830   968 W ActivityManager: Activity pause timeout for ActivityRecord{1ba876d u0 com.company.product.brand/com.company.product.call.InCallActivity_ t3206}
所以InCallActivity甚至没有被创建,所以即使是那一行:

07:39:49.648 D/MyVoip(17451): ! onActivityCreated: com.company.product.call.InCallActivity_@cffb29b
在那个案子里他失踪了

有什么想法吗