Search in sources :

Example 6 with SessionSettingsData

use of com.google.firebase.crashlytics.internal.settings.model.SessionSettingsData in project firebase-android-sdk by firebase.

the class CrashlyticsReportPersistenceTest method getSettingsMock.

private static SettingsDataProvider getSettingsMock(int maxCompleteSessionsCount, int maxCustomExceptionEvents) {
    SettingsDataProvider settingsDataProvider = mock(SettingsDataProvider.class);
    Settings settingsMock = mock(Settings.class);
    SessionSettingsData sessionSettingsDataMock = new SessionSettingsData(maxCustomExceptionEvents, maxCompleteSessionsCount);
    when(settingsMock.getSessionData()).thenReturn(sessionSettingsDataMock);
    when(settingsDataProvider.getSettings()).thenReturn(settingsMock);
    return settingsDataProvider;
}
Also used : SessionSettingsData(com.google.firebase.crashlytics.internal.settings.model.SessionSettingsData) SettingsDataProvider(com.google.firebase.crashlytics.internal.settings.SettingsDataProvider) Settings(com.google.firebase.crashlytics.internal.settings.model.Settings)

Example 7 with SessionSettingsData

use of com.google.firebase.crashlytics.internal.settings.model.SessionSettingsData in project firebase-android-sdk by firebase.

the class DefaultSettingsJsonTransform method buildFromJson.

@Override
public SettingsData buildFromJson(CurrentTimeProvider currentTimeProvider, JSONObject json) throws JSONException {
    final int settingsVersion = json.optInt(SettingsJsonConstants.SETTINGS_VERSION, SettingsJsonConstants.SETTINGS_VERSION_DEFAULT);
    final int cacheDuration = json.optInt(SettingsJsonConstants.CACHE_DURATION_KEY, SettingsJsonConstants.SETTINGS_CACHE_DURATION_DEFAULT);
    final AppSettingsData appData = buildAppDataFrom(json.getJSONObject(SettingsJsonConstants.APP_KEY));
    final SessionSettingsData settingsData = buildSessionDataFrom(json.getJSONObject(SettingsJsonConstants.SESSION_KEY));
    final FeaturesSettingsData featureData = buildFeaturesSessionDataFrom(json.getJSONObject(SettingsJsonConstants.FEATURES_KEY));
    final long expiresAtMillis = getExpiresAtFrom(currentTimeProvider, cacheDuration, json);
    return new SettingsData(expiresAtMillis, appData, settingsData, featureData, settingsVersion, cacheDuration);
}
Also used : AppSettingsData(com.google.firebase.crashlytics.internal.settings.model.AppSettingsData) AppSettingsData(com.google.firebase.crashlytics.internal.settings.model.AppSettingsData) SessionSettingsData(com.google.firebase.crashlytics.internal.settings.model.SessionSettingsData) FeaturesSettingsData(com.google.firebase.crashlytics.internal.settings.model.FeaturesSettingsData) SettingsData(com.google.firebase.crashlytics.internal.settings.model.SettingsData) SessionSettingsData(com.google.firebase.crashlytics.internal.settings.model.SessionSettingsData) FeaturesSettingsData(com.google.firebase.crashlytics.internal.settings.model.FeaturesSettingsData)

Aggregations

SessionSettingsData (com.google.firebase.crashlytics.internal.settings.model.SessionSettingsData)7 AppSettingsData (com.google.firebase.crashlytics.internal.settings.model.AppSettingsData)6 FeaturesSettingsData (com.google.firebase.crashlytics.internal.settings.model.FeaturesSettingsData)6 SettingsData (com.google.firebase.crashlytics.internal.settings.model.SettingsData)6 JSONObject (org.json.JSONObject)2 SettingsDataProvider (com.google.firebase.crashlytics.internal.settings.SettingsDataProvider)1 Settings (com.google.firebase.crashlytics.internal.settings.model.Settings)1