Stopped sending the decode duration in a message, which no one was looking at, and logged it instead.

git-svn-id: https://zxing.googlecode.com/svn/trunk@943 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
dswitkin 2009-05-21 16:02:24 +00:00
parent c9d3eae171
commit c8d74f359f

View file

@ -22,6 +22,7 @@ import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.os.Message; import android.os.Message;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.util.Log;
import com.google.zxing.BarcodeFormat; import com.google.zxing.BarcodeFormat;
import com.google.zxing.DecodeHintType; import com.google.zxing.DecodeHintType;
import com.google.zxing.MultiFormatReader; import com.google.zxing.MultiFormatReader;
@ -37,6 +38,7 @@ import java.util.Vector;
final class DecodeThread extends Thread { final class DecodeThread extends Thread {
public static final String BARCODE_BITMAP = "barcode_bitmap"; public static final String BARCODE_BITMAP = "barcode_bitmap";
private static final String TAG = "DecodeThread";
public Handler mHandler; public Handler mHandler;
private final CaptureActivity mActivity; private final CaptureActivity mActivity;
@ -168,15 +170,14 @@ final class DecodeThread extends Thread {
long end = System.currentTimeMillis(); long end = System.currentTimeMillis();
if (success) { if (success) {
Log.v(TAG, "Found barcode (" + (end - start) + " ms):\n" + rawResult.toString());
Message message = Message.obtain(mActivity.mHandler, R.id.decode_succeeded, rawResult); Message message = Message.obtain(mActivity.mHandler, R.id.decode_succeeded, rawResult);
message.arg1 = (int) (end - start);
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putParcelable(BARCODE_BITMAP, source.renderToBitmap()); bundle.putParcelable(BARCODE_BITMAP, source.renderToBitmap());
message.setData(bundle); message.setData(bundle);
message.sendToTarget(); message.sendToTarget();
} else { } else {
Message message = Message.obtain(mActivity.mHandler, R.id.decode_failed); Message message = Message.obtain(mActivity.mHandler, R.id.decode_failed);
message.arg1 = (int) (end - start);
message.sendToTarget(); message.sendToTarget();
} }
} }