Search in sources :

Example 1 with SettingsSpiCall

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);
}
Also used : SystemCurrentTimeProvider(com.google.firebase.crashlytics.internal.common.SystemCurrentTimeProvider) CurrentTimeProvider(com.google.firebase.crashlytics.internal.common.CurrentTimeProvider) SystemCurrentTimeProvider(com.google.firebase.crashlytics.internal.common.SystemCurrentTimeProvider) DefaultSettingsSpiCall(com.google.firebase.crashlytics.internal.settings.network.DefaultSettingsSpiCall) SettingsRequest(com.google.firebase.crashlytics.internal.settings.model.SettingsRequest) SettingsSpiCall(com.google.firebase.crashlytics.internal.settings.network.SettingsSpiCall) DefaultSettingsSpiCall(com.google.firebase.crashlytics.internal.settings.network.DefaultSettingsSpiCall)

Aggregations

CurrentTimeProvider (com.google.firebase.crashlytics.internal.common.CurrentTimeProvider)1 SystemCurrentTimeProvider (com.google.firebase.crashlytics.internal.common.SystemCurrentTimeProvider)1 SettingsRequest (com.google.firebase.crashlytics.internal.settings.model.SettingsRequest)1 DefaultSettingsSpiCall (com.google.firebase.crashlytics.internal.settings.network.DefaultSettingsSpiCall)1 SettingsSpiCall (com.google.firebase.crashlytics.internal.settings.network.SettingsSpiCall)1