<commit_before>package dt.call.aclient.background.async;

import android.os.AsyncTask;

import dt.call.aclient.CallState;
import dt.call.aclient.Const;
import dt.call.aclient.Utils;
import dt.call.aclient.Vars;

/**
 * Created by Daniel on 2/7/16.
 * Mostly copied and pasted from CallRejectAsync
 */
public class CallTimeoutAsync extends AsyncTask<String, String, Boolean>
{
	private static final String tag = "CallTimeoutAsync";

	@Override
	protected Boolean doInBackground(String... params)
	{

		boolean result;
		try
		{
			String involved = Vars.callWith.getName();
			String timeoutResp = Const.JBYTE + Utils.generateServerTimestamp() + "|timeout|" + involved + "|" + Vars.sessionid;
			Vars.commandSocket.getOutputStream().write(timeoutResp.getBytes());
			result = true;
		}
		catch (Exception e)
		{
			Utils.dumpException(tag, e);
			result = false;
		}

		//set the state information because a reject will not get a reply/response from the server
		//what could the server possibly say that would be meaningful...?? "no you can't reject"
		Vars.callWith = Const.nobody;
		Vars.state = CallState.NONE;
		return result;
	}
}<commit_msg>Don't forget to set the notification back to green/idle and not still in call when a call timeout happens.<commit_after>package dt.call.aclient.background.async;

import android.os.AsyncTask;

import dt.call.aclient.CallState;
import dt.call.aclient.Const;
import dt.call.aclient.R;
import dt.call.aclient.Utils;
import dt.call.aclient.Vars;

/**
 * Created by Daniel on 2/7/16.
 * Mostly copied and pasted from CallRejectAsync
 */
public class CallTimeoutAsync extends AsyncTask<String, String, Boolean>
{
	private static final String tag = "CallTimeoutAsync";

	@Override
	protected Boolean doInBackground(String... params)
	{

		boolean result;
		try
		{
			String involved = Vars.callWith.getName();
			String timeoutResp = Const.JBYTE + Utils.generateServerTimestamp() + "|timeout|" + involved + "|" + Vars.sessionid;
			Vars.commandSocket.getOutputStream().write(timeoutResp.getBytes());
			result = true;
		}
		catch (Exception e)
		{
			Utils.dumpException(tag, e);
			result = false;
		}

		//set the state information because a reject will not get a reply/response from the server
		//what could the server possibly say that would be meaningful...?? "no you can't reject"
		Vars.callWith = Const.nobody;
		Vars.state = CallState.NONE;

		Utils.setNotification(R.string.state_popup_idle, R.color.material_green, Vars.go2HomePending);
		return result;
	}
}
{'fraction_non_alphanumeric': 0.10991636798088411, 'fraction_numerical': 0.0035842293906810036, 'mean_word_length': 4.105691056910569, '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': '5530046', 'n_tokens_mistral': 831, 'n_tokens_neox': 773, 'n_words': 221}