Skip to content

Commit a4d54ad

Browse files
committed
Merge branch 'main' into ep/vertex-proguard
2 parents 7a6aca5 + 552132b commit a4d54ad

File tree

270 files changed

+36328
-770
lines changed

Some content is hidden

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

270 files changed

+36328
-770
lines changed

firebase-config/bandwagoner/src/main/java/com/googletest/firebase/remoteconfig/bandwagoner/RealtimeFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private void toggleRealtime(View view, Boolean isChecked) {
9494
frc.addOnConfigUpdateListener(
9595
new ConfigUpdateListener() {
9696
@Override
97-
public void onUpdate(ConfigUpdate configUpdate) {
97+
public void onUpdate(@NonNull ConfigUpdate configUpdate) {
9898
Log.d(TAG, String.join(", ", configUpdate.getUpdatedKeys()));
9999
updatedParamsText.setText(String.join(", ", configUpdate.getUpdatedKeys()));
100100
}

firebase-config/src/main/java/com/google/firebase/remoteconfig/ConfigUpdateListener.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package com.google.firebase.remoteconfig;
1616

1717
import androidx.annotation.NonNull;
18-
import javax.annotation.Nonnull;
1918

2019
/**
2120
* Event listener interface for real-time Remote Config updates. Implement {@code
@@ -38,5 +37,5 @@ public interface ConfigUpdateListener {
3837
*
3938
* @param error A {@link FirebaseRemoteConfigException} with information about the error.
4039
*/
41-
void onError(@Nonnull FirebaseRemoteConfigException error);
40+
void onError(@NonNull FirebaseRemoteConfigException error);
4241
}

firebase-config/src/main/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigServerException.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import androidx.annotation.NonNull;
1818
import androidx.annotation.Nullable;
19-
import javax.annotation.Nonnull;
2019

2120
/**
2221
* A Firebase Remote Config internal issue caused by an interaction with the Firebase Remote Config
@@ -46,7 +45,7 @@ public FirebaseRemoteConfigServerException(
4645
* Creates a Firebase Remote Config server exception with the given message and {@code
4746
* FirebaseRemoteConfigException} code.
4847
*/
49-
public FirebaseRemoteConfigServerException(@NonNull String detailMessage, @Nonnull Code code) {
48+
public FirebaseRemoteConfigServerException(@NonNull String detailMessage, @NonNull Code code) {
5049
super(detailMessage, code);
5150
this.httpStatusCode = -1;
5251
}
@@ -56,7 +55,7 @@ public FirebaseRemoteConfigServerException(@NonNull String detailMessage, @Nonnu
5655
* {@code FirebaseRemoteConfigException} code.
5756
*/
5857
public FirebaseRemoteConfigServerException(
59-
int httpStatusCode, @NonNull String detailMessage, @Nonnull Code code) {
58+
int httpStatusCode, @NonNull String detailMessage, @NonNull Code code) {
6059
super(detailMessage, code);
6160
this.httpStatusCode = httpStatusCode;
6261
}

firebase-config/src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public void setUp() throws Exception {
316316
ConfigUpdateListener listener =
317317
new ConfigUpdateListener() {
318318
@Override
319-
public void onUpdate(ConfigUpdate configUpdate) {
319+
public void onUpdate(@NonNull ConfigUpdate configUpdate) {
320320
mockOnUpdateListener.onUpdate(configUpdate);
321321
}
322322

@@ -1757,7 +1757,7 @@ private void flushScheduledTasks() throws InterruptedException {
17571757
private ConfigUpdateListener generateEmptyRealtimeListener() {
17581758
return new ConfigUpdateListener() {
17591759
@Override
1760-
public void onUpdate(ConfigUpdate configUpdate) {}
1760+
public void onUpdate(@NonNull ConfigUpdate configUpdate) {}
17611761

17621762
@Override
17631763
public void onError(@NonNull FirebaseRemoteConfigException error) {}

firebase-config/src/test/java/com/google/firebase/remoteconfig/RemoteConfigComponentTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public void registerRolloutsStateSubscriber_firebaseNamespace_callsSubscriptionH
185185
when(mockMetadataClient.getRealtimeBackoffMetadata())
186186
.thenReturn(new ConfigMetadataClient.RealtimeBackoffMetadata(0, new Date()));
187187

188-
RemoteConfigComponent frcComponent = getNewFrcComponent();
188+
RemoteConfigComponent frcComponent = getNewFrcComponentWithoutLoadingDefault();
189189
FirebaseRemoteConfig instance = getFrcInstanceFromComponent(frcComponent, DEFAULT_NAMESPACE);
190190

191191
frcComponent.registerRolloutsStateSubscriber(DEFAULT_NAMESPACE, mockRolloutsStateSubscriber);

firebase-config/src/test/java/com/google/firebase/remoteconfig/internal/ConfigCacheClientTest.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.mockito.ArgumentCaptor;
4343
import org.mockito.Mock;
4444
import org.mockito.MockitoAnnotations;
45+
import org.mockito.stubbing.Answer;
4546
import org.robolectric.RobolectricTestRunner;
4647
import org.robolectric.annotation.Config;
4748

@@ -220,7 +221,7 @@ public void getBlocking_hasCachedValue_returnsCache() throws Exception {
220221

221222
@Test
222223
public void getBlocking_hasNoCachedValueAndFileReadTimesOut_returnsNull() throws Exception {
223-
when(mockStorageClient.read()).thenReturn(configContainer);
224+
when(mockStorageClient.read()).thenAnswer(BLOCK_INDEFINITELY);
224225

225226
ConfigContainer container = cacheClient.getBlocking(/* diskReadTimeoutInSeconds= */ 0L);
226227

@@ -329,4 +330,18 @@ public void cleanUp() {
329330
cacheThreadPool.shutdownNow();
330331
testingThreadPool.shutdownNow();
331332
}
333+
334+
/**
335+
* A Mockito "answer" that blocks indefinitely. The only way that {@link Answer#answer} will
336+
* return is if its thread is interrupted. This may be useful to cause a method to never return,
337+
* which should result in a timeout waiting for the operation to complete.
338+
* <p>
339+
* Example:
340+
* {@code when(foo.get()).thenAnswer(BLOCK_INDEFINITELY); }
341+
*/
342+
private static final Answer<ConfigContainer> BLOCK_INDEFINITELY =
343+
invocation -> {
344+
Thread.sleep(Long.MAX_VALUE);
345+
throw new RuntimeException("BLOCK_INDEFINITELY.answer() should never get here");
346+
};
332347
}

firebase-crashlytics/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Unreleased
22
* [fixed] Improved data consistency for rapid user actions.
3+
* [fixed] Fixed exception propagation in the case of no default uncaught exception handler.
34
* [changed] Internal changes to improve startup time.
45
* [changed] Internal changes to the way background tasks are scheduled.
56
* [changed] Migrated SDK to use standard Firebase executors.

firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsUncaughtExceptionHandler.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@ public void uncaughtException(Thread thread, Throwable ex) {
5858
} catch (Exception e) {
5959
Logger.getLogger().e("An error occurred in the uncaught exception handler", e);
6060
} finally {
61-
Logger.getLogger().d("Completed exception processing. Invoking default exception handler.");
62-
defaultHandler.uncaughtException(thread, ex);
61+
if (defaultHandler != null) {
62+
Logger.getLogger().d("Completed exception processing. Invoking default exception handler.");
63+
defaultHandler.uncaughtException(thread, ex);
64+
} else {
65+
Logger.getLogger().d("Completed exception processing, but no default exception handler.");
66+
System.exit(1);
67+
}
6368
isHandlingException.set(false);
6469
}
6570
}

firebase-dataconnect/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dataconnect.local.properties

firebase-dataconnect/CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Unreleased
2+
* [feature] Initial release of the Data Connect SDK (public preview). Learn how to
3+
[get started](https://firebase.google.com/docs/data-connect/android-sdk)
4+
with the SDK in your app.
5+
* [feature] Added App Check support.
6+
([#6176](https://github.com/firebase/firebase-android-sdk/pull/6176))
7+
* [feature] Added `AnyValue` to support the `Any` custom GraphQL scalar type.
8+
([#6285](https://github.com/firebase/firebase-android-sdk/pull/6285))
9+
* [feature] Added `OrderDirection` enum support.
10+
([#6307](https://github.com/firebase/firebase-android-sdk/pull/6307))
11+
* [feature] Added ability to specify `SerializersModule` when serializing.
12+
([#6297](https://github.com/firebase/firebase-android-sdk/pull/6297))
13+
* [feature] Added `CallerSdkType`, which enables tracking of the generated SDK usage.
14+
([#6298](https://github.com/firebase/firebase-android-sdk/pull/6298) and
15+
[#6179](https://github.com/firebase/firebase-android-sdk/pull/6179))
16+
* [changed] Changed gRPC proto package to v1beta (was v1alpha).
17+
([#6299](https://github.com/firebase/firebase-android-sdk/pull/6299))
18+
* [changed] Added `equals` and `hashCode` methods to `GeneratedConnector`.
19+
([#6177](https://github.com/firebase/firebase-android-sdk/pull/6177))

firebase-dataconnect/README.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# firebase-dataconnect
2+
3+
This is the Firebase Android Data Connect SDK.
4+
5+
## Building
6+
7+
All Gradle commands should be run from the source root (which is one level up
8+
from this folder). See the README.md in the source root for instructions on
9+
publishing/testing Firebase Data Connect.
10+
11+
To build Firebase Data Connect, from the source root run:
12+
```bash
13+
./gradlew :firebase-dataconnect:assembleRelease
14+
```
15+
16+
## Unit Testing
17+
18+
To run unit tests for Firebase Data Connect, from the source root run:
19+
```bash
20+
./gradlew :firebase-dataconnect:check
21+
```
22+
23+
## Integration Testing
24+
25+
Running integration tests requires a Firebase project because they connect to
26+
the Firebase Data Connect backend.
27+
28+
See [here](../README.md#project-setup) for how to setup a project.
29+
30+
Once you setup the project, download `google-services.json` and place it in
31+
the source root.
32+
33+
Make sure you have created a Firebase Data Connect instance for your project,
34+
before you proceed.
35+
36+
By default, integration tests run against the Firebase Data Connect emulator.
37+
38+
### Setting up the Firebase Data Connect Emulator
39+
40+
The integration tests require that the Firebase Data Connect emulator is running
41+
on port 9399, which is default when running it via the Data Connect Toolkit.
42+
43+
* [Install the Firebase CLI](https://firebase.google.com/docs/cli/).
44+
```
45+
npm install -g firebase-tools
46+
```
47+
* [Install the Firebase Data Connect
48+
emulator](https://firebase.google.com/docs/FIX_URL/security/test-rules-emulator#install_the_emulator).
49+
```
50+
firebase setup:emulators:dataconnect
51+
```
52+
* Run the emulator
53+
```
54+
firebase emulators:start --only dataconnect
55+
```
56+
* Select the `Firebase Data Connect Integration Tests (Firebase Data Connect
57+
Emulator)` run configuration to run all integration tests.
58+
59+
To run the integration tests against prod, select
60+
`DataConnectProdIntegrationTest` run configuration.
61+
62+
### Run on Local Android Emulator
63+
64+
Then run:
65+
```bash
66+
./gradlew :firebase-dataconnect:connectedCheck
67+
```
68+
69+
### Run on Firebase Test Lab
70+
71+
You can also test on Firebase Test Lab, which allow you to run the integration
72+
tests on devices hosted in a Google data center.
73+
74+
See [here](../README.md#running-integration-tests-on-firebase-test-lab) for
75+
instructions of how to setup Firebase Test Lab for your project.
76+
77+
Run:
78+
```bash
79+
./gradlew :firebase-dataconnect:deviceCheck
80+
```
81+
82+
## Code Formatting
83+
84+
Run below to format Kotlin and Java code:
85+
```bash
86+
./gradlew :firebase-dataconnect:spotlessApply
87+
```
88+
89+
See [here](../README.md#code-formatting) if you want to be able to format code
90+
from within Android Studio.
91+
92+
## Build Local Jar of Firebase Data Connect SDK
93+
94+
```bash
95+
./gradlew -PprojectsToPublish="firebase-dataconnect" publishReleasingLibrariesToMavenLocal
96+
```
97+
98+
Developers may then take a dependency on these locally published versions by adding
99+
the `mavenLocal()` repository to your [repositories
100+
block](https://docs.gradle.org/current/userguide/declaring_repositories.html) in
101+
your app module's build.gradle.
102+
103+
## Misc
104+
After importing the project into Android Studio and building successfully
105+
for the first time, Android Studio will delete the run configuration xml files
106+
in `./idea/runConfigurations`. Undo these changes with the command:
107+
108+
```
109+
$ git checkout .idea/runConfigurations
110+
```
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* Copyright 2024 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+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
18+
19+
plugins {
20+
id("com.android.library")
21+
id("kotlin-android")
22+
alias(libs.plugins.kotlinx.serialization)
23+
}
24+
25+
android {
26+
val compileSdkVersion : Int by rootProject
27+
val targetSdkVersion : Int by rootProject
28+
val minSdkVersion : Int by rootProject
29+
30+
namespace = "com.google.firebase.dataconnect.androidTestutil"
31+
compileSdk = compileSdkVersion
32+
defaultConfig {
33+
minSdk = minSdkVersion
34+
targetSdk = targetSdkVersion
35+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
36+
}
37+
compileOptions {
38+
sourceCompatibility = JavaVersion.VERSION_1_8
39+
targetCompatibility = JavaVersion.VERSION_1_8
40+
}
41+
kotlinOptions { jvmTarget = "1.8" }
42+
43+
packaging {
44+
resources {
45+
excludes.add("META-INF/LICENSE.md")
46+
excludes.add("META-INF/LICENSE-notice.md")
47+
}
48+
}
49+
}
50+
51+
dependencies {
52+
implementation(project(":firebase-dataconnect"))
53+
implementation(project(":firebase-dataconnect:testutil"))
54+
55+
implementation("com.google.firebase:firebase-auth:22.3.1")
56+
implementation("com.google.firebase:firebase-appcheck:18.0.0")
57+
58+
implementation(libs.androidx.test.core)
59+
implementation(libs.androidx.test.junit)
60+
implementation(libs.auth0.jwt)
61+
implementation(libs.kotest.property)
62+
implementation(libs.kotlinx.coroutines.core)
63+
implementation(libs.kotlinx.serialization.core)
64+
implementation(libs.kotlinx.serialization.json)
65+
implementation(libs.truth)
66+
implementation(libs.turbine)
67+
}
68+
69+
tasks.withType<KotlinCompile>().all {
70+
kotlinOptions {
71+
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
72+
}
73+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
3+
<application />
4+
</manifest>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"type": "service_account",
3+
"project_id": "prjh5zbv64sv6",
4+
"private_key_id": "abcdef0123456789abcdef0123456789abcdef01",
5+
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCvfyKRUZMyp1FS\nbL2cZIMNA5AbDHBuZciEZFIbG7rx7d12Lnwz/inBSuhJ2qzmSHvWLQfjV0xsPVEH\nCCQdB7owt8GemvcyrzaW/vQ5WmvN7Wpj7Efz7iEguXQfqa09FklGECfrhgnOdsdd\ntoQW19nzETwepXzBvo6C/etTesUHAjBLUeHoh94vDvMTbp+9Dc48pG+uMhSVItjV\nv32lDRemFcewK33SCYWG2+3CqEQHlFf75pnbMTJr0392KLJtXqv6Kgcd61JXB7l8\nw8G4GPm8o9er0l4j5lB36Az1SmAJM68K7lI98PMrCcSsdwgNT3R16J6y+zMJfc5h\nStGdJP5hAgMBAAECggEARGEtl2CpEYoHEi4jfS3esDHsstVYc3N+OzOZmE1oPH65\nlSRMqbeFDncA5lHpn3qrocp+8dJgiSYlDa/a3mLV5cibjRCFc/64LwJdJ4G3UpAI\nrbFxYbatusH34KRsx0oJN97wpwDdjlBSow2MDxiAqAhVm/1QDG+SuLB2QlsqLO3E\ntDHgix+x08b01ui7/QYm83y1qTUTeCq/JlpRcMe4Nqp8RJiVTu+OY9MVJeA7o/ng\nLYnjTI0u1kB346EClTvq2xSb0h5AENtAd61B7H65JtkQWB5uDHL3HrWAbVVldp21\ncH6sO66/ApY4v0KGalgbBZ6VzmVuzVp7Kl+0t+m0/wKBgQDVdmz77vdjsTG7LEqC\nsknEKOTXSJYpA6g4dCouwHGrS4EkNzCXaAOCAdOoPkBF991uNNSqPtaDDMqF5CpA\nvJKzANBn1AuGp9jimITfA82KtEbA3t7yCk6A6+sAJNHsVA5I0+p/wcO0VmVZGIoN\n2pIHOTVbytcfAgHG0CjMv2SbJwKBgQDSd+n/sdTNFcTe8KoRJP2N9UFGip/9GZrV\nn9SUZGHojYrCY8DKI0GtAgR6Lij9D9CJRTPDSOEMuNpyPQQNFa5Sa14ic6dcksNg\nG6cq1BaaqXE7nxzVvgrOBXAxnRudd7rI/JoEsrG+Ca23HkvuCKsydjbNs6GY9hfE\nSfMnrsivNwKBgQDBJDAkG+pXl6Jpuv+IFg1Mobu9Vv4XCioROnpYZuPym5Sz0gPz\nWreh0ElUd07sgAMojkDF8aliVhaA4xugC3+o21m2OFRdeE1zaZD/wI8fq1JBfOa4\nlb7GQ7AUJzyR2tQ57RTGl+mdqHZ3EQ8IzfVG9+phrbzLX6N/4iSobZx4DQKBgEYY\nn/uD+67OOEJT/yA0pKnZ7AKVetFt7K6HS+KcSCuOsI8rb/MiqOX5DQqwQwB9euOt\nA59fr2xwSHjRr364INXcYn6w7CWdz6o7q4JNHrYmBstno8/gOnMBRquPeroIPVJh\nJt63sRDs4klhssI1auckjf4WfJSYKbQ7ONuXj8kjAoGBAILZG9+YNZ9IKLtQzcdf\nbWzgQ2b9CujHdZ5agSGUHVeKSSIInQZAc5jRCKz35T9Xnh50qrixcNA90IvpjbGL\nCNmmvmB+IlIuH/Mzn6wb5fad8d80e1Yz+ueeAyZjMS6NYLwmZ1M52eeikRWdyO/h\nZ3q6UYLR9K+mhUFgV+X7g15T\n-----END PRIVATE KEY-----\n",
6+
"client_email": "firebase-adminsdk-trn2rx6xed@prjh5zbv64sv6.iam.gserviceaccount.com",
7+
"client_id": "123456789012345678901",
8+
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
9+
"token_uri": "https://oauth2.googleapis.com/token",
10+
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
11+
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-trn2rx6xed%40prjh5zbv64sv6.iam.gserviceaccount.com",
12+
"universe_domain": "googleapis.com"
13+
}

0 commit comments

Comments
 (0)