From 99a9d9358502f88f464484c30539f836aa56e05b Mon Sep 17 00:00:00 2001 From: Matthew Robertson Date: Thu, 1 Aug 2024 13:20:19 -0400 Subject: [PATCH] Move CrashlyticsWorker to concurrency package (#6148) --- .../common/CrashlyticsControllerTest.java | 2 +- .../CrashlyticsCoreInitializationTest.java | 2 +- .../internal/common/CrashlyticsCoreTest.java | 2 +- .../SessionReportingCoordinatorTest.java | 2 +- .../CrashlyticsWorkerTest.java | 2 +- .../internal/metadata/MetaDataStoreTest.java | 2 +- .../DefaultSettingsControllerTest.java | 2 +- .../crashlytics/FirebaseCrashlytics.java | 2 +- .../internal/common/CrashlyticsController.java | 2 +- .../internal/common/CrashlyticsCore.java | 2 +- .../common/SessionReportingCoordinator.java | 2 +- .../{ => concurrency}/CrashlyticsWorker.java | 2 +- .../internal/concurrency/package-info.java | 18 ++++++++++++++++++ .../internal/metadata/UserMetadata.java | 2 +- .../internal/settings/SettingsController.java | 2 +- .../CrashlyticsControllerRobolectricTest.java | 2 +- ...ionReportingCoordinatorRobolectricTest.java | 2 +- 17 files changed, 34 insertions(+), 16 deletions(-) rename firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/{ => concurrency}/CrashlyticsWorkerTest.java (99%) rename firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/{ => concurrency}/CrashlyticsWorker.java (99%) create mode 100644 firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/concurrency/package-info.java diff --git a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/CrashlyticsControllerTest.java b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/CrashlyticsControllerTest.java index 1a63cd07b81..c38dae62c55 100644 --- a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/CrashlyticsControllerTest.java +++ b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/CrashlyticsControllerTest.java @@ -37,10 +37,10 @@ import com.google.firebase.concurrent.TestOnlyExecutors; import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent; import com.google.firebase.crashlytics.internal.CrashlyticsTestCase; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.DevelopmentPlatformProvider; import com.google.firebase.crashlytics.internal.NativeSessionFileProvider; import com.google.firebase.crashlytics.internal.analytics.AnalyticsEventLogger; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.metadata.LogFileManager; import com.google.firebase.crashlytics.internal.metadata.UserMetadata; import com.google.firebase.crashlytics.internal.model.CrashlyticsReport; diff --git a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCoreInitializationTest.java b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCoreInitializationTest.java index e73bad6ba20..efed21540cd 100644 --- a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCoreInitializationTest.java +++ b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCoreInitializationTest.java @@ -31,11 +31,11 @@ import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent; import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponentDeferredProxy; import com.google.firebase.crashlytics.internal.CrashlyticsTestCase; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.DevelopmentPlatformProvider; import com.google.firebase.crashlytics.internal.RemoteConfigDeferredProxy; import com.google.firebase.crashlytics.internal.analytics.UnavailableAnalyticsEventLogger; import com.google.firebase.crashlytics.internal.breadcrumbs.DisabledBreadcrumbSource; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.persistence.FileStore; import com.google.firebase.crashlytics.internal.settings.Settings; import com.google.firebase.crashlytics.internal.settings.SettingsController; diff --git a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCoreTest.java b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCoreTest.java index 3afc587b2fc..3922237df4c 100644 --- a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCoreTest.java +++ b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCoreTest.java @@ -33,13 +33,13 @@ import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent; import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponentDeferredProxy; import com.google.firebase.crashlytics.internal.CrashlyticsTestCase; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.DevelopmentPlatformProvider; import com.google.firebase.crashlytics.internal.RemoteConfigDeferredProxy; import com.google.firebase.crashlytics.internal.analytics.UnavailableAnalyticsEventLogger; import com.google.firebase.crashlytics.internal.breadcrumbs.BreadcrumbHandler; import com.google.firebase.crashlytics.internal.breadcrumbs.BreadcrumbSource; import com.google.firebase.crashlytics.internal.breadcrumbs.DisabledBreadcrumbSource; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.metadata.UserMetadata; import com.google.firebase.crashlytics.internal.persistence.FileStore; import com.google.firebase.crashlytics.internal.settings.Settings; diff --git a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/SessionReportingCoordinatorTest.java b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/SessionReportingCoordinatorTest.java index 8d74d6fe249..e9f5bac9efc 100644 --- a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/SessionReportingCoordinatorTest.java +++ b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/SessionReportingCoordinatorTest.java @@ -34,7 +34,7 @@ import com.google.android.gms.tasks.Task; import com.google.android.gms.tasks.Tasks; import com.google.firebase.concurrent.TestOnlyExecutors; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.metadata.LogFileManager; import com.google.firebase.crashlytics.internal.metadata.UserMetadata; import com.google.firebase.crashlytics.internal.model.CrashlyticsReport; diff --git a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/CrashlyticsWorkerTest.java b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/concurrency/CrashlyticsWorkerTest.java similarity index 99% rename from firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/CrashlyticsWorkerTest.java rename to firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/concurrency/CrashlyticsWorkerTest.java index 1f102d57f26..fdc96b0d7a1 100644 --- a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/CrashlyticsWorkerTest.java +++ b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/concurrency/CrashlyticsWorkerTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.firebase.crashlytics.internal; +package com.google.firebase.crashlytics.internal.concurrency; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; diff --git a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/metadata/MetaDataStoreTest.java b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/metadata/MetaDataStoreTest.java index 122134b8602..b8a0d655969 100644 --- a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/metadata/MetaDataStoreTest.java +++ b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/metadata/MetaDataStoreTest.java @@ -18,7 +18,7 @@ import com.google.firebase.concurrent.TestOnlyExecutors; import com.google.firebase.crashlytics.internal.CrashlyticsTestCase; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.persistence.FileStore; import java.io.File; import java.io.IOException; diff --git a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/settings/DefaultSettingsControllerTest.java b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/settings/DefaultSettingsControllerTest.java index 696e61576c2..8331ef90cb8 100644 --- a/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/settings/DefaultSettingsControllerTest.java +++ b/firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/settings/DefaultSettingsControllerTest.java @@ -27,12 +27,12 @@ import com.google.android.gms.tasks.Tasks; import com.google.firebase.concurrent.TestOnlyExecutors; import com.google.firebase.crashlytics.internal.CrashlyticsTestCase; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.common.CurrentTimeProvider; import com.google.firebase.crashlytics.internal.common.DataCollectionArbiter; import com.google.firebase.crashlytics.internal.common.DeliveryMechanism; import com.google.firebase.crashlytics.internal.common.InstallIdProvider; import com.google.firebase.crashlytics.internal.common.InstallIdProvider.InstallIds; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/FirebaseCrashlytics.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/FirebaseCrashlytics.java index 590483069c4..d5efecceb9f 100644 --- a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/FirebaseCrashlytics.java +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/FirebaseCrashlytics.java @@ -24,7 +24,6 @@ import com.google.firebase.analytics.connector.AnalyticsConnector; import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent; import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponentDeferredProxy; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.DevelopmentPlatformProvider; import com.google.firebase.crashlytics.internal.Logger; import com.google.firebase.crashlytics.internal.RemoteConfigDeferredProxy; @@ -35,6 +34,7 @@ import com.google.firebase.crashlytics.internal.common.CrashlyticsCore; import com.google.firebase.crashlytics.internal.common.DataCollectionArbiter; import com.google.firebase.crashlytics.internal.common.IdManager; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.network.HttpRequestFactory; import com.google.firebase.crashlytics.internal.persistence.FileStore; import com.google.firebase.crashlytics.internal.settings.SettingsController; diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsController.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsController.java index be82db7efde..45b1d914632 100644 --- a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsController.java +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsController.java @@ -31,10 +31,10 @@ import com.google.android.gms.tasks.Tasks; import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent; import com.google.firebase.crashlytics.internal.CrashlyticsPreconditions; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.Logger; import com.google.firebase.crashlytics.internal.NativeSessionFileProvider; import com.google.firebase.crashlytics.internal.analytics.AnalyticsEventLogger; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.metadata.LogFileManager; import com.google.firebase.crashlytics.internal.metadata.UserMetadata; import com.google.firebase.crashlytics.internal.model.CrashlyticsReport; diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCore.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCore.java index 1157530f064..16ef34b4f74 100644 --- a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCore.java +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCore.java @@ -27,11 +27,11 @@ import com.google.firebase.crashlytics.BuildConfig; import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent; import com.google.firebase.crashlytics.internal.CrashlyticsPreconditions; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.Logger; import com.google.firebase.crashlytics.internal.RemoteConfigDeferredProxy; import com.google.firebase.crashlytics.internal.analytics.AnalyticsEventLogger; import com.google.firebase.crashlytics.internal.breadcrumbs.BreadcrumbSource; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.metadata.LogFileManager; import com.google.firebase.crashlytics.internal.metadata.UserMetadata; import com.google.firebase.crashlytics.internal.persistence.FileStore; diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/SessionReportingCoordinator.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/SessionReportingCoordinator.java index be56b950c16..27a493c984f 100644 --- a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/SessionReportingCoordinator.java +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/SessionReportingCoordinator.java @@ -23,8 +23,8 @@ import androidx.annotation.VisibleForTesting; import com.google.android.gms.tasks.Task; import com.google.android.gms.tasks.Tasks; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.Logger; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.metadata.LogFileManager; import com.google.firebase.crashlytics.internal.metadata.UserMetadata; import com.google.firebase.crashlytics.internal.model.CrashlyticsReport; diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/CrashlyticsWorker.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/concurrency/CrashlyticsWorker.java similarity index 99% rename from firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/CrashlyticsWorker.java rename to firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/concurrency/CrashlyticsWorker.java index 7714bd92adb..7f17d85de9c 100644 --- a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/CrashlyticsWorker.java +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/concurrency/CrashlyticsWorker.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.firebase.crashlytics.internal; +package com.google.firebase.crashlytics.internal.concurrency; import androidx.annotation.VisibleForTesting; import com.google.android.gms.tasks.CancellationTokenSource; diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/concurrency/package-info.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/concurrency/package-info.java new file mode 100644 index 00000000000..bde486ae521 --- /dev/null +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/concurrency/package-info.java @@ -0,0 +1,18 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** @hide */ +package com.google.firebase.crashlytics.internal.concurrency; diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/UserMetadata.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/UserMetadata.java index c63b2ea2c23..50760aab38b 100644 --- a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/UserMetadata.java +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata/UserMetadata.java @@ -17,8 +17,8 @@ import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import com.google.errorprone.annotations.CanIgnoreReturnValue; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.common.CommonUtils; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.model.CrashlyticsReport; import com.google.firebase.crashlytics.internal.persistence.FileStore; import java.util.List; diff --git a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/settings/SettingsController.java b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/settings/SettingsController.java index e86f6e4d55e..7c8c715ca31 100644 --- a/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/settings/SettingsController.java +++ b/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/settings/SettingsController.java @@ -23,7 +23,6 @@ import com.google.android.gms.tasks.Task; import com.google.android.gms.tasks.TaskCompletionSource; import com.google.android.gms.tasks.Tasks; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.Logger; import com.google.firebase.crashlytics.internal.common.CommonUtils; import com.google.firebase.crashlytics.internal.common.CurrentTimeProvider; @@ -31,6 +30,7 @@ import com.google.firebase.crashlytics.internal.common.DeliveryMechanism; import com.google.firebase.crashlytics.internal.common.IdManager; import com.google.firebase.crashlytics.internal.common.SystemCurrentTimeProvider; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.network.HttpRequestFactory; import com.google.firebase.crashlytics.internal.persistence.FileStore; import java.util.Locale; diff --git a/firebase-crashlytics/src/test/java/com/google/firebase/crashlytics/internal/common/CrashlyticsControllerRobolectricTest.java b/firebase-crashlytics/src/test/java/com/google/firebase/crashlytics/internal/common/CrashlyticsControllerRobolectricTest.java index 0f8172aded1..f6541502e8a 100644 --- a/firebase-crashlytics/src/test/java/com/google/firebase/crashlytics/internal/common/CrashlyticsControllerRobolectricTest.java +++ b/firebase-crashlytics/src/test/java/com/google/firebase/crashlytics/internal/common/CrashlyticsControllerRobolectricTest.java @@ -31,9 +31,9 @@ import com.google.firebase.concurrent.TestOnlyExecutors; import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent; import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponentDeferredProxy; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.DevelopmentPlatformProvider; import com.google.firebase.crashlytics.internal.analytics.AnalyticsEventLogger; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.metadata.LogFileManager; import com.google.firebase.crashlytics.internal.metadata.UserMetadata; import com.google.firebase.crashlytics.internal.persistence.FileStore; diff --git a/firebase-crashlytics/src/test/java/com/google/firebase/crashlytics/internal/common/SessionReportingCoordinatorRobolectricTest.java b/firebase-crashlytics/src/test/java/com/google/firebase/crashlytics/internal/common/SessionReportingCoordinatorRobolectricTest.java index 41284f0f7f6..9b267be5de7 100644 --- a/firebase-crashlytics/src/test/java/com/google/firebase/crashlytics/internal/common/SessionReportingCoordinatorRobolectricTest.java +++ b/firebase-crashlytics/src/test/java/com/google/firebase/crashlytics/internal/common/SessionReportingCoordinatorRobolectricTest.java @@ -29,7 +29,7 @@ import androidx.annotation.RequiresApi; import androidx.test.core.app.ApplicationProvider; import com.google.firebase.concurrent.TestOnlyExecutors; -import com.google.firebase.crashlytics.internal.CrashlyticsWorker; +import com.google.firebase.crashlytics.internal.concurrency.CrashlyticsWorker; import com.google.firebase.crashlytics.internal.metadata.LogFileManager; import com.google.firebase.crashlytics.internal.metadata.UserMetadata; import com.google.firebase.crashlytics.internal.model.CrashlyticsReport;