File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
firebase-installations/src/main/java/com/google/firebase/installations Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -307,8 +307,8 @@ private final void doRegistrationInternal(boolean forceRefresh) {
307
307
* been persisted.
308
308
*/
309
309
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 );
312
312
try {
313
313
synchronized (lockGenerateFid ) {
314
314
PersistedInstallationEntry prefs =
Original file line number Diff line number Diff line change @@ -68,14 +68,14 @@ private static String getDefaultSenderId(FirebaseApp app) {
68
68
return senderId ;
69
69
}
70
70
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
73
73
return appId ;
74
74
}
75
75
// For v1 app IDs, fall back to parsing the project number out
76
76
@ SuppressWarnings ("StringSplitter" )
77
77
String [] parts = appId .split (":" );
78
- if (parts .length < 2 ) {
78
+ if (parts .length != 4 ) {
79
79
return null ; // Invalid format
80
80
}
81
81
String projectNumber = parts [1 ];
You can’t perform that action at this time.
0 commit comments