use of com.google.firebase.installations.FirebaseInstallationsApi in project firebase-android-sdk by firebase.
the class IdManagerTest method testGetIdExceptionalCase_doesNotRotateInstallId.
public void testGetIdExceptionalCase_doesNotRotateInstallId() {
FirebaseInstallationsApi fis = mock(FirebaseInstallationsApi.class);
final String expectedInstallId = "expectedInstallId";
when(fis.getId()).thenReturn(Tasks.forException(new TimeoutException("Fetching id timed out.")));
prefs.edit().putString(IdManager.PREFKEY_INSTALLATION_UUID, expectedInstallId).putString(IdManager.PREFKEY_FIREBASE_IID, "firebase-iid").apply();
final IdManager idManager = new IdManager(getContext(), getContext().getPackageName(), fis, MOCK_ARBITER_ENABLED);
final String actualInstallId = idManager.getCrashlyticsInstallId();
assertNotNull(actualInstallId);
assertEquals(expectedInstallId, actualInstallId);
}
use of com.google.firebase.installations.FirebaseInstallationsApi in project firebase-android-sdk by firebase.
the class CrashlyticsRegistrar method buildCrashlytics.
private FirebaseCrashlytics buildCrashlytics(ComponentContainer container) {
FirebaseApp app = container.get(FirebaseApp.class);
Deferred<CrashlyticsNativeComponent> nativeComponent = container.getDeferred(CrashlyticsNativeComponent.class);
Deferred<AnalyticsConnector> analyticsConnector = container.getDeferred(AnalyticsConnector.class);
FirebaseInstallationsApi firebaseInstallations = container.get(FirebaseInstallationsApi.class);
return FirebaseCrashlytics.init(app, firebaseInstallations, nativeComponent, analyticsConnector);
}
Aggregations