Remove some old unuseful Android logs

This commit is contained in:
Sean Owen 2020-07-22 12:51:41 -05:00
parent 9c181f2de5
commit 07fdff4df7
6 changed files with 4 additions and 24 deletions

View file

@ -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

View file

@ -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());

View file

@ -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;
}

View file

@ -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");
}
}

View file

@ -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;
}

View file

@ -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)) {