Skip to content

Commit 0dffae6

Browse files
committed
Revert visibility change in FirebaseApp
1 parent 17a4bf1 commit 0dffae6

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

firebase-common/src/main/java/com/google/firebase/FirebaseApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ public boolean isDefaultApp() {
472472
/** @hide */
473473
@VisibleForTesting
474474
@RestrictTo(Scope.TESTS)
475-
public void initializeAllComponents() {
475+
void initializeAllComponents() {
476476
componentRuntime.initializeAllComponentsForTests();
477477
}
478478

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2022 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+
16+
package com.google.firebase
17+
18+
import com.google.firebase.FirebaseApp
19+
20+
internal fun initializeAllComponentsForBenchmark(app: FirebaseApp) {
21+
app.initializeAllComponents()
22+
}
23+

health-metrics/benchmark/template/app/src/main/java/com/google/firebase/benchmark/MainActivity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ package com.google.firebase.benchmark
1717
import androidx.appcompat.app.AppCompatActivity
1818
import android.os.Bundle
1919
import com.google.firebase.FirebaseApp
20+
import com.google.firebase.initializeAllComponentsForBenchmark
2021

2122
class MainActivity : AppCompatActivity() {
2223
override fun onCreate(savedInstanceState: Bundle?) {
2324
super.onCreate(savedInstanceState)
2425
setContentView(R.layout.activity_main)
2526

26-
FirebaseApp.getInstance().initializeAllComponents()
27+
val app = FirebaseApp.getInstance()
28+
initializeAllComponentsForBenchmark(app)
2729
}
2830
}

0 commit comments

Comments
 (0)