use of com.google.firebase.crashlytics.internal.settings.network.SettingsSpiCall in project GreenHouse by utsanjan.
the class SettingsController method create.
public static SettingsController create(Context context, String googleAppId, IdManager idManager, HttpRequestFactory httpRequestFactory, String versionCode, String versionName, String urlEndpoint, DataCollectionArbiter dataCollectionArbiter) {
String installerPackageName = idManager.getInstallerPackageName();
CurrentTimeProvider currentTimeProvider = new SystemCurrentTimeProvider();
SettingsJsonParser settingsJsonParser = new SettingsJsonParser(currentTimeProvider);
CachedSettingsIo cachedSettingsIo = new CachedSettingsIo(context);
String settingsUrl = String.format(Locale.US, SETTINGS_URL_FORMAT, googleAppId);
SettingsSpiCall settingsSpiCall = new DefaultSettingsSpiCall(urlEndpoint, settingsUrl, httpRequestFactory);
String deviceModel = idManager.getModelName();
String osBuildVersion = idManager.getOsBuildVersionString();
String osDisplayVersion = idManager.getOsDisplayVersionString();
String instanceId = CommonUtils.createInstanceIdFrom(CommonUtils.getMappingFileId(context), googleAppId, versionName, versionCode);
int deliveryMechanismId = DeliveryMechanism.determineFrom(installerPackageName).getId();
SettingsRequest settingsRequest = new SettingsRequest(googleAppId, deviceModel, osBuildVersion, osDisplayVersion, idManager, instanceId, versionName, versionCode, deliveryMechanismId);
return new SettingsController(context, settingsRequest, currentTimeProvider, settingsJsonParser, cachedSettingsIo, settingsSpiCall, dataCollectionArbiter);
}
Aggregations