Merge "Fix javadoc on Context.startForegroundService" into sc-v2-dev am: ca3316df61 am: 61c9ccc55c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16095147

Change-Id: Ibcb57df3958a76b9f161e49f9cc39a49b0a9bce3
This commit is contained in:
Makoto Onuki
2021-10-21 15:40:08 +00:00
committed by Automerger Merge Worker

View File

@@ -3336,7 +3336,11 @@ public abstract class Context {
* Service will call {@link android.app.Service#startForeground(int, android.app.Notification)
* startForeground(int, android.app.Notification)} once it begins running. The service is given
* an amount of time comparable to the ANR interval to do this, otherwise the system
* will automatically stop the service and declare the app ANR.
* will automatically crash the process, in which case an internal exception
* {@code ForegroundServiceDidNotStartInTimeException} is logged on logcat on devices
* running SDK Version {@link android.os.Build.VERSION_CODES#S} or later. On older Android
* versions, an internal exception {@code RemoteServiceException} is logged instead, with
* a corresponding message.
*
* <p>Unlike the ordinary {@link #startService(Intent)}, this method can be used
* at any time, regardless of whether the app hosting the service is in a foreground