diff --git a/android/src/com/google/zxing/client/android/CaptureActivity.java b/android/src/com/google/zxing/client/android/CaptureActivity.java index 6b583240b..e6f6de81e 100755 --- a/android/src/com/google/zxing/client/android/CaptureActivity.java +++ b/android/src/com/google/zxing/client/android/CaptureActivity.java @@ -672,7 +672,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal } catch (RuntimeException e) { // Barcode Scanner has seen crashes in the wild of this variety: // java.?lang.?RuntimeException: Fail to connect to camera service - Log.e(TAG, e.toString()); + Log.w(TAG, "Unexpected error initializating camera", e); displayFrameworkBugMessageAndExit(); return; } diff --git a/android/src/com/google/zxing/client/android/CaptureActivityHandler.java b/android/src/com/google/zxing/client/android/CaptureActivityHandler.java index b93af4fac..0507fbe0b 100755 --- a/android/src/com/google/zxing/client/android/CaptureActivityHandler.java +++ b/android/src/com/google/zxing/client/android/CaptureActivityHandler.java @@ -71,7 +71,7 @@ public final class CaptureActivityHandler extends Handler { public void handleMessage(Message message) { switch (message.what) { case R.id.auto_focus: - Log.v(TAG, "Got auto-focus message"); + //Log.d(TAG, "Got auto-focus message"); // When one auto focus pass finishes, start another. This is the closest thing to // continuous AF. It does seem to hunt a bit, but I'm not sure what else to do. if (state == State.PREVIEW) { @@ -79,11 +79,11 @@ public final class CaptureActivityHandler extends Handler { } break; case R.id.restart_preview: - Log.v(TAG, "Got restart preview message"); + Log.d(TAG, "Got restart preview message"); restartPreviewAndDecode(); break; case R.id.decode_succeeded: - Log.v(TAG, "Got decode succeeded message"); + Log.d(TAG, "Got decode succeeded message"); state = State.SUCCESS; Bundle bundle = message.getData(); Bitmap barcode = bundle == null ? null : (Bitmap) bundle.getParcelable(DecodeThread.BARCODE_BITMAP); @@ -95,12 +95,12 @@ public final class CaptureActivityHandler extends Handler { CameraManager.get().requestPreviewFrame(decodeThread.getHandler(), R.id.decode); break; case R.id.return_scan_result: - Log.v(TAG, "Got return scan result message"); + Log.d(TAG, "Got return scan result message"); activity.setResult(Activity.RESULT_OK, (Intent) message.obj); activity.finish(); break; case R.id.launch_product_query: - Log.v(TAG, "Got product query message"); + Log.d(TAG, "Got product query message"); String url = (String) message.obj; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); diff --git a/android/src/com/google/zxing/client/android/DecodeHandler.java b/android/src/com/google/zxing/client/android/DecodeHandler.java index 52fe14f85..c7f8e7265 100644 --- a/android/src/com/google/zxing/client/android/DecodeHandler.java +++ b/android/src/com/google/zxing/client/android/DecodeHandler.java @@ -49,7 +49,7 @@ final class DecodeHandler extends Handler { public void handleMessage(Message message) { switch (message.what) { case R.id.decode: - Log.v(TAG, "Got decode message"); + //Log.d(TAG, "Got decode message"); decode((byte[]) message.obj, message.arg1, message.arg2); break; case R.id.quit: @@ -81,12 +81,12 @@ final class DecodeHandler extends Handler { if (rawResult != null) { long end = System.currentTimeMillis(); - Log.v(TAG, "Found barcode (" + (end - start) + " ms):\n" + rawResult.toString()); + Log.d(TAG, "Found barcode (" + (end - start) + " ms):\n" + rawResult.toString()); Message message = Message.obtain(activity.getHandler(), R.id.decode_succeeded, rawResult); Bundle bundle = new Bundle(); bundle.putParcelable(DecodeThread.BARCODE_BITMAP, source.renderCroppedGreyscaleBitmap()); message.setData(bundle); - Log.v(TAG, "Sending decode succeeded message..."); + //Log.d(TAG, "Sending decode succeeded message..."); message.sendToTarget(); } else { Message message = Message.obtain(activity.getHandler(), R.id.decode_failed); diff --git a/android/src/com/google/zxing/client/android/book/SearchBookContentsActivity.java b/android/src/com/google/zxing/client/android/book/SearchBookContentsActivity.java index cc8e80ce9..1bfecc240 100644 --- a/android/src/com/google/zxing/client/android/book/SearchBookContentsActivity.java +++ b/android/src/com/google/zxing/client/android/book/SearchBookContentsActivity.java @@ -209,7 +209,7 @@ public final class SearchBookContentsActivity extends Activity { resultListView.setAdapter(null); } } catch (JSONException e) { - Log.e(TAG, e.toString()); + Log.w(TAG, "Bad JSON from book search", e); resultListView.setAdapter(null); headerView.setText(R.string.msg_sbc_failed); } @@ -291,12 +291,12 @@ public final class SearchBookContentsActivity extends Activity { message.obj = json; message.sendToTarget(); } else { - Log.e(TAG, "HTTP returned " + response.getStatusLine().getStatusCode() + " for " + uri); + Log.w(TAG, "HTTP returned " + response.getStatusLine().getStatusCode() + " for " + uri); Message message = Message.obtain(handler, R.id.search_book_contents_failed); message.sendToTarget(); } } catch (Exception e) { - Log.e(TAG, e.toString()); + Log.w(TAG, "Error accessing book search", e); Message message = Message.obtain(handler, R.id.search_book_contents_failed); message.sendToTarget(); } finally { @@ -312,7 +312,7 @@ public final class SearchBookContentsActivity extends Activity { private static String getCookie(String url) { String cookie = CookieManager.getInstance().getCookie(url); if (cookie == null || cookie.length() == 0) { - Log.v(TAG, "Book Search cookie was missing or expired"); + Log.d(TAG, "Book Search cookie was missing or expired"); HttpUriRequest head = new HttpHead(url); AndroidHttpClient client = AndroidHttpClient.newInstance(USER_AGENT); try { @@ -326,7 +326,7 @@ public final class SearchBookContentsActivity extends Activity { cookie = CookieManager.getInstance().getCookie(url); } } catch (IOException e) { - Log.e(TAG, e.toString()); + Log.w(TAG, "Error setting book search cookie", e); } client.close(); } diff --git a/android/src/com/google/zxing/client/android/camera/AutoFocusCallback.java b/android/src/com/google/zxing/client/android/camera/AutoFocusCallback.java index 2af5f4d63..629290a21 100644 --- a/android/src/com/google/zxing/client/android/camera/AutoFocusCallback.java +++ b/android/src/com/google/zxing/client/android/camera/AutoFocusCallback.java @@ -46,7 +46,7 @@ final class AutoFocusCallback implements Camera.AutoFocusCallback { Message message = autoFocusHandler.obtainMessage(autoFocusMessage, success); // Simulate continuous autofocus by sending a focus request every // AUTOFOCUS_INTERVAL_MS milliseconds. - Log.v(TAG, "Got auto-focus callback; requesting another"); + //Log.d(TAG, "Got auto-focus callback; requesting another"); autoFocusHandler.sendMessageDelayed(message, AUTOFOCUS_INTERVAL_MS); autoFocusHandler = null; if (!reinitCamera) { @@ -54,7 +54,7 @@ final class AutoFocusCallback implements Camera.AutoFocusCallback { configManager.setDesiredCameraParameters(camera); } } else { - Log.v(TAG, "Got auto-focus callback, but no handler for it"); + Log.d(TAG, "Got auto-focus callback, but no handler for it"); } } diff --git a/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java b/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java index c22a4d787..d0257ca54 100644 --- a/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java +++ b/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java @@ -52,13 +52,13 @@ final class CameraConfigurationManager { Camera.Parameters parameters = camera.getParameters(); previewFormat = parameters.getPreviewFormat(); previewFormatString = parameters.get("preview-format"); - Log.v(TAG, "Default preview format: " + previewFormat + '/' + previewFormatString); + Log.d(TAG, "Default preview format: " + previewFormat + '/' + previewFormatString); WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); Display display = manager.getDefaultDisplay(); screenResolution = new Point(display.getWidth(), display.getHeight()); - Log.v(TAG, "Screen resolution: " + screenResolution); + Log.d(TAG, "Screen resolution: " + screenResolution); cameraResolution = getCameraResolution(parameters, screenResolution); - Log.v(TAG, "Camera resolution: " + screenResolution); + Log.d(TAG, "Camera resolution: " + screenResolution); } /** @@ -69,7 +69,7 @@ final class CameraConfigurationManager { */ void setDesiredCameraParameters(Camera camera) { Camera.Parameters parameters = camera.getParameters(); - Log.v(TAG, "Setting preview size: " + cameraResolution); + Log.d(TAG, "Setting preview size: " + cameraResolution); parameters.setPreviewSize(cameraResolution.x, cameraResolution.y); setFlash(parameters); setZoom(parameters); @@ -104,7 +104,7 @@ final class CameraConfigurationManager { Point cameraResolution = null; if (previewSizeValueString != null) { - Log.v(TAG, "preview-size-values parameter: " + previewSizeValueString); + Log.d(TAG, "preview-size-values parameter: " + previewSizeValueString); cameraResolution = findBestPreviewSizeValue(previewSizeValueString, screenResolution); } diff --git a/android/src/com/google/zxing/client/android/camera/CameraManager.java b/android/src/com/google/zxing/client/android/camera/CameraManager.java index 1acf00ec8..81605c40f 100755 --- a/android/src/com/google/zxing/client/android/camera/CameraManager.java +++ b/android/src/com/google/zxing/client/android/camera/CameraManager.java @@ -192,7 +192,7 @@ public final class CameraManager { public void requestAutoFocus(Handler handler, int message) { if (camera != null && previewing) { autoFocusCallback.setHandler(handler, message); - Log.v(TAG, "Requesting auto-focus callback"); + //Log.d(TAG, "Requesting auto-focus callback"); camera.autoFocus(autoFocusCallback); } } @@ -225,7 +225,7 @@ public final class CameraManager { int leftOffset = (screenResolution.x - width) / 2; int topOffset = (screenResolution.y - height) / 2; framingRect = new Rect(leftOffset, topOffset, leftOffset + width, topOffset + height); - Log.v(TAG, "Calculated framing rect: " + framingRect); + Log.d(TAG, "Calculated framing rect: " + framingRect); } return framingRect; } diff --git a/android/src/com/google/zxing/client/android/camera/FlashlightManager.java b/android/src/com/google/zxing/client/android/camera/FlashlightManager.java index 44459d19c..547d98d67 100644 --- a/android/src/com/google/zxing/client/android/camera/FlashlightManager.java +++ b/android/src/com/google/zxing/client/android/camera/FlashlightManager.java @@ -44,9 +44,9 @@ final class FlashlightManager { iHardwareService = getHardwareService(); setFlashEnabledMethod = getSetFlashEnabledMethod(iHardwareService); if (iHardwareService == null) { - Log.i(TAG, "This device does supports control of a flashlight"); + Log.v(TAG, "This device does supports control of a flashlight"); } else { - Log.i(TAG, "This device does not support control of a flashlight"); + Log.v(TAG, "This device does not support control of a flashlight"); } } diff --git a/android/src/com/google/zxing/client/android/camera/PreviewCallback.java b/android/src/com/google/zxing/client/android/camera/PreviewCallback.java index 0e68dd628..9dfd348b9 100644 --- a/android/src/com/google/zxing/client/android/camera/PreviewCallback.java +++ b/android/src/com/google/zxing/client/android/camera/PreviewCallback.java @@ -52,7 +52,7 @@ final class PreviewCallback implements Camera.PreviewCallback { message.sendToTarget(); previewHandler = null; } else { - Log.v(TAG, "Got preview callback, but no handler for it"); + Log.d(TAG, "Got preview callback, but no handler for it"); } } diff --git a/android/src/com/google/zxing/client/android/encode/EncodeActivity.java b/android/src/com/google/zxing/client/android/encode/EncodeActivity.java index 4e9013418..b4b3f963b 100755 --- a/android/src/com/google/zxing/client/android/encode/EncodeActivity.java +++ b/android/src/com/google/zxing/client/android/encode/EncodeActivity.java @@ -161,14 +161,14 @@ public final class EncodeActivity extends Activity { bitmap = QRCodeEncoder.encodeAsBitmap(contents, BarcodeFormat.QR_CODE, SHARE_BARCODE_DIMENSION, SHARE_BARCODE_DIMENSION); } catch (WriterException we) { - Log.w(TAG, we.toString()); + Log.w(TAG, we); return true; } File bsRoot = new File(Environment.getExternalStorageDirectory(), "BarcodeScanner"); File barcodesRoot = new File(bsRoot, "Barcodes"); if (!barcodesRoot.exists() && !barcodesRoot.mkdirs()) { - Log.v(TAG, "Couldn't make dir " + barcodesRoot); + Log.w(TAG, "Couldn't make dir " + barcodesRoot); showErrorMessage(R.string.msg_unmount_usb); return true; } @@ -179,7 +179,7 @@ public final class EncodeActivity extends Activity { fos = new FileOutputStream(barcodeFile); bitmap.compress(Bitmap.CompressFormat.PNG, 0, fos); } catch (FileNotFoundException fnfe) { - Log.v(TAG, "Couldn't access file " + barcodeFile + " due to " + fnfe); + Log.w(TAG, "Couldn't access file " + barcodeFile + " due to " + fnfe); showErrorMessage(R.string.msg_unmount_usb); return true; } finally { diff --git a/android/src/com/google/zxing/client/android/encode/QRCodeEncoder.java b/android/src/com/google/zxing/client/android/encode/QRCodeEncoder.java index 41f3c5b11..358795d32 100755 --- a/android/src/com/google/zxing/client/android/encode/QRCodeEncoder.java +++ b/android/src/com/google/zxing/client/android/encode/QRCodeEncoder.java @@ -351,11 +351,11 @@ final class QRCodeEncoder { message.obj = bitmap; message.sendToTarget(); } catch (WriterException e) { - Log.e(TAG, e.toString()); + Log.e(TAG, "Could not encode barcode", e); Message message = Message.obtain(handler, R.id.encode_failed); message.sendToTarget(); } catch (IllegalArgumentException e) { - Log.e(TAG, e.toString()); + Log.e(TAG, "Could not encode barcode", e); Message message = Message.obtain(handler, R.id.encode_failed); message.sendToTarget(); } diff --git a/android/src/com/google/zxing/client/android/history/HistoryManager.java b/android/src/com/google/zxing/client/android/history/HistoryManager.java index b08c7a7dc..5fe1ed741 100644 --- a/android/src/com/google/zxing/client/android/history/HistoryManager.java +++ b/android/src/com/google/zxing/client/android/history/HistoryManager.java @@ -222,7 +222,7 @@ public final class HistoryManager { File bsRoot = new File(Environment.getExternalStorageDirectory(), "BarcodeScanner"); File historyRoot = new File(bsRoot, "History"); if (!historyRoot.exists() && !historyRoot.mkdirs()) { - Log.v(TAG, "Couldn't make dir " + historyRoot); + Log.w(TAG, "Couldn't make dir " + historyRoot); return null; } File historyFile = new File(historyRoot, "history-" + System.currentTimeMillis() + ".csv"); @@ -232,7 +232,7 @@ public final class HistoryManager { out.write(history); return Uri.parse("file://" + historyFile.getAbsolutePath()); } catch (IOException ioe) { - Log.v(TAG, "Couldn't access file " + historyFile + " due to " + ioe); + Log.w(TAG, "Couldn't access file " + historyFile + " due to " + ioe); return null; } finally { if (out != null) {