Skip to content

Commit 88efc1d

Browse files
committed
Merge branch 'master' of github.com:firebase/firebase-android-sdk into perfPackageNetworkBuilder
2 parents b5a9407 + 948896a commit 88efc1d

20 files changed

+74
-46
lines changed

firebase-perf/src/main/java/com/google/firebase/perf/FirebasePerformance.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
import com.google.firebase.inject.Provider;
3030
import com.google.firebase.installations.FirebaseInstallationsApi;
3131
import com.google.firebase.perf.config.ConfigResolver;
32+
import com.google.firebase.perf.config.RemoteConfigManager;
3233
import com.google.firebase.perf.internal.GaugeManager;
33-
import com.google.firebase.perf.internal.PerfMetricValidator;
34-
import com.google.firebase.perf.internal.RemoteConfigManager;
3534
import com.google.firebase.perf.logging.AndroidLogger;
3635
import com.google.firebase.perf.metrics.HttpMetric;
3736
import com.google.firebase.perf.metrics.Trace;
37+
import com.google.firebase.perf.metrics.validator.PerfMetricValidator;
3838
import com.google.firebase.perf.transport.TransportManager;
3939
import com.google.firebase.perf.util.Constants;
4040
import com.google.firebase.perf.util.ImmutableBundle;

firebase-perf/src/main/java/com/google/firebase/perf/config/ConfigResolver.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import com.google.firebase.perf.config.ConfigurationConstants.TraceEventCountBackground;
4040
import com.google.firebase.perf.config.ConfigurationConstants.TraceEventCountForeground;
4141
import com.google.firebase.perf.config.ConfigurationConstants.TraceSamplingRate;
42-
import com.google.firebase.perf.internal.RemoteConfigManager;
4342
import com.google.firebase.perf.logging.AndroidLogger;
4443
import com.google.firebase.perf.util.ImmutableBundle;
4544
import com.google.firebase.perf.util.Optional;

firebase-perf/src/main/java/com/google/firebase/perf/internal/RemoteConfigManager.java renamed to firebase-perf/src/main/java/com/google/firebase/perf/config/RemoteConfigManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
5-
//
65
// You may obtain a copy of the License at
6+
//
77
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package com.google.firebase.perf.internal;
15+
package com.google.firebase.perf.config;
1616

1717
import android.content.Context;
1818
import android.content.pm.PackageInfo;

firebase-perf/src/main/java/com/google/firebase/perf/injection/modules/FirebasePerformanceModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
import com.google.firebase.installations.FirebaseInstallationsApi;
2222
import com.google.firebase.perf.FirebasePerformance;
2323
import com.google.firebase.perf.config.ConfigResolver;
24+
import com.google.firebase.perf.config.RemoteConfigManager;
2425
import com.google.firebase.perf.internal.GaugeManager;
25-
import com.google.firebase.perf.internal.RemoteConfigManager;
2626
import com.google.firebase.remoteconfig.RemoteConfigComponent;
2727
import dagger.Module;
2828
import dagger.Provides;

firebase-perf/src/main/java/com/google/firebase/perf/metrics/HttpMetric.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import com.google.firebase.perf.FirebasePerformance.HttpMethod;
2020
import com.google.firebase.perf.FirebasePerformanceAttributable;
2121
import com.google.firebase.perf.config.ConfigResolver;
22-
import com.google.firebase.perf.internal.PerfMetricValidator;
2322
import com.google.firebase.perf.logging.AndroidLogger;
23+
import com.google.firebase.perf.metrics.validator.PerfMetricValidator;
2424
import com.google.firebase.perf.transport.TransportManager;
2525
import com.google.firebase.perf.util.Constants;
2626
import com.google.firebase.perf.util.Timer;

firebase-perf/src/main/java/com/google/firebase/perf/metrics/Trace.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
import com.google.firebase.perf.internal.AppStateMonitor;
2626
import com.google.firebase.perf.internal.AppStateUpdateHandler;
2727
import com.google.firebase.perf.internal.GaugeManager;
28-
import com.google.firebase.perf.internal.PerfMetricValidator;
2928
import com.google.firebase.perf.internal.PerfSession;
3029
import com.google.firebase.perf.internal.SessionAwareObject;
3130
import com.google.firebase.perf.internal.SessionManager;
3231
import com.google.firebase.perf.logging.AndroidLogger;
32+
import com.google.firebase.perf.metrics.validator.PerfMetricValidator;
3333
import com.google.firebase.perf.transport.TransportManager;
3434
import com.google.firebase.perf.util.Clock;
3535
import com.google.firebase.perf.util.Constants;

firebase-perf/src/main/java/com/google/firebase/perf/internal/FirebasePerfApplicationInfoValidator.java renamed to firebase-perf/src/main/java/com/google/firebase/perf/metrics/validator/FirebasePerfApplicationInfoValidator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
5-
//
65
// You may obtain a copy of the License at
6+
//
77
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package com.google.firebase.perf.internal;
15+
package com.google.firebase.perf.metrics.validator;
1616

1717
import com.google.firebase.perf.logging.AndroidLogger;
1818
import com.google.firebase.perf.v1.ApplicationInfo;

firebase-perf/src/main/java/com/google/firebase/perf/internal/FirebasePerfGaugeMetricValidator.java renamed to firebase-perf/src/main/java/com/google/firebase/perf/metrics/validator/FirebasePerfGaugeMetricValidator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
5-
//
65
// You may obtain a copy of the License at
6+
//
77
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package com.google.firebase.perf.internal;
15+
package com.google.firebase.perf.metrics.validator;
1616

1717
import com.google.firebase.perf.v1.GaugeMetric;
1818
import com.google.firebase.perf.v1.PerfMetric;

firebase-perf/src/main/java/com/google/firebase/perf/internal/FirebasePerfNetworkValidator.java renamed to firebase-perf/src/main/java/com/google/firebase/perf/metrics/validator/FirebasePerfNetworkValidator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
5-
//
65
// You may obtain a copy of the License at
6+
//
77
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package com.google.firebase.perf.internal;
15+
package com.google.firebase.perf.metrics.validator;
1616

1717
import android.content.Context;
1818
import androidx.annotation.NonNull;

firebase-perf/src/main/java/com/google/firebase/perf/internal/FirebasePerfTraceValidator.java renamed to firebase-perf/src/main/java/com/google/firebase/perf/metrics/validator/FirebasePerfTraceValidator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
5-
//
65
// You may obtain a copy of the License at
6+
//
77
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package com.google.firebase.perf.internal;
15+
package com.google.firebase.perf.metrics.validator;
1616

1717
import androidx.annotation.NonNull;
1818
import androidx.annotation.Nullable;

firebase-perf/src/main/java/com/google/firebase/perf/internal/PerfMetricValidator.java renamed to firebase-perf/src/main/java/com/google/firebase/perf/metrics/validator/PerfMetricValidator.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
5-
//
65
// You may obtain a copy of the License at
6+
//
77
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package com.google.firebase.perf.internal;
15+
package com.google.firebase.perf.metrics.validator;
1616

1717
import android.content.Context;
1818
import androidx.annotation.NonNull;
@@ -83,6 +83,7 @@ public static boolean isValid(@NonNull PerfMetric perfMetric, @NonNull Context c
8383
* @return null if the string can be used as Trace name, if not, an error string explaining why it
8484
* can't be used.
8585
*/
86+
@Nullable
8687
public static String validateTraceName(@Nullable String str) {
8788
if (str == null) {
8889
return "Trace name must not be null";
@@ -112,6 +113,7 @@ public static String validateTraceName(@Nullable String str) {
112113
* @return null if the string can be used as Counter name, if not, an error string explaining why
113114
* it can't be used.
114115
*/
116+
@Nullable
115117
public static String validateMetricName(@Nullable String str) {
116118
if (str == null) {
117119
return "Metric name must not be null";
@@ -137,6 +139,7 @@ public static String validateMetricName(@Nullable String str) {
137139
* @return null if the entry can be used as an Attribute, if not, an error string explaining why
138140
* it can't be used.
139141
*/
142+
@Nullable
140143
public static String validateAttribute(@NonNull Map.Entry<String, String> attribute) {
141144
String key = attribute.getKey();
142145
String value = attribute.getValue();
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
/** @hide */
16+
/** @hide */
17+
package com.google.firebase.perf.metrics.validator;
18+

firebase-perf/src/main/java/com/google/firebase/perf/transport/TransportManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
import com.google.firebase.perf.config.ConfigResolver;
3535
import com.google.firebase.perf.internal.AppStateMonitor;
3636
import com.google.firebase.perf.internal.AppStateMonitor.AppStateCallback;
37-
import com.google.firebase.perf.internal.PerfMetricValidator;
3837
import com.google.firebase.perf.internal.SessionManager;
3938
import com.google.firebase.perf.logging.AndroidLogger;
39+
import com.google.firebase.perf.metrics.validator.PerfMetricValidator;
4040
import com.google.firebase.perf.util.Constants;
4141
import com.google.firebase.perf.util.Constants.CounterNames;
4242
import com.google.firebase.perf.v1.AndroidApplicationInfo;

firebase-perf/src/test/java/com/google/firebase/perf/FirebasePerformanceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
import com.google.firebase.installations.FirebaseInstallationsApi;
3535
import com.google.firebase.perf.config.ConfigResolver;
3636
import com.google.firebase.perf.config.DeviceCacheManager;
37+
import com.google.firebase.perf.config.RemoteConfigManager;
3738
import com.google.firebase.perf.internal.GaugeManager;
38-
import com.google.firebase.perf.internal.RemoteConfigManager;
3939
import com.google.firebase.perf.util.Constants;
4040
import com.google.firebase.perf.util.ImmutableBundle;
4141
import com.google.firebase.remoteconfig.RemoteConfigComponent;

firebase-perf/src/test/java/com/google/firebase/perf/config/ConfigResolverTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import androidx.test.core.app.ApplicationProvider;
3232
import com.google.firebase.perf.BuildConfig;
3333
import com.google.firebase.perf.FirebasePerformanceTestBase;
34-
import com.google.firebase.perf.internal.RemoteConfigManager;
3534
import com.google.firebase.perf.util.ImmutableBundle;
3635
import com.google.firebase.perf.util.Optional;
3736
import org.junit.Before;

firebase-perf/src/test/java/com/google/firebase/perf/internal/RemoteConfigManagerTest.java renamed to firebase-perf/src/test/java/com/google/firebase/perf/config/RemoteConfigManagerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
5-
//
65
// You may obtain a copy of the License at
6+
//
77
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package com.google.firebase.perf.internal;
15+
package com.google.firebase.perf.config;
1616

1717
import static com.google.common.truth.Truth.assertThat;
1818
import static java.nio.charset.StandardCharsets.UTF_8;

firebase-perf/src/test/java/com/google/firebase/perf/internal/FirebasePerfApplicationInfoValidatorTest.java renamed to firebase-perf/src/test/java/com/google/firebase/perf/metrics/validator/FirebasePerfApplicationInfoValidatorTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
5-
//
65
// You may obtain a copy of the License at
6+
//
77
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package com.google.firebase.perf.internal;
15+
package com.google.firebase.perf.metrics.validator;
1616

1717
import static com.google.common.truth.Truth.assertThat;
1818

@@ -23,7 +23,10 @@
2323
import org.junit.runner.RunWith;
2424
import org.robolectric.RobolectricTestRunner;
2525

26-
/** Unit tests for {@link FirebasePerfApplicationInfoValidator}. */
26+
/**
27+
* Unit tests for {@link
28+
* com.google.firebase.perf.metrics.validator.FirebasePerfApplicationInfoValidator}.
29+
*/
2730
@RunWith(RobolectricTestRunner.class)
2831
public class FirebasePerfApplicationInfoValidatorTest {
2932
@Test

firebase-perf/src/test/java/com/google/firebase/perf/internal/FirebasePerfGaugeManagerValidatorTest.java renamed to firebase-perf/src/test/java/com/google/firebase/perf/metrics/validator/FirebasePerfGaugeManagerValidatorTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
5-
//
65
// You may obtain a copy of the License at
6+
//
77
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package com.google.firebase.perf.internal;
15+
package com.google.firebase.perf.metrics.validator;
1616

1717
import static com.google.common.truth.Truth.assertThat;
1818

@@ -27,7 +27,10 @@
2727
import org.junit.runner.RunWith;
2828
import org.robolectric.RobolectricTestRunner;
2929

30-
/** Unit tests for {@link com.google.firebase.perf.internal.FirebasePerfGaugeMetricValidator}. */
30+
/**
31+
* Unit tests for {@link
32+
* com.google.firebase.perf.metrics.validator.FirebasePerfGaugeMetricValidator}.
33+
*/
3134
@RunWith(RobolectricTestRunner.class)
3235
public final class FirebasePerfGaugeManagerValidatorTest {
3336

firebase-perf/src/test/java/com/google/firebase/perf/internal/FirebasePerfNetworkValidatorTest.java renamed to firebase-perf/src/test/java/com/google/firebase/perf/metrics/validator/FirebasePerfNetworkValidatorTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
5-
//
65
// You may obtain a copy of the License at
6+
//
77
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package com.google.firebase.perf.internal;
15+
package com.google.firebase.perf.metrics.validator;
1616

1717
import static com.google.common.truth.Truth.assertThat;
1818
import static org.junit.Assert.assertFalse;
@@ -29,7 +29,9 @@
2929
import org.robolectric.RobolectricTestRunner;
3030
import org.robolectric.RuntimeEnvironment;
3131

32-
/** Unit tests for {@link FirebasePerfNetworkValidator}. */
32+
/**
33+
* Unit tests for {@link com.google.firebase.perf.metrics.validator.FirebasePerfNetworkValidator}.
34+
*/
3335
@RunWith(RobolectricTestRunner.class)
3436
public class FirebasePerfNetworkValidatorTest extends FirebasePerformanceTestBase {
3537
private final FirebasePerfNetworkValidator validator =

0 commit comments

Comments
 (0)