diff options
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 6 | ||||
| -rw-r--r-- | core/java/android/app/Service.java | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index b25d5ebf61a0..f19a2b1306f4 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -1234,7 +1234,8 @@ public final class ActivityThread extends ClientTransactionHandler } @Override - public final void scheduleTimeoutServiceForType(IBinder token, int startId, int fgsType) { + public final void scheduleTimeoutServiceForType(IBinder token, int startId, + @ServiceInfo.ForegroundServiceType int fgsType) { if (Trace.isTagEnabled(Trace.TRACE_TAG_ACTIVITY_MANAGER)) { Trace.instant(Trace.TRACE_TAG_ACTIVITY_MANAGER, "scheduleTimeoutServiceForType. token=" + token); @@ -5159,7 +5160,8 @@ public final class ActivityThread extends ClientTransactionHandler } } - private void handleTimeoutServiceForType(IBinder token, int startId, int fgsType) { + private void handleTimeoutServiceForType(IBinder token, int startId, + @ServiceInfo.ForegroundServiceType int fgsType) { Service s = mServices.get(token); if (s != null) { try { diff --git a/core/java/android/app/Service.java b/core/java/android/app/Service.java index d4702998ce3e..fe8655c13562 100644 --- a/core/java/android/app/Service.java +++ b/core/java/android/app/Service.java @@ -1164,7 +1164,7 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac } /** @hide */ - public final void callOnTimeLimitExceeded(int startId, int fgsType) { + public final void callOnTimeLimitExceeded(int startId, @ForegroundServiceType int fgsType) { // Note, because all the service callbacks (and other similar callbacks, e.g. activity // callbacks) are delivered using the main handler, it's possible the service is already // stopped when before this method is called, so we do a double check here. @@ -1189,10 +1189,11 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac * Callback called when a particular foreground service type has timed out. * * @param startId the startId passed to {@link #onStartCommand(Intent, int, int)} when - * the service started. - * @param fgsType the foreground service type which caused the timeout. + * the service started. + * @param fgsType the {@link ServiceInfo.ForegroundServiceType foreground service type} which + * caused the timeout. */ @FlaggedApi(Flags.FLAG_INTRODUCE_NEW_SERVICE_ONTIMEOUT_CALLBACK) - public void onTimeout(int startId, int fgsType) { + public void onTimeout(int startId, @ForegroundServiceType int fgsType) { } } |