File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/main/java/com/google/firebase/remoteconfig Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ dependencies {
53
53
implementation project(' :firebase-abt' )
54
54
implementation project(' :firebase-components' )
55
55
implementation project(' :firebase-installations-interop' )
56
+ testImplementation project(path : ' :firebase-config' )
56
57
runtimeOnly project(' :firebase-installations' )
57
58
58
59
implementation ' com.google.firebase:firebase-measurement-connector:18.0.0'
Original file line number Diff line number Diff line change 23
23
import com .google .android .gms .tasks .Task ;
24
24
import com .google .android .gms .tasks .Tasks ;
25
25
import com .google .firebase .FirebaseApp ;
26
+ import com .google .firebase .FirebaseError ;
27
+ import com .google .firebase .FirebaseException ;
26
28
import com .google .firebase .abt .AbtException ;
27
29
import com .google .firebase .abt .FirebaseABTesting ;
28
30
import com .google .firebase .emulators .EmulatedServiceSettings ;
@@ -550,8 +552,14 @@ public Task<Void> reset() {
550
552
*
551
553
* @param host the emulator host (for example, 10.0.2.2)
552
554
* @param port the emulator port (for example, 9299)
555
+ *
556
+ * @exception FirebaseRemoteConfigClientException Thrown when useEmulator is called after a fetch.
553
557
*/
554
- public void useEmulator (@ NonNull String host , int port ) {
558
+ public void useEmulator (@ NonNull String host , int port ) throws FirebaseRemoteConfigClientException {
559
+ if (this .frcMetadata .getInfo ().getLastFetchStatus () != LAST_FETCH_STATUS_NO_FETCH_YET ) {
560
+ throw new FirebaseRemoteConfigClientException (
561
+ "Cannot connect to emulator after a fetch has been made." );
562
+ }
555
563
fetchHandler .setEmulatedServiceSettings (new EmulatedServiceSettings (host , port ));
556
564
}
557
565
You can’t perform that action at this time.
0 commit comments