Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

In Android 10 there apply new restrictions for apps. We can no longer start an activity from background. While this may be fine for the majority of apps, it's a killing blow for voip-apps that need to show an incoming call after a push notification arrived.

According to this https://developer.android.com/guide/components/activities/background-starts there is a list of conditions that can be met to still allow opening an activity, but tbh I do not understand that fully (non-english-native here).

What I definitely know, is:

  • I do not have any running activity, task, backstack and the like

  • The app is NOT EVEN RUNNING

What I need to achieve:

  • The FCM service of the app receives a push from our server and shall present the incoming call screen (over lock screen and all - just as it did with android 9 and below)

What can I do to open an activity for an incoming voip call in android 10? Over the lockscreen and all, just as a normal user would expect from a PHONE app.

Thanks in advance for any hints.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
404 views
Welcome To Ask or Share your Answers For Others

1 Answer

Use a high-priority notification with a "full-screen intent". That will:

  • Invoke your "full-screen intent" if the device is locked
  • Otherwise, display a "heads-up" notification

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...