bilde2910 / Hauk

Open-source realtime location sharing
Apache License 2.0
589 stars 59 forks source link

Broadcast receiver can't start AuthorizationActivity on Android 13 #194

Open Zimbelstern opened 1 year ago

Zimbelstern commented 1 year ago

Since at least Android 13 (probably since Q), the system prevents the start of activities from background. This means that the broadcast receiver can not start AuthorizationActivity and the user can not give permission to start sharing from a source.

ActivityTaskManager system_server I START u0 {flg=0x10000000 cmp=info.varden.hauk/.global.ui.AuthorizationActivity (has extras)} from uid 10191
ActivityTaskManager system_server W Background activity start [callingPackage: info.varden.hauk; callingUid: 10191; appSwitchState: 1; isCallingUidForeground: false; callingUidHasAnyVisibleWindow: false; callingUidProcState: RECEIVER; isCallingUidPersistentSystemProcess: false; realCallingUid: 10191; isRealCallingUidForeground: false; realCallingUidHasAnyVisibleWindow: false; realCallingUidProcState: RECEIVER; isRealCallingUidPersistentSystemProcess: false; originatingPendingIntent: null; allowBackgroundActivityStart: false; intent: Intent { flg=0x10000000 cmp=info.varden.hauk/.global.ui.AuthorizationActivity (has extras) }; callerApp: ProcessRecord{25a96c7 8548:info.varden.hauk/u0a191}; inVisibleTask: false]
ActivityTaskManager system_server E Abort background activity starts from 10191