use of com.google.firebase.crashlytics.internal.settings.model.FeaturesSettingsData in project GreenHouse by utsanjan.
the class SettingsV3JsonTransform method buildFromJson.
// com.google.firebase.crashlytics.internal.settings.SettingsJsonTransform
@Override
public SettingsData buildFromJson(CurrentTimeProvider currentTimeProvider, JSONObject json) throws JSONException {
int settingsVersion = json.optInt("settings_version", 0);
int cacheDuration = json.optInt("cache_duration", 3600);
AppSettingsData appData = buildAppDataFrom(json.getJSONObject("fabric"), json.getJSONObject("app"));
SessionSettingsData sessionData = defaultSessionData();
FeaturesSettingsData featureData = buildFeaturesSessionDataFrom(json.getJSONObject("features"));
long expiresAtMillis = getExpiresAtFrom(currentTimeProvider, cacheDuration, json);
return new SettingsData(expiresAtMillis, appData, sessionData, featureData, settingsVersion, cacheDuration);
}
use of com.google.firebase.crashlytics.internal.settings.model.FeaturesSettingsData 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);
}
Aggregations