Skip to content

Commit e145df3

Browse files
committed
Merge remote-tracking branch 'origin/main' into SnappyPatchRevert
2 parents 5e75846 + 158465f commit e145df3

File tree

20 files changed

+180
-124
lines changed

20 files changed

+180
-124
lines changed

.github/workflows/android.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ jobs:
126126
shell: bash
127127
run: |
128128
build_scripts/android/install_prereqs.sh
129+
echo "NDK_ROOT=/tmp/android-ndk-r21e" >> $GITHUB_ENV
130+
echo "ANDROID_NDK_HOME=/tmp/android-ndk-r21e" >> $GITHUB_ENV
129131
130132
- name: Add strings.exe to PATH (Windows only)
131133
if: startsWith(matrix.os, 'windows')

.github/workflows/integration_tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,8 @@ jobs:
509509
shell: bash
510510
command: |
511511
build_scripts/android/install_prereqs.sh
512+
echo "NDK_ROOT=/tmp/android-ndk-r21e" >> $GITHUB_ENV
513+
echo "ANDROID_NDK_HOME=/tmp/android-ndk-r21e" >> $GITHUB_ENV
512514
pip install -r scripts/gha/requirements.txt
513515
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
514516
- name: Fetch prebuilt packaged SDK from previous run

Android/firebase_dependencies.gradle

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ import org.gradle.util.ConfigureUtil;
1616

1717
// A map of library to the dependencies that need to be added for it.
1818
def firebaseDependenciesMap = [
19-
'app' : ['com.google.firebase:firebase-analytics:21.0.0'],
19+
'app' : ['com.google.firebase:firebase-analytics'],
2020
'play_services' : ['com.google.android.gms:play-services-base:18.0.1'],
2121
'admob' : ['com.google.firebase:firebase-ads:19.8.0',
22-
'com.google.firebase:firebase-analytics:21.0.0'],
23-
'analytics' : ['com.google.firebase:firebase-analytics:21.0.0'],
24-
'auth' : ['com.google.firebase:firebase-auth:21.0.5'],
25-
'database' : ['com.google.firebase:firebase-database:20.0.5'],
26-
'dynamic_links' : ['com.google.firebase:firebase-dynamic-links:21.0.1'],
27-
'firestore' : ['com.google.firebase:firebase-firestore:24.1.2'],
28-
'functions' : ['com.google.firebase:firebase-functions:20.1.0'],
29-
'installations' : ['com.google.firebase:firebase-installations:17.0.1'],
30-
'invites' : ['com.google.firebase:firebase-invites:17.0.0'],
22+
'com.google.firebase:firebase-analytics'],
23+
'analytics' : ['com.google.firebase:firebase-analytics'],
24+
'auth' : ['com.google.firebase:firebase-auth'],
25+
'database' : ['com.google.firebase:firebase-database'],
26+
'dynamic_links' : ['com.google.firebase:firebase-dynamic-links'],
27+
'firestore' : ['com.google.firebase:firebase-firestore'],
28+
'functions' : ['com.google.firebase:firebase-functions'],
29+
'installations' : ['com.google.firebase:firebase-installations'],
30+
'invites' : ['com.google.firebase:firebase-invites'],
3131
// Messaging has an additional local dependency to include.
32-
'messaging' : ['com.google.firebase:firebase-messaging:23.0.5',
32+
'messaging' : ['com.google.firebase:firebase-messaging',
3333
'firebase_cpp_sdk.messaging:messaging_java',
3434
'androidx.core:core:1.6.0-alpha03',
3535
'com.google.flatbuffers:flatbuffers-java:1.12.0'],
36-
'performance' : ['com.google.firebase:firebase-perf:20.1.0'],
37-
'remote_config' : ['com.google.firebase:firebase-config:21.1.0'],
38-
'storage' : ['com.google.firebase:firebase-storage:20.0.1'],
36+
'performance' : ['com.google.firebase:firebase-perf'],
37+
'remote_config' : ['com.google.firebase:firebase-config'],
38+
'storage' : ['com.google.firebase:firebase-storage'],
3939
'testlab' : []
4040
]
4141

@@ -149,6 +149,10 @@ project.afterEvaluate {
149149
firebaseCpp.dependencies.libSet.add('play_services')
150150
}
151151

152+
// Add the bill-of-materials
153+
project.dependencies {
154+
implementation platform('com.google.firebase:firebase-bom:30.1.0')
155+
}
152156
for (String lib : firebaseCpp.dependencies.libSet) {
153157
// Generate and include the proguard file
154158
generateAndAddProguard(lib)
@@ -166,4 +170,5 @@ project.afterEvaluate {
166170
}
167171
}
168172
}
173+
169174
}

admob/admob_resources/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ android {
4545
}
4646

4747
dependencies {
48-
implementation 'com.google.firebase:firebase-analytics:21.0.0'
48+
implementation platform('com.google.firebase:firebase-bom:30.1.0')
49+
implementation 'com.google.firebase:firebase-analytics'
4950
implementation 'com.google.firebase:firebase-ads:19.8.0'
5051
}
5152

app/app_resources/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ android {
5050
}
5151

5252
dependencies {
53-
implementation 'com.google.firebase:firebase-analytics:21.0.0'
53+
implementation platform('com.google.firebase:firebase-bom:30.1.0')
54+
implementation 'com.google.firebase:firebase-analytics'
5455
}
5556

5657
afterEvaluate {

app/google_api_resources/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ android {
5353
}
5454

5555
dependencies {
56-
implementation 'com.google.firebase:firebase-analytics:21.0.0'
56+
implementation platform('com.google.firebase:firebase-bom:30.1.0')
57+
implementation 'com.google.firebase:firebase-analytics'
5758
implementation 'com.google.android.gms:play-services-base:18.0.1'
5859
implementation project(':app:app_resources')
5960
}

app/integration_test/build.gradle

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

7777
apply from: "$gradle.firebase_cpp_sdk_dir/Android/firebase_dependencies.gradle"
7878
firebaseCpp.dependencies {
79-
app
79+
appWithoutPlayServices
8080
}
8181

8282
apply plugin: 'com.google.gms.google-services'

app/invites_resources/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ android {
4949
}
5050

5151
dependencies {
52-
implementation 'com.google.firebase:firebase-analytics:21.0.0'
53-
implementation 'com.google.firebase:firebase-dynamic-links:21.0.1'
52+
implementation platform('com.google.firebase:firebase-bom:30.1.0')
53+
implementation 'com.google.firebase:firebase-analytics'
54+
implementation 'com.google.firebase:firebase-dynamic-links'
5455
implementation project(':app:app_resources')
5556
}
5657

app/src/filesystem_desktop_linux.cc

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ bool Mkdir(const std::string& path, std::string* out_error) {
7272
return true;
7373
}
7474

75+
bool PathExists(const std::string& path) {
76+
struct stat sb;
77+
78+
return (stat(path.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode));
79+
}
80+
7581
} // namespace
7682

7783
std::string AppDataDir(const char* app_name, bool should_create,
@@ -93,14 +99,18 @@ std::string AppDataDir(const char* app_name, bool should_create,
9399
app_dir = std::string(".local/share/") + app_name;
94100
}
95101

96-
if (should_create) {
97-
std::string current_path = home;
98-
for (const std::string& nested_dir : SplitString(app_dir, '/')) {
99-
current_path += '/';
102+
std::string full_path = home + '/' + app_dir;
103+
if (should_create && !PathExists(full_path)) {
104+
std::string current_path = full_path[0] == '/' ? "/" : "";
105+
106+
for (const std::string& nested_dir : SplitString(full_path, '/')) {
100107
current_path += nested_dir;
101108

102-
bool created = Mkdir(current_path, out_error);
103-
if (!created) return "";
109+
if (!PathExists(current_path)) {
110+
bool created = Mkdir(current_path, out_error);
111+
if (!created) return "";
112+
}
113+
current_path += '/';
104114
}
105115
}
106116

auth/auth_resources/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ android {
4949
}
5050

5151
dependencies {
52-
implementation 'com.google.firebase:firebase-analytics:21.0.0'
53-
implementation 'com.google.firebase:firebase-auth:21.0.5'
52+
implementation platform('com.google.firebase:firebase-bom:30.1.0')
53+
implementation 'com.google.firebase:firebase-analytics'
54+
implementation 'com.google.firebase:firebase-auth'
5455
implementation project(':app:app_resources')
5556
}
5657

database/database_resources/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ android {
4545
}
4646

4747
dependencies {
48-
implementation 'com.google.firebase:firebase-analytics:21.0.0'
49-
implementation 'com.google.firebase:firebase-database:20.0.5'
48+
implementation platform('com.google.firebase:firebase-bom:30.1.0')
49+
implementation 'com.google.firebase:firebase-analytics'
50+
implementation 'com.google.firebase:firebase-database'
5051
//implementation project(':app:app_resources')
5152
}
5253

database/src/desktop/core/repo.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,14 @@ void Repo::DeferredInitialization() {
474474
database_path += "/";
475475
database_path += url_domain;
476476

477-
std::string app_data_path = AppDataDir(database_path.c_str());
477+
std::string app_data_path_error;
478+
std::string app_data_path =
479+
AppDataDir(database_path.c_str(),
480+
/* should_create = */ true, &app_data_path_error);
478481
if (app_data_path.empty()) {
479482
logger_->LogError(
480-
"Could not initialize persistence: Unable to find app data "
481-
"directory.");
483+
"Could not initialize persistence: App data directory error: %s",
484+
app_data_path_error.c_str());
482485
return;
483486
}
484487

firestore/firestore_resources/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ android {
5353
}
5454

5555
dependencies {
56-
implementation 'com.google.firebase:firebase-analytics:21.0.0'
57-
implementation 'com.google.firebase:firebase-firestore:24.1.2'
56+
implementation platform('com.google.firebase:firebase-bom:30.1.0')
57+
implementation 'com.google.firebase:firebase-analytics'
58+
implementation 'com.google.firebase:firebase-firestore'
5859
}
5960

6061
afterEvaluate {

messaging/messaging_java/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ android {
5555
}
5656

5757
dependencies {
58-
implementation 'com.google.firebase:firebase-analytics:21.0.0'
59-
implementation 'com.google.firebase:firebase-messaging:23.0.5'
58+
implementation platform('com.google.firebase:firebase-bom:30.1.0')
59+
implementation 'com.google.firebase:firebase-analytics'
60+
implementation 'com.google.firebase:firebase-messaging'
6061
implementation 'com.google.flatbuffers:flatbuffers-java:1.12.0'
6162
}
6263

messaging/src/android/java/com/google/firebase/messaging/cpp/RegistrationIntentService.java

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -66,31 +66,19 @@ public static void writeTokenToInternalStorage(Context context, String token) {
6666
// Write out the buffer length into the first four bytes.
6767
sizeBuffer.order(ByteOrder.LITTLE_ENDIAN);
6868
sizeBuffer.putInt(buffer.length);
69-
FileLock lock = null;
70-
try {
71-
// Acquire lock. This prevents the C++ code from consuming and clearing the file while we
72-
// append to it.
73-
FileOutputStream lockFileStream = context.openFileOutput(MessageWriter.LOCK_FILE, 0);
74-
lock = lockFileStream.getChannel().lock();
7569

76-
FileOutputStream outputStream =
77-
context.openFileOutput(MessageWriter.STORAGE_FILE, Context.MODE_APPEND);
78-
// We send both the buffer length and the buffer itself so that we can potentially process
79-
// more than one event in the case where they get queued up.
70+
try (FileOutputStream lockFileStream = context.openFileOutput(MessageWriter.LOCK_FILE, 0);
71+
// Acquire lock. This prevents the C++ code from consuming and clearing the file while we
72+
// append to it.
73+
FileLock lock = lockFileStream.getChannel().lock();
74+
FileOutputStream outputStream =
75+
context.openFileOutput(MessageWriter.STORAGE_FILE, Context.MODE_APPEND)) {
76+
// We send both the buffer length and the buffer itself so that we can potentially
77+
// process more than one event in the case where they get queued up.
8078
outputStream.write(sizeBuffer.array());
8179
outputStream.write(buffer);
82-
outputStream.close();
8380
} catch (Exception e) {
8481
e.printStackTrace();
85-
} finally {
86-
// Release the lock.
87-
try {
88-
if (lock != null) {
89-
lock.release();
90-
}
91-
} catch (Exception e) {
92-
e.printStackTrace();
93-
}
9482
}
9583
}
9684

messaging/src/ios/messaging.mm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ void NotifyListenerSet(Listener* listener) {
180180
FIREBASE_ASSERT_RETURN(RequestPermissionLastResult(), internal::IsInitialized());
181181

182182
if (RequestPermissionLastResult().status() == kFutureStatusPending) {
183-
LogError("Status is pending. Return the pending future.");
184183
return RequestPermissionLastResult();
185184
}
186185

release_build_files/Android/firebase_dependencies.gradle

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ import org.gradle.util.ConfigureUtil;
1616

1717
// A map of library to the dependencies that need to be added for it.
1818
def firebaseDependenciesMap = [
19-
'app' : ['com.google.firebase:firebase-analytics:21.0.0'],
19+
'app' : ['com.google.firebase:firebase-analytics'],
2020
'play_services' : ['com.google.android.gms:play-services-base:18.0.1'],
2121
'admob' : ['com.google.firebase:firebase-ads:19.8.0',
22-
'com.google.firebase:firebase-analytics:21.0.0'],
23-
'analytics' : ['com.google.firebase:firebase-analytics:21.0.0'],
24-
'auth' : ['com.google.firebase:firebase-auth:21.0.5'],
25-
'database' : ['com.google.firebase:firebase-database:20.0.5'],
26-
'dynamic_links' : ['com.google.firebase:firebase-dynamic-links:21.0.1'],
27-
'firestore' : ['com.google.firebase:firebase-firestore:24.1.2'],
28-
'functions' : ['com.google.firebase:firebase-functions:20.1.0'],
29-
'installations' : ['com.google.firebase:firebase-installations:17.0.1'],
30-
'invites' : ['com.google.firebase:firebase-invites:17.0.0'],
22+
'com.google.firebase:firebase-analytics'],
23+
'analytics' : ['com.google.firebase:firebase-analytics'],
24+
'auth' : ['com.google.firebase:firebase-auth'],
25+
'database' : ['com.google.firebase:firebase-database'],
26+
'dynamic_links' : ['com.google.firebase:firebase-dynamic-links'],
27+
'firestore' : ['com.google.firebase:firebase-firestore'],
28+
'functions' : ['com.google.firebase:firebase-functions'],
29+
'installations' : ['com.google.firebase:firebase-installations'],
30+
'invites' : ['com.google.firebase:firebase-invites'],
3131
// Messaging has an additional local dependency to include.
32-
'messaging' : ['com.google.firebase:firebase-messaging:23.0.5',
32+
'messaging' : ['com.google.firebase:firebase-messaging',
3333
'com.google.firebase.messaging.cpp:firebase_messaging_cpp@aar',
3434
'androidx.core:core:1.6.0-alpha03',
3535
'com.google.flatbuffers:flatbuffers-java:1.12.0'],
36-
'performance' : ['com.google.firebase:firebase-perf:20.1.0'],
37-
'remote_config' : ['com.google.firebase:firebase-config:21.1.0'],
38-
'storage' : ['com.google.firebase:firebase-storage:20.0.1'],
36+
'performance' : ['com.google.firebase:firebase-perf'],
37+
'remote_config' : ['com.google.firebase:firebase-config'],
38+
'storage' : ['com.google.firebase:firebase-storage'],
3939
'testlab' : []
4040
]
4141

@@ -124,6 +124,10 @@ project.afterEvaluate {
124124
firebaseCpp.dependencies.libSet.add('play_services')
125125
}
126126

127+
// Add the bill-of-materials
128+
project.dependencies {
129+
implementation platform('com.google.firebase:firebase-bom:30.1.0')
130+
}
127131
for (String lib : firebaseCpp.dependencies.libSet) {
128132
// Messaging includes an aar, which to be depended on properly requires
129133
// the folder containing it to be added this way.

0 commit comments

Comments
 (0)