<commit_before>package com.RyanHodin.RPG;

import android.app.backup.BackupAgentHelper;
import android.app.backup.SharedPreferencesBackupHelper;
import android.content.SharedPreferences;

import java.util.ArrayList;

/**
 * Created by Ryan on 7/24/2016.
 */
public class SavefileBackupAgent extends BackupAgentHelper {
	public void onCreate() {
		updateHelper();
	}

	// Updates the helper with the current state of game saves.
	// Used in onCreate and in MainActivity, when new saves are added or removed.
	void updateHelper() {
		SharedPreferences sp=getSharedPreferences(MainActivity.SaveDataFile, 0);
		int n=sp.getInt(MainActivity.SaveDataGameCount, -1);
		ArrayList<String> args=new ArrayList<>(n<1 ? 1 : n); // What files will be backed up
		args.add(MainActivity.SaveDataFile); // Add the savegame data file
		if (n>0) { // If we have any savegames
			for (int i=1; i<=n; ++i) // Add all savegame files
				args.add(MainActivity.SaveGameFilePrefix+i);
		}
		SharedPreferencesBackupHelper helper=new SharedPreferencesBackupHelper(this, args.toArray(new String[args.size()]));
		addHelper("RPG SaveGame backup", helper);
	}
}<commit_msg>Register the default config file with the backup agent<commit_after>package com.RyanHodin.RPG;

import android.app.backup.BackupAgentHelper;
import android.app.backup.SharedPreferencesBackupHelper;
import android.content.SharedPreferences;

import java.util.ArrayList;

/**
 * Created by Ryan on 7/24/2016.
 */
public class SavefileBackupAgent extends BackupAgentHelper {
	public void onCreate() {
		updateHelper();
	}

	// Updates the helper with the current state of game saves.
	// Used in onCreate and in MainActivity, when new saves are added or removed.
	void updateHelper() {
		SharedPreferences sp=getSharedPreferences(MainActivity.SaveDataFile, 0);
		int n=sp.getInt(MainActivity.SaveDataGameCount, -1);
		ArrayList<String> args=new ArrayList<>(n<1 ? 1 : n); // What files will be backed up
		args.add(MainActivity.SaveDataFile); // Add the savegame data file
		args.add(Cconfig.DefaultConfigFile); // Add the default config data file
		if (n>0) { // If we have any savegames
			for (int i=1; i<=n; ++i) // Add all savegame files
				args.add(MainActivity.SaveGameFilePrefix+i);
		}
		SharedPreferencesBackupHelper helper=new SharedPreferencesBackupHelper(this, args.toArray(new String[args.size()]));
		addHelper("RPG SaveGame backup", helper);
	}
}
{'fraction_non_alphanumeric': 0.10782681099084096, 'fraction_numerical': 0.010824313072439634, 'mean_word_length': 4.846715328467154, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3313459', 'n_tokens_mistral': 760, 'n_tokens_neox': 717, 'n_words': 211}