Skip to content

Commit 32e1c12

Browse files
committed
Add a NamedThreadFactory to WithinAppServiceConnection's service connection Executor.
- Add back the NamedThreadFactory used by scheduledExecutorService that was removed by 6383f6d
1 parent 5db7bfb commit 32e1c12

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

firebase-messaging/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Unreleased
2-
2+
* [changed] Added a NamedThreadFactory to WithinAppServiceConnection's service
3+
connection Executor.
34

45
# 24.1.1
56
* [changed] Bug fix in SyncTask to always unregister the receiver on the same

firebase-messaging/src/main/java/com/google/firebase/messaging/WithinAppServiceConnection.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import androidx.annotation.Nullable;
2828
import androidx.annotation.VisibleForTesting;
2929
import com.google.android.gms.common.stats.ConnectionTracker;
30+
import com.google.android.gms.common.util.concurrent.NamedThreadFactory;
3031
import com.google.android.gms.tasks.Task;
3132
import com.google.android.gms.tasks.TaskCompletionSource;
3233
import com.google.errorprone.annotations.CanIgnoreReturnValue;
@@ -109,7 +110,9 @@ void finish() {
109110

110111
@SuppressLint("ThreadPoolCreation")
111112
private static ScheduledThreadPoolExecutor createScheduledThreadPoolExecutor() {
112-
ScheduledThreadPoolExecutor threadPoolExecutor = new ScheduledThreadPoolExecutor(1);
113+
ScheduledThreadPoolExecutor threadPoolExecutor =
114+
new ScheduledThreadPoolExecutor(
115+
1, new NamedThreadFactory("Firebase-FirebaseInstanceIdServiceConnection"));
113116
threadPoolExecutor.setKeepAliveTime(EnhancedIntentService.MESSAGE_TIMEOUT_S * 2, SECONDS);
114117
threadPoolExecutor.allowCoreThreadTimeOut(true);
115118
return threadPoolExecutor;

0 commit comments

Comments
 (0)