diff --git a/core/java/android/content/pm/ServiceInfo.java b/core/java/android/content/pm/ServiceInfo.java index f3ad9d1488ff0..69e5ea2f59d47 100644 --- a/core/java/android/content/pm/ServiceInfo.java +++ b/core/java/android/content/pm/ServiceInfo.java @@ -376,8 +376,8 @@ public class ServiceInfo extends ComponentInfo *
  • Headless system apps
  • *
  • Device admin apps
  • *
  • Active VPN apps
  • - *
  • Apps holding {@link Manifest.permission#SCHEDULE_EXACT_ALARM} or - * {@link Manifest.permission#USE_EXACT_ALARM} permission.
  • + *
  • Apps holding {@link android.Manifest.permission#SCHEDULE_EXACT_ALARM} or + * {@link android.Manifest.permission#USE_EXACT_ALARM} permission.
  • * *

    */ @@ -393,7 +393,7 @@ public class ServiceInfo extends ComponentInfo * *

    Unlike other foreground service types, this type is not associated with a specific use * case, and it will not require any special permissions - * (besides {@link Manifest.permission#FOREGROUND_SERVICE}). + * (besides {@link android.Manifest.permission#FOREGROUND_SERVICE}). * * However, this type has the following restrictions. * @@ -401,19 +401,21 @@ public class ServiceInfo extends ComponentInfo *

  • * The type has a 3 minute timeout. * A foreground service of this type must be stopped within the timeout by - * {@link android.app.Service#stopSelf), - * or {@link android.content.Context#stopService). - * {@link android.app.Service#stopForeground) will also work, which will demote the + * {@link android.app.Service#stopSelf()}, + * {@link android.content.Context#stopService(android.content.Intent)} + * or their overloads). + * {@link android.app.Service#stopForeground(int)} will also work, + * which will demote the * service to a "background" service, which will soon be stopped by the system. * - *

    The system will not automatically stop it. - * *

    If the service isn't stopped within the timeout, - * {@link android.app.Service#onTimeout(int)} will be called. + * {@link android.app.Service#onTimeout(int)} will be called. Note, even when the + * system calls this callback, it will not stop the service automatically. + * You still need to stop the service using one of the aforementioned + * ways even when you get this callback. * *

    If the service is still not stopped after the callback, - * the app will be declared an ANR after a short grace period of several seconds. - * + * the app will be declared an ANR, after a short grace period of several seconds. *

  • * A foreground service of this type cannot be made "sticky" * (see {@link android.app.Service#START_STICKY}). That is, if an app is killed @@ -427,10 +429,26 @@ public class ServiceInfo extends ComponentInfo *