package hh.dejsem.hack;

import android.content.Context;
import android.content.Intent;

import java.io.IOException;

import hh.dejsem.K;
import hh.dejsem.fm.TransferAlert;
import hh.lib.D;

public class HackAlertTest implements Runnable {

	D d;
	Context c;

	HackAlertTest(Context c, D d) {
		this.d = d.klon(this);
		this.c = c;
	}

	@Override
	public void run() {
		c.startActivity(new Intent(c, TransferAlert.class)
				.putExtra(K.ACTION_KEY, K.TRANSFER_DISPLAY_TEST)
				.putExtra(K.TXT_KEY, String.format("plavala husička do kopečka, za ní se koulela piva bečka"))
		);
		try { Thread.sleep(1000); } catch(Exception e) {}

		c.startActivity(new Intent(c, TransferAlert.class)
				.putExtra(K.ACTION_KEY, K.TRANSFER_DISPLAY_TEST)
				.putExtra(K.TXT_KEY, K.testText)
		);
		try { Thread.sleep(1000); } catch(Exception e) {}

		c.startActivity(new Intent(c, TransferAlert.class)
				.putExtra(K.ACTION_KEY, K.TRANSFER_DISPLAY_TEST)
				.putExtra(K.TXT_KEY, d.composeAbendMsg("zkouška ABENDu", new IOException("accept timeout")))
		);
		try { Thread.sleep(1000); } catch(Exception e) {}
	}
}
