// Path: informaCam/src/main/java/org/witness/informacam/utils/Constants.java
// public interface SuckerCacheListener {
// 	public void onUpdate(long timestamp, ILogPack ILogPack);
// 	public long onUpdate(ILogPack ILogPack);
// }
// 
// Path: informaCam/src/main/java/org/witness/informacam/utils/Constants.java
// public final static class CaptureEvent {
// 	public final static int METADATA_CAPTURED = 272;
// 	public final static int MEDIA_OPENED = 273;
// 	public final static int REGION_GENERATED = 274;
// 	public final static int MEDIA_SAVED = 275;
// 	public final static int SENSOR_PLAYBACK = 271;
// 	public final static int TIMESTAMPS_RESOLVED= 270;
// 	public final static int FORM_EDITED = 269;
// 			
// 			
// 	public final static class Keys {
// 		public final static String USER_ACTION = "userActionReported";
// 		public final static String TYPE = "captureTypes";
// 		public final static String MATCH_TIMESTAMP = "captureEventMatchTimestamp";
// 		public final static String TIMESTAMP = "captureEventTimestamp";
// 		public final static String ON_VIDEO_START = "timestampOnVideoStart";
// 		public final static String MEDIA_CAPTURE_COMPLETE = "mediaCapturedComplete";
// 		public final static String METADATA_CAPTURED = "metadataCaptured";
// 		public final static String REGION_LOCATION_DATA = "regionLocationData";
// 	}
// }


import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import org.witness.informacam.json.JSONArray;
import org.witness.informacam.json.JSONException;
import org.witness.informacam.json.JSONObject;
import org.witness.informacam.models.j3m.ILogPack;
import org.witness.informacam.utils.Constants.SuckerCacheListener;
import org.witness.informacam.utils.Constants.Suckers.CaptureEvent;
import android.content.Context;
		
		if(_sucker.getClass().getDeclaredMethod("forceReturn", args) != null) {
			Method fr = _sucker.getClass().getDeclaredMethod("forceReturn", args);
			
			ILogPack logPack = (ILogPack) fr.invoke(_sucker, args);
			if(logPack.captureTypes == null) {
				logPack.captureTypes = new ArrayList<Integer>();
			}
			logPack.captureTypes.add(CaptureEvent.SENSOR_PLAYBACK);
			
			return logPack;
		}
		
		return null;
	}

	public void sendToBuffer(final ILogPack logPack) {
		new Thread(new Runnable() {
			@Override
			public void run() {
				try {
					if(logPack.captureTypes == null) {
						logPack.captureTypes = new ArrayList<Integer>();
					}
					logPack.captureTypes.add(CaptureEvent.SENSOR_PLAYBACK);
					if (mSuckerCacheListener != null) {
						mSuckerCacheListener.onUpdate(logPack);
					}
					
					//((SuckerCacheListener) informaCam.informaService).onUpdate(logPack);
// Path: informaCam/src/main/java/org/witness/informacam/utils/Constants.java
// public interface SuckerCacheListener {
// 	public void onUpdate(long timestamp, ILogPack ILogPack);
// 	public long onUpdate(ILogPack ILogPack);
// }
// 
// Path: informaCam/src/main/java/org/witness/informacam/utils/Constants.java
// public final static class CaptureEvent {
// 	public final static int METADATA_CAPTURED = 272;
// 	public final static int MEDIA_OPENED = 273;
// 	public final static int REGION_GENERATED = 274;
// 	public final static int MEDIA_SAVED = 275;
// 	public final static int SENSOR_PLAYBACK = 271;
// 	public final static int TIMESTAMPS_RESOLVED= 270;
// 	public final static int FORM_EDITED = 269;
// 			
// 			
// 	public final static class Keys {
// 		public final static String USER_ACTION = "userActionReported";
// 		public final static String TYPE = "captureTypes";
// 		public final static String MATCH_TIMESTAMP = "captureEventMatchTimestamp";
// 		public final static String TIMESTAMP = "captureEventTimestamp";
// 		public final static String ON_VIDEO_START = "timestampOnVideoStart";
// 		public final static String MEDIA_CAPTURE_COMPLETE = "mediaCapturedComplete";
// 		public final static String METADATA_CAPTURED = "metadataCaptured";
// 		public final static String REGION_LOCATION_DATA = "regionLocationData";
// 	}
// }


// Path: informaCam/src/main/java/org/witness/informacam/informa/SensorLogger.java
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import org.witness.informacam.json.JSONArray;
import org.witness.informacam.json.JSONException;
import org.witness.informacam.json.JSONObject;
import org.witness.informacam.models.j3m.ILogPack;
import org.witness.informacam.utils.Constants.SuckerCacheListener;
import org.witness.informacam.utils.Constants.Suckers.CaptureEvent;
import android.content.Context;

		
		if(_sucker.getClass().getDeclaredMethod("forceReturn", args) != null) {
			Method fr = _sucker.getClass().getDeclaredMethod("forceReturn", args);
			
			ILogPack logPack = (ILogPack) fr.invoke(_sucker, args);
			if(logPack.captureTypes == null) {
				logPack.captureTypes = new ArrayList<Integer>();
			}
			logPack.captureTypes.add(CaptureEvent.SENSOR_PLAYBACK);
			
			return logPack;
		}
		
		return null;
	}

	public void sendToBuffer(final ILogPack logPack) {
		new Thread(new Runnable() {
			@Override
			public void run() {
				try {
					if(logPack.captureTypes == null) {
						logPack.captureTypes = new ArrayList<Integer>();
					}
					logPack.captureTypes.add(CaptureEvent.SENSOR_PLAYBACK);
					if (mSuckerCacheListener != null) {
						mSuckerCacheListener.onUpdate(logPack);
					}
					
					//((SuckerCacheListener) informaCam.informaService).onUpdate(logPack);
				} catch(NullPointerException e) {}