Skip to content

Commit

Permalink
Add onStopped hook
Browse files Browse the repository at this point in the history
  • Loading branch information
bjester committed Jan 15, 2024
1 parent 087d7ff commit ed1d5e5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,11 @@ public Result doWork() {
final String arg = getArgument();
return workerImpl.execute(id, arg) ? Result.success() : Result.failure();
}

@Override
public void onStopped() {
Log.d(TAG, "Stopping foreground remote task " + getId());
super.onStopped();
hideNotification();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ public ListenableFuture<Result> startRemoteWork() {
return future;
}

@Override
public void onStopped() {
Log.d(TAG, "Stopping foreground remote task " + getId());
super.onStopped();
hideNotification();
}

public ForegroundInfo getForegroundInfo() {
NotificationRef ref = getNotificationRef();
// If we are running in the service, use the service notification ref
Expand Down

0 comments on commit ed1d5e5

Please sign in to comment.