// Path: mobile/src/main/java/io/ashdavies/eternity/Config.java
// public interface Config extends Logger.Preparable {
// 
//   boolean favouriteEnabled();
// 
//   boolean repostEnabled();
// 
//   interface State {
// 
//     boolean invalidated();
// 
//     void invalidate();
// 
//     void reset();
//   }
// }
// 
// Path: mobile/src/main/java/io/ashdavies/eternity/Logger.java
// public interface Logger {
// 
//   void log(String message);
// 
//   void error(Throwable throwable, Object... args);
// 
//   interface Preparable {
// 
//     void prepare(Logger logger);
//   }
// }


import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings;
import io.ashdavies.eternity.BuildConfig;
import io.ashdavies.eternity.Config;
import io.ashdavies.eternity.Logger;
import io.ashdavies.eternity.R;
import io.ashdavies.rx.rxtasks.RxTasks;
import java.util.concurrent.TimeUnit;
package io.ashdavies.eternity.firebase;


class FirebaseConfig implements Config {

  private static final long CACHE_EXPIRATION_IN_SECONDS = TimeUnit.HOURS.toMillis(1);

  private static final String OPTION_FAVOURITE_ENABLED = "favourite_enabled";
  private static final String OPTION_REPOST_ENABLED = "repost_enabled";

  private final FirebaseRemoteConfig firebase;
  private final Config.State state;

  private FirebaseConfig(FirebaseRemoteConfig firebase, Config.State state) {
    this.firebase = firebase;
    this.state = state;
  }

  static FirebaseConfig newInstance(Config.State state) {
    FirebaseRemoteConfig firebase = FirebaseRemoteConfig.getInstance();

    firebase.setConfigSettings(buildSettings());
    firebase.setDefaults(R.xml.remote_config_defaults);

    return new FirebaseConfig(firebase, state);
  }

  private static FirebaseRemoteConfigSettings buildSettings() {
    return new FirebaseRemoteConfigSettings.Builder()
        .setDeveloperModeEnabled(BuildConfig.DEBUG)
        .build();
  }

  @Override
// Path: mobile/src/main/java/io/ashdavies/eternity/Config.java
// public interface Config extends Logger.Preparable {
// 
//   boolean favouriteEnabled();
// 
//   boolean repostEnabled();
// 
//   interface State {
// 
//     boolean invalidated();
// 
//     void invalidate();
// 
//     void reset();
//   }
// }
// 
// Path: mobile/src/main/java/io/ashdavies/eternity/Logger.java
// public interface Logger {
// 
//   void log(String message);
// 
//   void error(Throwable throwable, Object... args);
// 
//   interface Preparable {
// 
//     void prepare(Logger logger);
//   }
// }


// Path: mobile/src/main/java/io/ashdavies/eternity/firebase/FirebaseConfig.java
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings;
import io.ashdavies.eternity.BuildConfig;
import io.ashdavies.eternity.Config;
import io.ashdavies.eternity.Logger;
import io.ashdavies.eternity.R;
import io.ashdavies.rx.rxtasks.RxTasks;
import java.util.concurrent.TimeUnit;

package io.ashdavies.eternity.firebase;


class FirebaseConfig implements Config {

  private static final long CACHE_EXPIRATION_IN_SECONDS = TimeUnit.HOURS.toMillis(1);

  private static final String OPTION_FAVOURITE_ENABLED = "favourite_enabled";
  private static final String OPTION_REPOST_ENABLED = "repost_enabled";

  private final FirebaseRemoteConfig firebase;
  private final Config.State state;

  private FirebaseConfig(FirebaseRemoteConfig firebase, Config.State state) {
    this.firebase = firebase;
    this.state = state;
  }

  static FirebaseConfig newInstance(Config.State state) {
    FirebaseRemoteConfig firebase = FirebaseRemoteConfig.getInstance();

    firebase.setConfigSettings(buildSettings());
    firebase.setDefaults(R.xml.remote_config_defaults);

    return new FirebaseConfig(firebase, state);
  }

  private static FirebaseRemoteConfigSettings buildSettings() {
    return new FirebaseRemoteConfigSettings.Builder()
        .setDeveloperModeEnabled(BuildConfig.DEBUG)
        .build();
  }

  @Override
  public void prepare(Logger logger) {