@Test public void shouldMigrateMapboxMapSettings() { initPrefs("map_sdk_behavior", "mapbox_maps", "map_basemap_behavior", "mapbox_streets"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "mapbox", "mapbox_map_style", Style.MAPBOX_STREETS); initPrefs("map_sdk_behavior", "mapbox_maps", "map_basemap_behavior", "mapbox_light"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "mapbox", "mapbox_map_style", Style.LIGHT); initPrefs("map_sdk_behavior", "mapbox_maps", "map_basemap_behavior", "mapbox_dark"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "mapbox", "mapbox_map_style", Style.DARK); initPrefs("map_sdk_behavior", "mapbox_maps", "map_basemap_behavior", "mapbox_satellite"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "mapbox", "mapbox_map_style", Style.SATELLITE); initPrefs("map_sdk_behavior", "mapbox_maps", "map_basemap_behavior", "mapbox_satellite_streets"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "mapbox", "mapbox_map_style", Style.SATELLITE_STREETS); initPrefs("map_sdk_behavior", "mapbox_maps", "map_basemap_behavior", "mapbox_outdoors"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "mapbox", "mapbox_map_style", Style.OUTDOORS); }
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();  }