Skip to content

Commit 1d6d2eb

Browse files
authored
Revert "Un-hide EmulatorSettings API (#1712)"
This reverts commit 4748715.
1 parent 3c9f431 commit 1d6d2eb

File tree

17 files changed

+48
-53
lines changed

17 files changed

+48
-53
lines changed

firebase-common/api.txt

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
package com.google.firebase {
33

44
public class FirebaseApp {
5-
method public void enableEmulators(@NonNull com.google.firebase.emulators.EmulatorSettings);
65
method @NonNull public android.content.Context getApplicationContext();
76
method @NonNull public static java.util.List<com.google.firebase.FirebaseApp> getApps(@NonNull android.content.Context);
8-
method @NonNull public com.google.firebase.emulators.EmulatorSettings getEmulatorSettings();
97
method @NonNull public static com.google.firebase.FirebaseApp getInstance();
108
method @NonNull public static com.google.firebase.FirebaseApp getInstance(@NonNull String);
119
method @NonNull public String getName();
@@ -49,30 +47,6 @@ package com.google.firebase {
4947

5048
}
5149

52-
package com.google.firebase.emulators {
53-
54-
public final class EmulatedServiceSettings {
55-
ctor public EmulatedServiceSettings(@NonNull String, int);
56-
method @NonNull public String getHost();
57-
method public int getPort();
58-
}
59-
60-
public final class EmulatorSettings {
61-
field public static final com.google.firebase.emulators.EmulatorSettings DEFAULT;
62-
}
63-
64-
public static final class EmulatorSettings.Builder {
65-
ctor public EmulatorSettings.Builder();
66-
method @NonNull public com.google.firebase.emulators.EmulatorSettings.Builder addEmulatedService(@NonNull com.google.firebase.emulators.FirebaseEmulator, @NonNull com.google.firebase.emulators.EmulatedServiceSettings);
67-
method @NonNull public com.google.firebase.emulators.EmulatorSettings build();
68-
}
69-
70-
public final class FirebaseEmulator {
71-
method @NonNull public String getName();
72-
}
73-
74-
}
75-
7650
package com.google.firebase.provider {
7751

7852
public class FirebaseInitProvider extends android.content.ContentProvider {

firebase-common/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version=19.4.0
1+
version=19.3.1
22
latestReleasedVersion=19.3.0
33
android.enableUnitTestBinaryResources=true

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ public FirebaseOptions getOptions() {
149149
/**
150150
* Returns the specified {@link EmulatorSettings} or a default.
151151
*
152-
* <p>Calling this method "freezes" the emulator settings and future calls to enableEmulators on
153-
* the same FirebaseApp instance will fail.
152+
* <p>TODO(samstern): Un-hide this once Firestore, Database, and Functions are implemented
153+
*
154+
* @hide
154155
*/
155156
@NonNull
156157
public EmulatorSettings getEmulatorSettings() {
@@ -329,7 +330,10 @@ public static FirebaseApp initializeApp(
329330
* com.google.firebase.emulators.EmulatedServiceSettings} for {@link FirebaseDatabase#EMULATOR},
330331
* then calls to Cloud Firestore will communicate with the emulator rather than production.
331332
*
333+
* <p>TODO(samstern): Un-hide this once Firestore, Database, and Functions are implemented
334+
*
332335
* @param emulatorSettings the emulator settings for all services.
336+
* @hide
333337
*/
334338
public void enableEmulators(@NonNull EmulatorSettings emulatorSettings) {
335339
checkNotDeleted();

firebase-common/src/main/java/com/google/firebase/emulators/EmulatedServiceSettings.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
/**
2020
* Settings to connect a single Firebase service to a local emulator.
2121
*
22+
* <p>TODO(samstern): Un-hide this once Firestore, Database, and Functions are implemented
23+
*
2224
* @see EmulatorSettings
25+
* @hide
2326
*/
2427
public final class EmulatedServiceSettings {
2528

@@ -31,7 +34,6 @@ public EmulatedServiceSettings(@NonNull String host, int port) {
3134
this.port = port;
3235
}
3336

34-
@NonNull
3537
public String getHost() {
3638
return host;
3739
}

firebase-common/src/main/java/com/google/firebase/emulators/EmulatorSettings.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
* Settings that control which Firebase services should access a local emulator, rather than
2626
* production.
2727
*
28+
* <p>TODO(samstern): Un-hide this once Firestore, Database, and Functions are implemented
29+
*
2830
* @see com.google.firebase.FirebaseApp#enableEmulators(EmulatorSettings)
31+
* @hide
2932
*/
3033
public final class EmulatorSettings {
3134

firebase-common/src/main/java/com/google/firebase/emulators/FirebaseEmulator.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919
/**
2020
* Identifier Firebase services that can be emulated using the Firebase Emulator Suite.
2121
*
22+
* <p>TODO(samstern): Un-hide this once Firestore, Database, and Functions are implemented
23+
*
2224
* @see com.google.firebase.FirebaseApp#enableEmulators(EmulatorSettings)
2325
* @see EmulatorSettings
2426
* @see EmulatedServiceSettings
27+
* @hide
2528
*/
2629
public final class FirebaseEmulator {
2730

@@ -33,15 +36,14 @@ public final class FirebaseEmulator {
3336
* @hide
3437
*/
3538
@NonNull
36-
public static FirebaseEmulator forName(@NonNull String name) {
39+
public static FirebaseEmulator forName(String name) {
3740
return new FirebaseEmulator(name);
3841
}
3942

40-
private FirebaseEmulator(@NonNull String name) {
43+
private FirebaseEmulator(String name) {
4144
this.name = name;
4245
}
4346

44-
@NonNull
4547
public String getName() {
4648
return name;
4749
}

firebase-database/CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Unreleased
22

33
- [changed] Added internal HTTP header to the WebChannel connection.
4-
- [feature] Realtime Database now supports connecting to a local emulator via
5-
`FirebaseApp.enableEmulators()`
64

75
# 19.3.0
86
- [feature] Added ServerValue.increment() to support atomic field value increments

firebase-database/api.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ package com.google.firebase.database {
9696
method public void setLogLevel(@NonNull com.google.firebase.database.Logger.Level);
9797
method public void setPersistenceCacheSizeBytes(long);
9898
method public void setPersistenceEnabled(boolean);
99-
field @NonNull public static final com.google.firebase.emulators.FirebaseEmulator EMULATOR;
10099
}
101100

102101
public abstract class GenericTypeIndicator<T> {

firebase-database/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
version=19.4.0
15+
version=19.3.1
1616
latestReleasedVersion=19.3.0
1717
android.enableUnitTestBinaryResources=true

firebase-database/src/main/java/com/google/firebase/database/FirebaseDatabase.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,14 @@
4040
*/
4141
public class FirebaseDatabase {
4242

43-
/** Emulator identifier. See {@link FirebaseApp#enableEmulators(EmulatorSettings)} */
44-
@NonNull public static final FirebaseEmulator EMULATOR = FirebaseEmulator.forName("database");
43+
/**
44+
* Emulator identifier. See {@link FirebaseApp#enableEmulators(EmulatorSettings)}
45+
*
46+
* <p>TODO(samstern): Un-hide this once Firestore, Database, and Functions are implemented
47+
*
48+
* @hide
49+
*/
50+
public static final FirebaseEmulator EMULATOR = FirebaseEmulator.forName("database");
4551

4652
private static final String SDK_VERSION = BuildConfig.VERSION_NAME;
4753

firebase-firestore/CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
the app was in the background.
55
- [fixed] Fixed an issue that may have prevented the client from connecting
66
to the backend immediately after a user signed in.
7-
- [feature] Firestore now supports connecting to a local emulator via
8-
`FirebaseApp.enableEmulators()`.
97

108
# 21.4.3
119
- [changed] Firestore now limits the number of concurrent document lookups it

firebase-firestore/api.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ package com.google.firebase.firestore {
152152
method public static void setLoggingEnabled(boolean);
153153
method @NonNull public com.google.android.gms.tasks.Task<java.lang.Void> terminate();
154154
method @NonNull public com.google.android.gms.tasks.Task<java.lang.Void> waitForPendingWrites();
155-
field @NonNull public static final com.google.firebase.emulators.FirebaseEmulator EMULATOR;
156155
}
157156

158157
public class FirebaseFirestoreException extends com.google.firebase.FirebaseException {

firebase-firestore/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=21.5.0
1+
version=21.4.4
22
latestReleasedVersion=21.4.3

firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@
5858
*/
5959
public class FirebaseFirestore {
6060

61-
/** Emulator identifier. See {@link FirebaseApp#enableEmulators(EmulatorSettings)} */
62-
@NonNull public static final FirebaseEmulator EMULATOR = FirebaseEmulator.forName("firestore");
61+
/**
62+
* Emulator identifier. See {@link FirebaseApp#enableEmulators(EmulatorSettings)}
63+
*
64+
* <p>TODO(samstern): Un-hide this once Firestore, Database, and Functions are implemented
65+
*
66+
* @hide
67+
*/
68+
public static FirebaseEmulator EMULATOR = FirebaseEmulator.forName("firestore");
6369

6470
/**
6571
* Provides a registry management interface for {@code FirebaseFirestore} instances.

firebase-functions/api.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ package com.google.firebase.functions {
77
method @NonNull public static com.google.firebase.functions.FirebaseFunctions getInstance(@NonNull com.google.firebase.FirebaseApp);
88
method @NonNull public static com.google.firebase.functions.FirebaseFunctions getInstance(@NonNull String);
99
method @NonNull public static com.google.firebase.functions.FirebaseFunctions getInstance();
10-
method @Deprecated public void useFunctionsEmulator(@NonNull String);
11-
field @NonNull public static final com.google.firebase.emulators.FirebaseEmulator EMULATOR;
10+
method public void useFunctionsEmulator(@NonNull String);
1211
}
1312

1413
public class FirebaseFunctionsException extends com.google.firebase.FirebaseException {

firebase-functions/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version=19.1.0
1+
version=19.0.3
22
latestReleasedVersion=19.0.2
33
android.enableUnitTestBinaryResources=true

firebase-functions/src/main/java/com/google/firebase/functions/FirebaseFunctions.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import com.google.android.gms.tasks.Tasks;
2929
import com.google.firebase.FirebaseApp;
3030
import com.google.firebase.emulators.EmulatedServiceSettings;
31-
import com.google.firebase.emulators.EmulatorSettings;
3231
import com.google.firebase.emulators.FirebaseEmulator;
3332
import com.google.firebase.functions.FirebaseFunctionsException.Code;
3433
import java.io.IOException;
@@ -50,8 +49,16 @@
5049
/** FirebaseFunctions lets you call Cloud Functions for Firebase. */
5150
public class FirebaseFunctions {
5251

53-
/** Emulator identifier. See {@link FirebaseApp#enableEmulators(EmulatorSettings)} */
54-
@NonNull public static final FirebaseEmulator EMULATOR = FirebaseEmulator.forName("functions");
52+
/**
53+
* Emulator identifier, see {@link
54+
* com.google.firebase.emulators.EmulatorSettings.Builder#addEmulatedService(FirebaseEmulator,
55+
* EmulatedServiceSettings)}
56+
*
57+
* <p>TODO(samstern): Un-hide this once Firestore, Database, and Functions are implemented
58+
*
59+
* @hide
60+
*/
61+
public static final FirebaseEmulator EMULATOR = FirebaseEmulator.forName("functions");
5562

5663
/** A task that will be resolved once ProviderInstaller has installed what it needs to. */
5764
private static final TaskCompletionSource<Void> providerInstalled = new TaskCompletionSource<>();
@@ -211,9 +218,7 @@ URL getURL(String function) {
211218
* https://firebase.google.com/docs/functions/local-emulator
212219
*
213220
* @param origin The origin of the local emulator, such as "http://10.0.2.2:5005".
214-
* @deprecated use {@link FirebaseApp#enableEmulators(EmulatorSettings)}.
215221
*/
216-
@Deprecated
217222
public void useFunctionsEmulator(@NonNull String origin) {
218223
Preconditions.checkNotNull(origin, "origin cannot be null");
219224
urlFormat = origin + "/%2$s/%1$s/%3$s";

0 commit comments

Comments
 (0)