Loading core/java/android/app/Service.java +2 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.ContextWrapper; import android.content.Intent; import android.content.pm.ServiceInfo.ForegroundServiceType; import android.content.res.Configuration; import android.os.Build; import android.os.IBinder; Loading Loading @@ -735,7 +736,7 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac * @see {@link android.content.pm.ServiceInfo} for the set of FOREGROUND_SERVICE_TYPE flags. */ public final void startForeground(int id, @NonNull Notification notification, int foregroundServiceType) { @ForegroundServiceType int foregroundServiceType) { try { mActivityManager.setServiceForeground( new ComponentName(this, mClassName), mToken, id, Loading core/java/android/content/pm/ServiceInfo.java +4 −3 Original line number Diff line number Diff line Loading @@ -151,6 +151,7 @@ public class ServiceInfo extends ComponentInfo * @hide */ @IntDef(flag = true, prefix = { "FOREGROUND_SERVICE_TYPE_" }, value = { FOREGROUND_SERVICE_TYPE_MANIFEST, FOREGROUND_SERVICE_TYPE_NONE, FOREGROUND_SERVICE_TYPE_DATA_SYNC, FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK, Loading Loading @@ -180,10 +181,10 @@ public class ServiceInfo extends ComponentInfo } /** * Return the current foreground service type. * @return the current foreground service type. * Return foreground service type specified in the manifest.. * @return foreground service type specified in the manifest. */ public int getForegroundServiceType() { public @ForegroundServiceType int getForegroundServiceType() { return mForegroundServiceType; } Loading Loading
core/java/android/app/Service.java +2 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.ContextWrapper; import android.content.Intent; import android.content.pm.ServiceInfo.ForegroundServiceType; import android.content.res.Configuration; import android.os.Build; import android.os.IBinder; Loading Loading @@ -735,7 +736,7 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac * @see {@link android.content.pm.ServiceInfo} for the set of FOREGROUND_SERVICE_TYPE flags. */ public final void startForeground(int id, @NonNull Notification notification, int foregroundServiceType) { @ForegroundServiceType int foregroundServiceType) { try { mActivityManager.setServiceForeground( new ComponentName(this, mClassName), mToken, id, Loading
core/java/android/content/pm/ServiceInfo.java +4 −3 Original line number Diff line number Diff line Loading @@ -151,6 +151,7 @@ public class ServiceInfo extends ComponentInfo * @hide */ @IntDef(flag = true, prefix = { "FOREGROUND_SERVICE_TYPE_" }, value = { FOREGROUND_SERVICE_TYPE_MANIFEST, FOREGROUND_SERVICE_TYPE_NONE, FOREGROUND_SERVICE_TYPE_DATA_SYNC, FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK, Loading Loading @@ -180,10 +181,10 @@ public class ServiceInfo extends ComponentInfo } /** * Return the current foreground service type. * @return the current foreground service type. * Return foreground service type specified in the manifest.. * @return foreground service type specified in the manifest. */ public int getForegroundServiceType() { public @ForegroundServiceType int getForegroundServiceType() { return mForegroundServiceType; } Loading