<commit_before>package com.gcex;

import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.app.Activity;

import org.haxe.extension.Extension;
import org.haxe.lime.HaxeObject;

import com.amazon.ags.api.AGResponseCallback;
import com.amazon.ags.api.AmazonGamesClient;
import com.amazon.ags.api.AmazonGamesFeature;
import com.amazon.ags.api.AmazonGamesStatus;
import com.amazon.ags.api.AmazonGamesCallback;
import com.amazon.ags.api.RequestResponse;
import com.amazon.ags.api.achievements.GetAchievementsResponse;
import com.amazon.ags.api.achievements.Achievement;
import com.amazon.ags.api.leaderboards.GetPlayerScoreResponse;
import com.amazon.ags.api.overlay.PopUpLocation;
import com.amazon.ags.api.whispersync.GameDataMap;
import com.amazon.ags.api.whispersync.WhispersyncEventListener;
import com.amazon.ags.api.whispersync.model.*;
import com.amazon.ags.constants.LeaderboardFilter;

import java.util.EnumSet;

public class GameCircle extends Extension {
	
	private static final String TAG = "EXTENSION-GAMECIRCLE";
	private static AmazonGamesStatus gamesStatus = AmazonGamesStatus.INITIALIZING;
	private static AmazonGamesClient agsClient = null;
	private static GameDataMap gameDataMap = null;
	private static EnumSet<AmazonGamesFeature> gameFeatures;
	
	//////////////////////////////////////////////////////////////////////
	///////////// INIT
	//////////////////////////////////////////////////////////////////////

	public static void pause() {
		if (agsClient != null) agsClient.release();
	}

	public static void resume() {
		mainActivity.runOnUiThread(new Runnable() {
			public void run() {
				AmazonGamesClient.initialize(mainActivity, new AmazonGamesCallback() {
					@Override
					public void onServiceReady(AmazonGamesClient amazonGamesClient) {
						agsClient = amazonGamesClient;
						Log.i(TAG, "GameCircle: initialize Successful");
					}
					@Override
					public void onServiceNotReady(AmazonGamesStatus reason) {
						switch (reason) { <commit_msg>delay whispersync initialization<commit_after>package com.gcex;

import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.app.Activity;

import org.haxe.extension.Extension;
import org.haxe.lime.HaxeObject;

import com.amazon.ags.api.AGResponseCallback;
import com.amazon.ags.api.AmazonGamesClient;
import com.amazon.ags.api.AmazonGamesFeature;
import com.amazon.ags.api.AmazonGamesStatus;
import com.amazon.ags.api.AmazonGamesCallback;
import com.amazon.ags.api.RequestResponse;
import com.amazon.ags.api.achievements.GetAchievementsResponse;
import com.amazon.ags.api.achievements.Achievement;
import com.amazon.ags.api.leaderboards.GetPlayerScoreResponse;
import com.amazon.ags.api.overlay.PopUpLocation;
import com.amazon.ags.api.whispersync.GameDataMap;
import com.amazon.ags.api.whispersync.WhispersyncEventListener;
import com.amazon.ags.api.whispersync.model.*;
import com.amazon.ags.constants.LeaderboardFilter;

import java.util.EnumSet;

public class GameCircle extends Extension {
	
	private static final String TAG = "EXTENSION-GAMECIRCLE";
	private static AmazonGamesStatus gamesStatus = AmazonGamesStatus.INITIALIZING;
	private static AmazonGamesClient agsClient = null;
	private static GameDataMap gameDataMap = null;
	private static EnumSet<AmazonGamesFeature> gameFeatures;
	private static boolean enableWhispersync = false;
	
	//////////////////////////////////////////////////////////////////////
	///////////// INIT
	//////////////////////////////////////////////////////////////////////

	public static void pause() {
		if (agsClient != null) agsClient.release();
	}

	public static void resume() {
		mainActivity.runOnUiThread(new Runnable() {
			public void run() {
				AmazonGamesClient.initialize(mainActivity, new AmazonGamesCallback() {
					@Override
					public void onServiceReady(AmazonGamesClient amazonGamesClient) {
						agsClient = amazonGamesClient;
						Log.i(TAG, "GameCircle: initialize Successful");
						if(enableWhispersync) {
							gameDataMap = AmazonGamesClient.getWhispersyncClient().getGameData();
						}
					}
					@Override
					public void onServiceNotReady(AmazonGamesStatus reason) {
						switch (reason) { 
{'fraction_non_alphanumeric': 0.1578822973292366, 'fraction_numerical': 0.0, 'mean_word_length': 3.52620320855615, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '125671', 'n_tokens_mistral': 1347, 'n_tokens_neox': 1211, 'n_words': 236}