From 07fdff4df7647e558c5e4c421b0b5bc05617df2d Mon Sep 17 00:00:00 2001 From: Sean Owen Date: Wed, 22 Jul 2020 12:51:41 -0500 Subject: [PATCH] Remove some old unuseful Android logs --- .../zxing/client/android/CaptureActivityHandler.java | 3 +-- .../google/zxing/client/android/DecodeHandler.java | 11 ++--------- .../zxing/client/android/camera/CameraManager.java | 1 - .../zxing/client/android/camera/PreviewCallback.java | 5 ----- .../zxing/client/android/encode/EncodeActivity.java | 6 +----- .../zxing/client/android/encode/QRCodeEncoder.java | 2 -- 6 files changed, 4 insertions(+), 24 deletions(-) diff --git a/android/src/com/google/zxing/client/android/CaptureActivityHandler.java b/android/src/com/google/zxing/client/android/CaptureActivityHandler.java index 82c147b1b..257c1d25a 100755 --- a/android/src/com/google/zxing/client/android/CaptureActivityHandler.java +++ b/android/src/com/google/zxing/client/android/CaptureActivityHandler.java @@ -93,7 +93,7 @@ public final class CaptureActivityHandler extends Handler { // Mutable copy: barcode = barcode.copy(Bitmap.Config.ARGB_8888, true); } - scaleFactor = bundle.getFloat(DecodeThread.BARCODE_SCALED_FACTOR); + scaleFactor = bundle.getFloat(DecodeThread.BARCODE_SCALED_FACTOR); } activity.handleDecode((Result) message.obj, barcode, scaleFactor); break; @@ -118,7 +118,6 @@ public final class CaptureActivityHandler extends Handler { String browserPackageName = null; if (resolveInfo != null && resolveInfo.activityInfo != null) { browserPackageName = resolveInfo.activityInfo.packageName; - Log.d(TAG, "Using browser in package " + browserPackageName); } // Needed for default Android browser / Chrome only apparently diff --git a/android/src/com/google/zxing/client/android/DecodeHandler.java b/android/src/com/google/zxing/client/android/DecodeHandler.java index 27c49f9ab..23aaa16ed 100644 --- a/android/src/com/google/zxing/client/android/DecodeHandler.java +++ b/android/src/com/google/zxing/client/android/DecodeHandler.java @@ -29,16 +29,12 @@ import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; -import android.util.Log; import java.io.ByteArrayOutputStream; import java.util.Map; -import java.util.concurrent.TimeUnit; final class DecodeHandler extends Handler { - private static final String TAG = DecodeHandler.class.getSimpleName(); - private final CaptureActivity activity; private final MultiFormatReader multiFormatReader; private boolean running = true; @@ -74,7 +70,6 @@ final class DecodeHandler extends Handler { * @param height The height of the preview frame. */ private void decode(byte[] data, int width, int height) { - long start = System.nanoTime(); Result rawResult = null; PlanarYUVLuminanceSource source = activity.getCameraManager().buildLuminanceSource(data, width, height); if (source != null) { @@ -91,12 +86,10 @@ final class DecodeHandler extends Handler { Handler handler = activity.getHandler(); if (rawResult != null) { // Don't log the barcode contents for security. - long end = System.nanoTime(); - Log.d(TAG, "Found barcode in " + TimeUnit.NANOSECONDS.toMillis(end - start) + " ms"); if (handler != null) { Message message = Message.obtain(handler, R.id.decode_succeeded, rawResult); Bundle bundle = new Bundle(); - bundleThumbnail(source, bundle); + bundleThumbnail(source, bundle); message.setData(bundle); message.sendToTarget(); } @@ -113,7 +106,7 @@ final class DecodeHandler extends Handler { int width = source.getThumbnailWidth(); int height = source.getThumbnailHeight(); Bitmap bitmap = Bitmap.createBitmap(pixels, 0, width, width, height, Bitmap.Config.ARGB_8888); - ByteArrayOutputStream out = new ByteArrayOutputStream(); + ByteArrayOutputStream out = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 50, out); bundle.putByteArray(DecodeThread.BARCODE_BITMAP, out.toByteArray()); bundle.putFloat(DecodeThread.BARCODE_SCALED_FACTOR, (float) width / source.getWidth()); 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 5ba9133a1..2774753af 100755 --- a/android/src/com/google/zxing/client/android/camera/CameraManager.java +++ b/android/src/com/google/zxing/client/android/camera/CameraManager.java @@ -227,7 +227,6 @@ 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.d(TAG, "Calculated framing rect: " + framingRect); } return framingRect; } 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 5f82ea95c..2a79fe820 100644 --- a/android/src/com/google/zxing/client/android/camera/PreviewCallback.java +++ b/android/src/com/google/zxing/client/android/camera/PreviewCallback.java @@ -20,13 +20,10 @@ import android.graphics.Point; import android.hardware.Camera; import android.os.Handler; import android.os.Message; -import android.util.Log; @SuppressWarnings("deprecation") // camera APIs final class PreviewCallback implements Camera.PreviewCallback { - private static final String TAG = PreviewCallback.class.getSimpleName(); - private final CameraConfigurationManager configManager; private Handler previewHandler; private int previewMessage; @@ -49,8 +46,6 @@ final class PreviewCallback implements Camera.PreviewCallback { cameraResolution.y, data); message.sendToTarget(); previewHandler = null; - } else { - Log.d(TAG, "Got preview callback, but no handler or resolution available"); } } 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 63c90f66d..5f46fb53c 100755 --- a/android/src/com/google/zxing/client/android/encode/EncodeActivity.java +++ b/android/src/com/google/zxing/client/android/encode/EncodeActivity.java @@ -145,14 +145,10 @@ public final class EncodeActivity extends Activity { return; } File barcodeFile = new File(barcodesRoot, makeBarcodeFileName(contents) + ".png"); - if (!barcodeFile.delete()) { - Log.w(TAG, "Could not delete " + barcodeFile); - // continue anyway - } try (FileOutputStream fos = new FileOutputStream(barcodeFile)) { bitmap.compress(Bitmap.CompressFormat.PNG, 0, fos); } catch (IOException ioe) { - Log.w(TAG, "Couldn't access file " + barcodeFile + " due to " + ioe); + Log.w(TAG, "Couldn't access barcode file", ioe); showErrorMessage(R.string.msg_unmount_usb); return; } 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 6c0897f40..68a985dec 100755 --- a/android/src/com/google/zxing/client/android/encode/QRCodeEncoder.java +++ b/android/src/com/google/zxing/client/android/encode/QRCodeEncoder.java @@ -200,8 +200,6 @@ final class QRCodeEncoder { } catch (IOException ioe) { throw new WriterException(ioe); } - Log.d(TAG, "Encoding share intent content:"); - Log.d(TAG, vcardString); Result result = new Result(vcardString, vcard, null, BarcodeFormat.QR_CODE); ParsedResult parsedResult = ResultParser.parseResult(result); if (!(parsedResult instanceof AddressBookParsedResult)) {