Error Android 12+: Notifications don't open app | Indirect notification activity start (trampoline) from app.package.name blocked
See original GitHub issueBug report
CHECKLIST
- I have read the issue reporting guidelines
- I confirm this is a suspected bug or issue that will affect other users
- I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
- I have read the documentation thoroughly and it does not help solve my issue.
- I have checked that no similar issues (open or closed) already exist.
Current behavior:
Clicking on the notification does not open the app and the following error appears in the logcat
Indirect notification activity start (trampoline) from app.package.name blocked
Expected behavior:
Clicking on the notification should open the app
Steps to reproduce:
Try to open app with target SDK 31 or above from notification on Android 12 or above usin this example payload.
{
"data": {
"notification_body": "Notification with <b>Android</b> settings",
"notification_title": "Android Notification",
"notification_foreground": "true",
"notification_android_body_html": "true",
"notification_android_id": "a",
"notification_android_image": "https://user-images.githubusercontent.com/18549191/192135623-14f17f1e-4856-4fc7-a388-d5f380b48707.png",
"notification_android_image_type": "big_picture",
"notification_android_channel_id": "fcm_default_channel",
"key_1": "Data for key one"
}
}
Console output
console output
2022-09-22 15:39:19.084 561-561 Compatibil...geReporter pid-561 D Compat change id reported: 175319604; UID 1000; state: ENABLED
2022-09-22 15:39:19.085 561-1556 ActivityTaskManager pid-561 I START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x14000000 pkg=app.package.name cmp=app.package.name/.MainActivity (has extras)} from uid 10150
2022-09-22 15:39:19.085 864-1109 PeopleSpaceWidgetMgr pid-864 D Sbn doesn't contain valid PeopleTileKey: null/0/app.package.name
2022-09-22 15:39:19.088 561-1556 Compatibil...geReporter pid-561 D Compat change id reported: 167676448; UID 10150; state: ENABLED
2022-09-22 15:39:19.088 561-1556 NotificationService pid-561 E Indirect notification activity start (trampoline) from app.package.name blocked
2022-09-22 15:39:19.088 561-1556 ActivityTaskManager pid-561 W Background activity start [callingPackage: app.package.name; callingUid: 10150; appSwitchAllowed: true; isCallingUidForeground: false; callingUidHasAnyVisibleWindow: false; callingUidProcState: RECEIVER; isCallingUidPersistentSystemProcess: false; realCallingUid: 10150; isRealCallingUidForeground: false; realCallingUidHasAnyVisibleWindow: false; realCallingUidProcState: RECEIVER; isRealCallingUidPersistentSystemProcess: false; originatingPendingIntent: null; allowBackgroundActivityStart: false; intent: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x14000000 pkg=app.package.name cmp=app.package.name/.MainActivity (has extras) }; callerApp: ProcessRecord{dc52746 12283:app.package.name/u0a150}; inVisibleTask: false]
2022-09-22 15:39:19.095 1143-1601 EGL_emulation pid-1143 D app_time_stats: avg=82.47ms min=0.84ms max=1816.03ms count=28
2022-09-22 15:39:19.107 561-1556 ActivityTaskManager pid-561 E Abort background activity starts from 10150
2022-09-22 15:39:19.518 561-982 UserManagerService pid-561 V dumpPackageWhitelistProblems(): using mode ENFORCE|IMPLICIT_WHITELIST|IMPLICIT_WHITELIST_SYSTEM
2022-09-22 15:39:20.082 864-864 ActivityLaunchAnimator pid-864 D Remote animation timed out
2022-09-22 15:39:20.086 864-864 ShadeControllerImpl pid-864 V NotificationShadeWindow: com.android.systemui.statusbar.phone.NotificationShadeWindowView{3083eaf V.E...... ......ID 0,0-1080,2280} canPanelBeCollapsed(): true
2022-09-22 15:39:20.100 864-1103 EGL_emulation pid-864 D app_time_stats: avg=550.81ms min=14.89ms max=1086.72ms count=2
2022-09-22 15:39:20.101 864-1103 EGL_emulation pid-864 D app_time_stats: avg=204.37ms min=0.88ms max=2953.67ms count=17
Issue Analytics
- State:
- Created a year ago
- Comments:14 (3 by maintainers)
Top Results From Across the Web
Notification trampoline restrictions-Android12 | by Nav Singh
Starting with Android 12 notifications will not work if they do not start activities directly. What is a Notification trampoline? Some apps ......
Read more >Behavior changes: Apps targeting Android 12
Learn about changes in Android 12 that will affect apps when they target Android ... Indirect notification activity start (trampoline) from PACKAGE_NAME, ...
Read more >Android 12 - Notification trampoline restrictions - Stack Overflow
I'm using a transparent activity to handle this issue. all the notification related works are handled in the transparent activity.
Read more >Notification trampoline restrictions-Android12 - Droidcon
Starting with Android 12 notifications will not work if they do not start activities directly. What is a Notification trampoline? Some apps ......
Read more >Tapping notification does not launch the app on Android 12
10-06 10:18:22.977 1534 3091 E NotificationService: Indirect notification activity start (trampoline) from com.example.app blocked ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@dpa99c I think I get the reason of this bug (can’t open app).
He use data messaging with foreground key set to true. In this way, the broadcastReceiver is use to open the application. However, due to notification trempoline, it’s not working.
Kr
I’m not seeing this issue when testing with the example project. For example: build with API 32 and running on API 33 (screen capture)
Can you try building and running the example project and using its built-in FCM messaging client to send the test messages?