@Test public void saveLegacyConfigsIfNecessary_hasNoLegacyConfigs_doesNotWriteToCacheClients() { assertWithMessage("Did not save legacy configs!") .that(legacyConfigsHandler.saveLegacyConfigsIfNecessary()) .isTrue(); verifyNoWritesToAnyClient(); }
@WorkerThread public boolean saveLegacyConfigsIfNecessary() { if (legacySettings.getBoolean(SAVE_LEGACY_CONFIGS_FLAG_NAME, true)) { saveLegacyConfigs(getConvertedLegacyConfigs()); legacySettings.edit().putBoolean(SAVE_LEGACY_CONFIGS_FLAG_NAME, false).commit(); return true; } return false; }
LegacyConfigsHandler { @WorkerThread public boolean saveLegacyConfigsIfNecessary() { if (legacySettings.getBoolean(SAVE_LEGACY_CONFIGS_FLAG_NAME, true)) { saveLegacyConfigs(getConvertedLegacyConfigs()); legacySettings.edit().putBoolean(SAVE_LEGACY_CONFIGS_FLAG_NAME, false).commit(); return true; } return false; } }
LegacyConfigsHandler { @WorkerThread public boolean saveLegacyConfigsIfNecessary() { if (legacySettings.getBoolean(SAVE_LEGACY_CONFIGS_FLAG_NAME, true)) { saveLegacyConfigs(getConvertedLegacyConfigs()); legacySettings.edit().putBoolean(SAVE_LEGACY_CONFIGS_FLAG_NAME, false).commit(); return true; } return false; } LegacyConfigsHandler(Context context, String appId); }
LegacyConfigsHandler { @WorkerThread public boolean saveLegacyConfigsIfNecessary() { if (legacySettings.getBoolean(SAVE_LEGACY_CONFIGS_FLAG_NAME, true)) { saveLegacyConfigs(getConvertedLegacyConfigs()); legacySettings.edit().putBoolean(SAVE_LEGACY_CONFIGS_FLAG_NAME, false).commit(); return true; } return false; } LegacyConfigsHandler(Context context, String appId); @WorkerThread boolean saveLegacyConfigsIfNecessary(); }
LegacyConfigsHandler { @WorkerThread public boolean saveLegacyConfigsIfNecessary() { if (legacySettings.getBoolean(SAVE_LEGACY_CONFIGS_FLAG_NAME, true)) { saveLegacyConfigs(getConvertedLegacyConfigs()); legacySettings.edit().putBoolean(SAVE_LEGACY_CONFIGS_FLAG_NAME, false).commit(); return true; } return false; } LegacyConfigsHandler(Context context, String appId); @WorkerThread boolean saveLegacyConfigsIfNecessary(); @VisibleForTesting static final String EXPERIMENT_ID_KEY; @VisibleForTesting static final String EXPERIMENT_VARIANT_ID_KEY; @VisibleForTesting static final String EXPERIMENT_START_TIME_KEY; @VisibleForTesting static final String EXPERIMENT_TRIGGER_EVENT_KEY; @VisibleForTesting
  static final String EXPERIMENT_TRIGGER_TIMEOUT_KEY; @VisibleForTesting static final String EXPERIMENT_TIME_TO_LIVE_KEY; }