Skip to content

Fix case for UncaughtExceptionHandler in SdlBroadcastReceiver for RemoteServiceException#1849

Merged
joeygrover merged 1 commit intodevelopfrom
bugfix/issue_1848_foreground_exception
Jun 20, 2023
Merged

Fix case for UncaughtExceptionHandler in SdlBroadcastReceiver for RemoteServiceException#1849
joeygrover merged 1 commit intodevelopfrom
bugfix/issue_1848_foreground_exception

Conversation

@JulianKast
Copy link
Contributor

@JulianKast JulianKast commented Jun 7, 2023

Fixes #1848

This PR is [ready] for review.

Risk

This PR makes [no] API changes.

Testing Plan

  • I have verified that I have not introduced new warnings in this PR (or explain why below)
  • I have run the unit tests with this PR
  • I have tested this PR against Core and verified behavior (if applicable, if not applicable, explain why below).
  • I have tested Android

Core Tests

Two apps, App A and App B.
App A is a normal SDL app.
App B is modified so that it will not enter the foreground when SdlService is started.

Install app A, connect to TDK
Install app B

Observe:
UncaughtExceptionHandler catches RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground():

The exception still hits and the app still crashes.

Tested using Sync 3

Summary

Fix UncaughtExceptionHandler in SdlBroadcastReceiver to catch RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground():

The handler does catch it, but only after the exception hits, the app still crashes and gets an ANR. It does not seem possible to prevent that with how Android is operating

Changelog

Bug Fixes
  • Fix UncaughtExceptionHandler in SdlBroadcastReceiver to catch RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground():

CLA

@joeygrover joeygrover merged commit b467c07 into develop Jun 20, 2023
@joeygrover joeygrover deleted the bugfix/issue_1848_foreground_exception branch June 20, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants