<commit_before>package com.menny.android.anysoftkeyboard;

import java.lang.reflect.Field;

public class Workarounds 
{
	//Determine whether this device has the fix for RTL in the suggestions list
	private static final boolean ms_requiresRtlWorkaround;
	
	private static final boolean ms_isDonut;
	private static final boolean ms_isEclair;
	
	static
	{
		boolean requiresRtlWorkaround = true;//all devices required this fix (in 1.6 it is still required)
		
		if (android.os.Build.MODEL.toLowerCase().contains("galaxy"))
		{
			//(see issue 132):
			try
			{
				//no fix: 1251851795000
				//fix: 1251970876000
				//no fix: 1251851795000
				//fix: 1251970876000
				//fix: 1261367883000
//				final int buildInc = Integer.parseInt(android.os.Build.VERSION.INCREMENTAL);
//				requiresRtlWorkaround = (buildInc < 20090831);
				requiresRtlWorkaround =  (android.os.Build.TIME <= 1251851795000l);
				
			}
			catch(Exception ex)
			{
				requiresRtlWorkaround = true;//if it is like that, then I do not know, and rather say WORKAROUND!
			}
		}
		ms_requiresRtlWorkaround = requiresRtlWorkaround;
		//checking f/w API is a bit tricky, we need to do it by reflection
		boolean isDonut = false;
		boolean isEclair = false;
		try
		{
			Field sdkInt = android.os.Build.VERSION.class.getField("SDK_INT");
			if (sdkInt != null)
			{
				//NOTE: I can not use the field here, since this code MAY run in cupcake, and therefore
				//fail in JIT compile. I need to perform this function with reflection...
				isDonut = (sdkInt.getInt(null) >= 4);
				isEclair = (sdkInt.getInt(null) >= 5);
			}
		}
		catch(Exception ex)
		{
		}
		ms_isDonut = isDonut;
		ms_isEclair = isEclair;
	}
	
	public static boolean isRightToLeftCharacter(final char key)
	{
    	final byte direction = Character.getDirectionality(key);<commit_msg>Issue 285: Samsung Spica has the fix<commit_after>package com.menny.android.anysoftkeyboard;

import java.lang.reflect.Field;

public class Workarounds 
{
	//Determine whether this device has the fix for RTL in the suggestions list
	private static final boolean ms_requiresRtlWorkaround;
	
	private static final boolean ms_isDonut;
	private static final boolean ms_isEclair;
	
	static
	{
		boolean requiresRtlWorkaround = true;//all devices required this fix (in 1.6 it is still required)
		
		if (android.os.Build.MODEL.toLowerCase().contains("galaxy"))
		{
			//see issue 132
			//and issue 285
			//no fix: 1251851795000
			//fix: 1251970876000
			//no fix: 1251851795000
			//fix: 1251970876000
			//fix: 1261367883000
//			//final int buildInc = Integer.parseInt(android.os.Build.VERSION.INCREMENTAL);
//			//requiresRtlWorkaround = (buildInc < 20090831);
			requiresRtlWorkaround =  (android.os.Build.TIME <= 1251851795000l);
		}
		else if (android.os.Build.MODEL.toLowerCase().contains("spica"))
		{
			//(see issue 285):
			//fix: 1263807011000
			requiresRtlWorkaround =  (android.os.Build.TIME < 1263807011000l);
		}
		ms_requiresRtlWorkaround = requiresRtlWorkaround;
		//checking f/w API is a bit tricky, we need to do it by reflection
		boolean isDonut = false;
		boolean isEclair = false;
		try
		{
			Field sdkInt = android.os.Build.VERSION.class.getField("SDK_INT");
			if (sdkInt != null)
			{
				//NOTE: I can not use the field here, since this code MAY run in cupcake, and therefore
				//fail in JIT compile. I need to perform this function with reflection...
				isDonut = (sdkInt.getInt(null) >= 4);
				isEclair = (sdkInt.getInt(null) >= 5);
			}
		}
		catch(Exception ex)
		{
		}
		ms_isDonut = isDonut;
		ms_isEclair = isEclair;
	}
	
	public static boolean isRightToLeftCharacter(final char key)
	{
    	final byte direction = Character.getDirectionality(key);
{'fraction_non_alphanumeric': 0.10045908722657305, 'fraction_numerical': 0.05968133945449636, 'mean_word_length': 3.420047732696897, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 7, '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': '3431195', 'n_tokens_mistral': 1570, 'n_tokens_neox': 1217, 'n_words': 349}