Search in sources :

Example 1 with SystemCurrentTimeProvider

use of com.google.firebase.crashlytics.internal.common.SystemCurrentTimeProvider in project firebase-android-sdk by firebase.

the class SettingsController method create.

public static SettingsController create(Context context, String googleAppId, IdManager idManager, HttpRequestFactory httpRequestFactory, String versionCode, String versionName, FileStore fileStore, DataCollectionArbiter dataCollectionArbiter) {
    final String installerPackageName = idManager.getInstallerPackageName();
    final CurrentTimeProvider currentTimeProvider = new SystemCurrentTimeProvider();
    final SettingsJsonParser settingsJsonParser = new SettingsJsonParser(currentTimeProvider);
    final CachedSettingsIo cachedSettingsIo = new CachedSettingsIo(fileStore);
    final String settingsUrl = String.format(Locale.US, SETTINGS_URL_FORMAT, googleAppId);
    final SettingsSpiCall settingsSpiCall = new DefaultSettingsSpiCall(settingsUrl, httpRequestFactory);
    final String deviceModel = idManager.getModelName();
    final String osBuildVersion = idManager.getOsBuildVersionString();
    final String osDisplayVersion = idManager.getOsDisplayVersionString();
    final String instanceId = CommonUtils.createInstanceIdFrom(CommonUtils.getMappingFileId(context), googleAppId, versionName, versionCode);
    final int deliveryMechanismId = DeliveryMechanism.determineFrom(installerPackageName).getId();
    final 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) SuppressLint(android.annotation.SuppressLint)

Example 2 with SystemCurrentTimeProvider

use of com.google.firebase.crashlytics.internal.common.SystemCurrentTimeProvider 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)2 SystemCurrentTimeProvider (com.google.firebase.crashlytics.internal.common.SystemCurrentTimeProvider)2 SuppressLint (android.annotation.SuppressLint)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