@Implements(value=android.app.Service.class) public class ShadowService extends ShadowContextWrapper
Constructor and Description |
---|
ShadowService() |
Modifier and Type | Method and Description |
---|---|
Notification |
getLastForegroundNotification() |
int |
getLastForegroundNotificationId() |
boolean |
getNotificationShouldRemoved() |
int |
getStopSelfId()
Returns id passed to
stopSelf(int) method. |
int |
getStopSelfResultId()
Returns id passed to
stopSelfResult(int) method. |
boolean |
isForegroundStopped() |
boolean |
isLastForegroundNotificationAttached()
Returns whether the last foreground notification is still “attached” to the service, meaning it will be removed when the service is destroyed.
|
boolean |
isStoppedBySelf() |
protected void |
onDestroy() |
protected void |
startForeground(int id,
Notification notification) |
protected void |
stopForeground(boolean removeNotification) |
protected void |
stopForeground(int flags) |
protected void |
stopSelf() |
protected void |
stopSelf(int id) |
protected boolean |
stopSelfResult(int id) |
clearNextStartedActivities, clearStartedServices, denyPermissions, denyPermissions, getBroadcastIntents, getNextStartedActivity, getNextStartedActivityForResult, getNextStartedService, getNextStoppedService, grantPermissions, grantPermissions, peekNextStartedActivity, peekNextStartedActivityForResult, peekNextStartedService, removeSystemService
@Implementation protected void onDestroy()
@Implementation protected void stopSelf()
@Implementation protected void stopSelf(int id)
@Implementation protected boolean stopSelfResult(int id)
@Implementation protected final void startForeground(int id, Notification notification)
protected void stopForeground(boolean removeNotification)
@Implementation(minSdk=24) protected void stopForeground(int flags)
public int getLastForegroundNotificationId()
public Notification getLastForegroundNotification()
public boolean isLastForegroundNotificationAttached()
Returns whether the last foreground notification is still “attached” to the service, meaning it will be removed when the service is destroyed.
public boolean isStoppedBySelf()
public boolean isForegroundStopped()
public boolean getNotificationShouldRemoved()
public int getStopSelfId()
Returns id passed to stopSelf(int)
method. Make sure to check result of isStoppedBySelf()
first.
public int getStopSelfResultId()
Returns id passed to stopSelfResult(int)
method. Make sure to check result of isStoppedBySelf()
first.