Skip to content
Commit 9de6e4e2 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Use descriptive exception for FGS start timeout

If the app doesn't call startForeground() in time, throw a new exception
ForegroundServiceDidNotStartInTimeException.

Test: Manual test with a test app:
04-01 15:24:39.438 10293  9078  9078 E AndroidRuntime: FATAL EXCEPTION: main
04-01 15:24:39.438 10293  9078  9078 E AndroidRuntime: Process: com.google.omakoto.testapp, PID: 9078
04-01 15:24:39.438 10293  9078  9078 E AndroidRuntime: android.app.ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{92c1599 u0 com.google.omakoto.testapp/.MyFgs}
04-01 15:24:39.438 10293  9078  9078 E AndroidRuntime: 	at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:1894)

Bug: 124137635
Change-Id: I7d97e15ba47a32a242fb461e7312adf3f28ab3a6
parent 53a24c73
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment