Skip to content

Android 12: Performance - Notification trampoline restrictions #15875

@ParaskP7

Description

@ParaskP7

Parent #16062

Notification trampoline restrictions

TL;DR

As part of fixing new Lint warnings, due to upgrading to AGP 7.0.4, a new Notification Trampolines warning appeared for the PostUploadNotfier.java class (line 373).

Although this new Lint issue is a warning at the moment, it will become forbidden when the targetSdkVersion will be set to API level for Android 12 or higher.

Details

This intent launches a BroadcastReceiver (ShareAndDismissNotificationReceiver) which launches activities; this indirection is bad for performance, and activities should be launched directly from the notification. Activities should not be launched indirectly from a notification via an intermediate BroadcastReceiver or Service. This can lead to significant lags in some scenarios. To fix this, launch the Activity directly from the notification.

Assignment

I am assigning this to you @ashiagr so that you are aware of it and can plan it accordingly during the Android 12 upgrade. I did that since you are the DRI on min/compile/target SDK versions for this repo.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions