[GH-ISSUE #424] SyncPendingMessagesTask is an AsyncTask, but is not triggered from UI thread #302

Open
opened 2026-02-28 01:24:03 +03:00 by kerem · 1 comment
Owner

Originally created by @alxndrsn on GitHub (Apr 8, 2016).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/424

SyncPendingMessagesTask extends AsyncTask.

From Android documentation:

AsyncTask enables proper and easy use of the UI thread. This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers.
https://developer.android.com/reference/android/os/AsyncTask.html

The only user of SyncPendingMessagesTask is SyncPendingMessagesService.

As SyncPendingMessagesService is an instance of IntentService, which already uses a worker thread, it should be safe to execute the SyncPendingMessagesTask on the same thread that SyncPendingMessagesService is already running on.

Originally created by @alxndrsn on GitHub (Apr 8, 2016). Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/424 [`SyncPendingMessagesTask extends AsyncTask`](https://github.com/ushahidi/SMSSync/blob/a1f2224bbb4488a9772eb35a1d8648e0dc350a59/smssync/src/main/java/org/addhen/smssync/presentation/task/SyncPendingMessagesTask.java#L51). From Android documentation: > AsyncTask enables proper and easy use of the UI thread. This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers. > – _https://developer.android.com/reference/android/os/AsyncTask.html_ The only user of `SyncPendingMessagesTask` is `SyncPendingMessagesService`. As `SyncPendingMessagesService` is an instance of [`IntentService`](https://developer.android.com/reference/android/app/IntentService.html), which already uses a worker thread, it should be safe to execute the `SyncPendingMessagesTask` on the same thread that `SyncPendingMessagesService` is already running on.
Author
Owner

@eyedol commented on GitHub (Apr 29, 2016):

This should be addressed by PR #445

<!-- gh-comment-id:215671765 --> @eyedol commented on GitHub (Apr 29, 2016): This should be addressed by `PR` #445
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SMSSync#302
No description provided.