diff --git a/core/java/android/app/Service.java b/core/java/android/app/Service.java index 7167d4f17a6df..754e3b628f792 100644 --- a/core/java/android/app/Service.java +++ b/core/java/android/app/Service.java @@ -1106,4 +1106,16 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac return sStartForegroundServiceStackTraces.get(className); } } + + /** + * Callback called on timeout for {@link ServiceInfo#FOREGROUND_SERVICE_TYPE_SHORT_SERVICE}. + * + * TODO Implement it + * TODO Javadoc + * + * @param startId + * @hide + */ + public void onTimeout(int startId) { + } } diff --git a/core/java/android/content/pm/ServiceInfo.java b/core/java/android/content/pm/ServiceInfo.java index ab20b6f7f9ccb..14f03eae8bf15 100644 --- a/core/java/android/content/pm/ServiceInfo.java +++ b/core/java/android/content/pm/ServiceInfo.java @@ -363,6 +363,28 @@ public class ServiceInfo extends ComponentInfo ) public static final int FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED = 1 << 10; + /** + * Foreground service type corresponding to {@code shortService} in + * the {@link android.R.attr#foregroundServiceType} attribute. + * + * TODO Implement it + * + * TODO Expand the javadoc + * + * This type is not associated with specific use cases unlike other types, but this has + * unique restrictions. + *