@Test public void shouldMigrateGoogleMapSettings() { initPrefs("map_sdk_behavior", "google_maps", "map_basemap_behavior", "streets"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "google", "google_map_style", String.valueOf(GoogleMap.MAP_TYPE_NORMAL)); initPrefs("map_sdk_behavior", "google_maps", "map_basemap_behavior", "satellite"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "google", "google_map_style", String.valueOf(GoogleMap.MAP_TYPE_SATELLITE)); initPrefs("map_sdk_behavior", "google_maps", "map_basemap_behavior", "terrain\u200e"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "google", "google_map_style", String.valueOf(GoogleMap.MAP_TYPE_TERRAIN)); initPrefs("map_sdk_behavior", "google_maps", "map_basemap_behavior", "hybrid"); PrefMigrator.migrateSharedPrefs(); assertPrefs("basemap_source", "google", "google_map_style", String.valueOf(GoogleMap.MAP_TYPE_HYBRID)); }
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();  }