@Test public void shouldMigrateOsmMapSettings() { initPrefs("map_sdk_behavior", "osmdroid", "map_basemap_behavior", "openmap_streets"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "osm"); initPrefs("map_sdk_behavior", "osmdroid", "map_basemap_behavior", "openmap_usgs_topo"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "usgs", "usgs_map_style", "topographic"); initPrefs("map_sdk_behavior", "osmdroid", "map_basemap_behavior", "openmap_usgs_sat"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "usgs", "usgs_map_style", "hybrid"); initPrefs("map_sdk_behavior", "osmdroid", "map_basemap_behavior", "openmap_usgs_img"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "usgs", "usgs_map_style", "satellite"); initPrefs("map_sdk_behavior", "osmdroid", "map_basemap_behavior", "openmap_stamen_terrain"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "stamen"); initPrefs("map_sdk_behavior", "osmdroid", "map_basemap_behavior", "openmap_carto_positron"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "carto", "carto_map_style", "positron"); initPrefs("map_sdk_behavior", "osmdroid", "map_basemap_behavior", "openmap_carto_darkmatter"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "carto", "carto_map_style", "dark_matter"); }
public static void migrateSharedPrefs() { migrate(PrefUtils.getSharedPrefs(), MIGRATIONS); migrate(PrefUtils.getAdminSharedPrefs(), ADMIN_MIGRATIONS); }
PrefMigrator { public static void migrateSharedPrefs() { migrate(PrefUtils.getSharedPrefs(), MIGRATIONS); migrate(PrefUtils.getAdminSharedPrefs(), ADMIN_MIGRATIONS); } }
PrefMigrator { public static void migrateSharedPrefs() { migrate(PrefUtils.getSharedPrefs(), MIGRATIONS); migrate(PrefUtils.getAdminSharedPrefs(), ADMIN_MIGRATIONS); } private  PrefMigrator(); }
PrefMigrator { public static void migrateSharedPrefs() { migrate(PrefUtils.getSharedPrefs(), MIGRATIONS); migrate(PrefUtils.getAdminSharedPrefs(), ADMIN_MIGRATIONS); } private  PrefMigrator(); static void migrate(SharedPreferences prefs, Migration... migrations); static void migrateSharedPrefs(); }
PrefMigrator { public static void migrateSharedPrefs() { migrate(PrefUtils.getSharedPrefs(), MIGRATIONS); migrate(PrefUtils.getAdminSharedPrefs(), ADMIN_MIGRATIONS); } private  PrefMigrator(); static void migrate(SharedPreferences prefs, Migration... migrations); static void migrateSharedPrefs();  }