diff --git a/firebase-installations/api.txt b/firebase-installations/api.txt index 4e5eb23d352..2024c519fd0 100644 --- a/firebase-installations/api.txt +++ b/firebase-installations/api.txt @@ -93,7 +93,7 @@ package com.google.firebase.installations.remote { public class FirebaseInstallationServiceClient { ctor public FirebaseInstallationServiceClient(@NonNull android.content.Context, @Nullable com.google.firebase.platforminfo.UserAgentPublisher, @Nullable com.google.firebase.heartbeatinfo.HeartBeatInfo); - method @NonNull public com.google.firebase.installations.remote.InstallationResponse createFirebaseInstallation(@NonNull String, @NonNull String, @NonNull String, @NonNull String) throws java.io.IOException; + method @NonNull public com.google.firebase.installations.remote.InstallationResponse createFirebaseInstallation(@NonNull String, @NonNull String, @NonNull String, @NonNull String, @Nullable String) throws java.io.IOException; method @NonNull public void deleteFirebaseInstallation(@NonNull String, @NonNull String, @NonNull String, @NonNull String) throws com.google.firebase.FirebaseException, java.io.IOException; method @NonNull public com.google.firebase.installations.remote.TokenResult generateAuthToken(@NonNull String, @NonNull String, @NonNull String, @NonNull String) throws java.io.IOException; } diff --git a/firebase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallations.java b/firebase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallations.java index 7abd5351ed7..8288d2c205f 100644 --- a/firebase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallations.java +++ b/firebase-installations/src/main/java/com/google/firebase/installations/FirebaseInstallations.java @@ -307,8 +307,8 @@ private final void doRegistrationInternal(boolean forceRefresh) { * been persisted. */ private PersistedInstallationEntry getPrefsWithGeneratedIdMultiProcessSafe() { - CrossProcessLock lock = CrossProcessLock - .acquire(firebaseApp.getApplicationContext(), LOCKFILE_NAME_GENERATE_FID); + CrossProcessLock lock = + CrossProcessLock.acquire(firebaseApp.getApplicationContext(), LOCKFILE_NAME_GENERATE_FID); try { synchronized (lockGenerateFid) { PersistedInstallationEntry prefs = @@ -354,7 +354,8 @@ private PersistedInstallationEntry registerFidWithServer(PersistedInstallationEn /*apiKey= */ firebaseApp.getOptions().getApiKey(), /*fid= */ prefs.getFirebaseInstallationId(), /*projectID= */ firebaseApp.getOptions().getProjectId(), - /*appId= */ getApplicationId()); + /*appId= */ getApplicationId(), + /* migration-header= */ null); switch (response.getResponseCode()) { case OK: diff --git a/firebase-installations/src/main/java/com/google/firebase/installations/remote/FirebaseInstallationServiceClient.java b/firebase-installations/src/main/java/com/google/firebase/installations/remote/FirebaseInstallationServiceClient.java index bb392f9472e..a92dd0ba922 100644 --- a/firebase-installations/src/main/java/com/google/firebase/installations/remote/FirebaseInstallationServiceClient.java +++ b/firebase-installations/src/main/java/com/google/firebase/installations/remote/FirebaseInstallationServiceClient.java @@ -70,6 +70,8 @@ public class FirebaseInstallationServiceClient { private static final String X_ANDROID_PACKAGE_HEADER_KEY = "X-Android-Package"; private static final String X_ANDROID_CERT_HEADER_KEY = "X-Android-Cert"; + private static final String X_ANDROID_IID_MIGRATION_KEY = "x-goog-fis-android-iid-migration-auth"; + private static final int NETWORK_TIMEOUT_MILLIS = 10000; private static final Pattern EXPIRATION_TIMESTAMP_PATTERN = Pattern.compile("[0-9]+s"); @@ -87,10 +89,10 @@ public class FirebaseInstallationServiceClient { public FirebaseInstallationServiceClient( @NonNull Context context, @Nullable UserAgentPublisher publisher, - @Nullable HeartBeatInfo heartBeatInfo) { + @Nullable HeartBeatInfo heartbeatInfo) { this.context = context; this.userAgentPublisher = publisher; - this.heartbeatInfo = heartBeatInfo; + this.heartbeatInfo = heartbeatInfo; } /** @@ -100,6 +102,8 @@ public FirebaseInstallationServiceClient( * @param fid Firebase Installation Identifier * @param projectID Project Id * @param appId the identifier of a Firebase application + * @param iidToken the identifier token of a Firebase application with instance id. It is set to + * null for a FID. * @return {@link InstallationResponse} generated from the response body *