sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Use info from `ApplicationStartInfo` API on Android 15

Open yogurtearl opened this issue 1 year ago • 11 comments

Problem Statement

Would like to have info provided in ApplicationStartInfo API on Android 15 available thru Sentry.

see https://developer.android.com/about/versions/15/features#app-start-info

Solution Brainstorm

You can use this with if( SDK >= 35 ) and still get useful data about application start up metrics for device running Android 15+.

yogurtearl avatar Jun 25 '24 15:06 yogurtearl

Thanks @yogurtearl for the feature request - we discussed this (and other features based on new Android 15 APIs) and will likely implement this at some point.

kahest avatar Jun 26 '24 08:06 kahest

How do you use ApplicationStartInfo ? I can't see any docs for how to get an instance of it

AndroidDeveloperLB avatar Jun 30 '24 14:06 AndroidDeveloperLB

@AndroidDeveloperLB The ApplicationStartInfo can be received by registering a ActivityManager.addApplicationStartInfoCompletionListener hook, see the docs for more details.

markushi avatar Jul 01 '24 06:07 markushi

@markushi Thank you! I can see detection of the reason of starting the app, but I can't find which app started it (when it's relevant). Is it possible?

AndroidDeveloperLB avatar Jul 01 '24 06:07 AndroidDeveloperLB

@AndroidDeveloperLB I think what you're looking for is Activity.getReferrer(link). In which situations would this be useful for you?

markushi avatar Jul 01 '24 08:07 markushi

@markushi Seems you are correct, but do I need to add visibility to the apps? I wonder if a simple launchable filter will be fine:

<intent>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent>

I think for most cases it should suffice. Anyway, thank you!

AndroidDeveloperLB avatar Jul 01 '24 14:07 AndroidDeveloperLB

fwiw you can also retrieve it via getHistoricalProcessStartReasons, which would only return the app start infos for your app.

romtsn avatar Jul 02 '24 07:07 romtsn

We'll investigate this more closely wrt which APIs make sense to use and what additional data they can provide. We'll follow up here

kahest avatar Jul 10 '24 14:07 kahest

From @markushi

Let's add the ApplicationStartInfo as part of the App context. We also need to make the new attributes indexable, so we can filter and search for them.

romtsn avatar Feb 12 '25 16:02 romtsn

Seems the [DEPRECATED] Mobile SDKs is deprecated, are still things on the backlog? @romtsn

Angelodaniel avatar Sep 02 '25 13:09 Angelodaniel

@Angelodaniel yep, the project just moved, but things are still on the backlog

stefanosiano avatar Sep 04 '25 08:09 stefanosiano