Skip to content

Commit e0a3493

Browse files
committed
Merge remote-tracking branch 'remotes/origin/mila/BloomFilter' into BloomFilterComplexIntegrationTest
2 parents e38db64 + 1bbf61b commit e0a3493

File tree

46 files changed

+2761
-162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2761
-162
lines changed

.github/workflows/build-release-artifacts.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ on:
88

99
jobs:
1010
build-artifacts:
11-
runs-on: ubuntu-latest
11+
# TODO(b/271315039) - Revert back to ubuntu when fixed
12+
runs-on: macos-latest
1213
env:
1314
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1415
steps:

encoders/firebase-encoders-json/firebase-encoders-json.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
plugins {
1616
id 'firebase-library'
17+
id 'kotlin-android'
1718
}
1819

1920
firebaseLibrary {
@@ -24,16 +25,19 @@ firebaseLibrary {
2425
android {
2526
compileSdkVersion project.targetSdkVersion
2627
defaultConfig {
27-
minSdkVersion project.minSdkVersion
28-
targetSdkVersion project.targetSdkVersion
29-
versionName version
30-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
28+
minSdkVersion project.minSdkVersion
29+
targetSdkVersion project.targetSdkVersion
30+
versionName version
31+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3132
}
3233

3334
compileOptions {
3435
sourceCompatibility JavaVersion.VERSION_1_8
3536
targetCompatibility JavaVersion.VERSION_1_8
3637
}
38+
kotlinOptions {
39+
jvmTarget = '1.8'
40+
}
3741
testOptions {
3842
unitTests {
3943
includeAndroidResources = true

encoders/firebase-encoders-json/src/main/java/com/google/firebase/encoders/json/JsonValueObjectEncoderContext.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,11 @@ JsonValueObjectEncoderContext add(@Nullable Object o, boolean inline) throws IOE
317317

318318
// Process enum last if it does not have a custom encoder registered.
319319
if (o instanceof Enum) {
320-
add(((Enum) o).name());
320+
if (o instanceof NumberedEnum) {
321+
add(((NumberedEnum) o).getNumber());
322+
} else {
323+
add(((Enum<?>) o).name());
324+
}
321325
return this;
322326
}
323327

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2023 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.firebase.encoders.json
18+
19+
/** Represents an explicitly numbered enum for json serialization. */
20+
interface NumberedEnum {
21+
val number: Int
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2023 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.firebase.encoders.json
18+
19+
internal enum class DummyEnum(override val number: Int) : NumberedEnum {
20+
VALUE_1(1),
21+
VALUE_2(2),
22+
}

encoders/firebase-encoders-json/src/test/java/com/google/firebase/encoders/json/JsonValueObjectEncoderContextTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,18 @@ public void testEncodingEnum_withCustomEncoder() {
219219
assertThat(result).isEqualTo("[\"value_1\",\"value_2\"]");
220220
}
221221

222+
@Test
223+
public void testEncodingNumberedEnum() {
224+
String result =
225+
new JsonDataEncoderBuilder()
226+
.build()
227+
.encode(
228+
new DummyEnum[] {
229+
DummyEnum.VALUE_1, DummyEnum.VALUE_2, DummyEnum.VALUE_1, DummyEnum.VALUE_1
230+
});
231+
assertThat(result).isEqualTo("[1,2,1,1]");
232+
}
233+
222234
@Test
223235
public void testEncodingCollection() throws IOException {
224236
ObjectEncoder<InnerDummyClass> anotherObjectEncoder =

firebase-appdistribution/firebase-appdistribution.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dependencies {
5252
implementation 'com.google.firebase:firebase-common:20.3.1'
5353
testImplementation project(path: ':firebase-appdistribution')
5454
testImplementation project(':integ-testing')
55-
runtimeOnly project(':firebase-installations')
55+
runtimeOnly 'com.google.firebase:firebase-installations:17.1.2'
5656

5757
implementation libs.javax.inject
5858
vendor (libs.dagger.dagger) {

firebase-appdistribution/test-app/test-app.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ dependencies {
7676

7777
// In this test project we also need to explicitly declare these dependencies
7878
implementation project(':firebase-appdistribution-api')
79-
implementation project(':firebase-common:ktx')
79+
implementation 'com.google.firebase:firebase-common-ktx:20.3.1'
8080
implementation "com.google.android.gms:play-services-tasks:18.0.2"
8181

8282
// Beta flavor uses the full implementation

firebase-config/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Unreleased
2+
* [feature] Added support for real-time config updates. To learn more, see [Get started with Firebase Remote Config](https://firebase.google.com/docs/remote-config/get-started?platform=android).
23

34
# 21.2.1
45
* [changed] Migrated [remote_config] to use standard Firebase executors.

firebase-config/api.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
// Signature format: 2.0
22
package com.google.firebase.remoteconfig {
33

4+
@com.google.auto.value.AutoValue public abstract class ConfigUpdate {
5+
ctor public ConfigUpdate();
6+
method @NonNull public static com.google.firebase.remoteconfig.ConfigUpdate create(@NonNull java.util.Set<java.lang.String>);
7+
method @NonNull public abstract java.util.Set<java.lang.String> getUpdatedKeys();
8+
}
9+
10+
public interface ConfigUpdateListener {
11+
method public void onError(@NonNull com.google.firebase.remoteconfig.FirebaseRemoteConfigException);
12+
method public void onUpdate(@NonNull com.google.firebase.remoteconfig.ConfigUpdate);
13+
}
14+
15+
public interface ConfigUpdateListenerRegistration {
16+
method public void remove();
17+
}
18+
419
public class FirebaseRemoteConfig {
520
method @NonNull public com.google.android.gms.tasks.Task<java.lang.Boolean> activate();
21+
method @NonNull public com.google.firebase.remoteconfig.ConfigUpdateListenerRegistration addOnConfigUpdateListener(@NonNull com.google.firebase.remoteconfig.ConfigUpdateListener);
622
method @NonNull public com.google.android.gms.tasks.Task<com.google.firebase.remoteconfig.FirebaseRemoteConfigInfo> ensureInitialized();
723
method @NonNull public com.google.android.gms.tasks.Task<java.lang.Void> fetch();
824
method @NonNull public com.google.android.gms.tasks.Task<java.lang.Void> fetch(long);
@@ -38,11 +54,25 @@ package com.google.firebase.remoteconfig {
3854
public class FirebaseRemoteConfigClientException extends com.google.firebase.remoteconfig.FirebaseRemoteConfigException {
3955
ctor public FirebaseRemoteConfigClientException(@NonNull String);
4056
ctor public FirebaseRemoteConfigClientException(@NonNull String, @Nullable Throwable);
57+
ctor public FirebaseRemoteConfigClientException(@NonNull String, @NonNull com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code);
58+
ctor public FirebaseRemoteConfigClientException(@NonNull String, @Nullable Throwable, @NonNull com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code);
4159
}
4260

4361
public class FirebaseRemoteConfigException extends com.google.firebase.FirebaseException {
4462
ctor public FirebaseRemoteConfigException(@NonNull String);
4563
ctor public FirebaseRemoteConfigException(@NonNull String, @Nullable Throwable);
64+
ctor public FirebaseRemoteConfigException(@NonNull String, @NonNull com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code);
65+
ctor public FirebaseRemoteConfigException(@NonNull String, @Nullable Throwable, @NonNull com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code);
66+
method @NonNull public com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code getCode();
67+
}
68+
69+
public enum FirebaseRemoteConfigException.Code {
70+
method public int value();
71+
enum_constant public static final com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code CONFIG_UPDATE_MESSAGE_INVALID;
72+
enum_constant public static final com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code CONFIG_UPDATE_NOT_FETCHED;
73+
enum_constant public static final com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code CONFIG_UPDATE_STREAM_ERROR;
74+
enum_constant public static final com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code CONFIG_UPDATE_UNAVAILABLE;
75+
enum_constant public static final com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code UNKNOWN;
4676
}
4777

4878
public class FirebaseRemoteConfigFetchThrottledException extends com.google.firebase.remoteconfig.FirebaseRemoteConfigException {
@@ -59,6 +89,10 @@ package com.google.firebase.remoteconfig {
5989
public class FirebaseRemoteConfigServerException extends com.google.firebase.remoteconfig.FirebaseRemoteConfigException {
6090
ctor public FirebaseRemoteConfigServerException(int, @NonNull String);
6191
ctor public FirebaseRemoteConfigServerException(int, @NonNull String, @Nullable Throwable);
92+
ctor public FirebaseRemoteConfigServerException(@NonNull String, @NonNull com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code);
93+
ctor public FirebaseRemoteConfigServerException(int, @NonNull String, @NonNull com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code);
94+
ctor public FirebaseRemoteConfigServerException(@NonNull String, @Nullable Throwable, @NonNull com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code);
95+
ctor public FirebaseRemoteConfigServerException(int, @NonNull String, @Nullable Throwable, @NonNull com.google.firebase.remoteconfig.FirebaseRemoteConfigException.Code);
6296
method public int getHttpStatusCode();
6397
}
6498

0 commit comments

Comments
 (0)