Skip to content

Commit 84e1716

Browse files
committed
Addressing Rayo's comments
1 parent e22c3ca commit 84e1716

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

firebase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallations.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,8 @@ private final void doRegistrationInternal(boolean forceRefresh) {
307307
* been persisted.
308308
*/
309309
private PersistedInstallationEntry getPrefsWithGeneratedIdMultiProcessSafe() {
310-
CrossProcessLock lock = CrossProcessLock
311-
.acquire(firebaseApp.getApplicationContext(), LOCKFILE_NAME_GENERATE_FID);
310+
CrossProcessLock lock =
311+
CrossProcessLock.acquire(firebaseApp.getApplicationContext(), LOCKFILE_NAME_GENERATE_FID);
312312
try {
313313
synchronized (lockGenerateFid) {
314314
PersistedInstallationEntry prefs =

firebase-installations/src/main/java/com/google/firebase/installations/local/IidStore.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ private static String getDefaultSenderId(FirebaseApp app) {
6868
return senderId;
6969
}
7070
String appId = app.getOptions().getApplicationId();
71-
if (!appId.startsWith("1:")) {
72-
// Not v1, server should be updated to accept the full app ID now
71+
if (!appId.startsWith("1:") && !appId.startsWith("2:")) {
72+
// If applicationId does not contain a (GMP-)App-ID, it contains a Sender identifier
7373
return appId;
7474
}
7575
// For v1 app IDs, fall back to parsing the project number out
7676
@SuppressWarnings("StringSplitter")
7777
String[] parts = appId.split(":");
78-
if (parts.length < 2) {
78+
if (parts.length != 4) {
7979
return null; // Invalid format
8080
}
8181
String projectNumber = parts[1];

0 commit comments

Comments
 (0)