统一日志管理
This commit is contained in:
@@ -22,12 +22,12 @@ import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.hardware.Camera;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import android.view.SurfaceHolder;
|
||||
|
||||
import com.google.zxing.PlanarYUVLuminanceSource;
|
||||
import com.king.zxing.camera.open.OpenCamera;
|
||||
import com.king.zxing.camera.open.OpenCameraInterface;
|
||||
import com.king.zxing.util.LogUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -43,8 +43,6 @@ import androidx.annotation.FloatRange;
|
||||
@SuppressWarnings("deprecation") // camera APIs
|
||||
public final class CameraManager {
|
||||
|
||||
private static final String TAG = CameraManager.class.getSimpleName();
|
||||
|
||||
private static final int MIN_FRAME_WIDTH = 240;
|
||||
private static final int MIN_FRAME_HEIGHT = 240;
|
||||
private static final int MAX_FRAME_WIDTH = 1200; // = 5/8 * 1920
|
||||
@@ -117,8 +115,8 @@ public final class CameraManager {
|
||||
configManager.setDesiredCameraParameters(theCamera, false);
|
||||
} catch (RuntimeException re) {
|
||||
// Driver failed
|
||||
Log.w(TAG, "Camera rejected parameters. Setting only minimal safe-mode parameters");
|
||||
Log.i(TAG, "Resetting to saved camera params: " + parametersFlattened);
|
||||
LogUtils.w("Camera rejected parameters. Setting only minimal safe-mode parameters");
|
||||
LogUtils.i( "Resetting to saved camera params: " + parametersFlattened);
|
||||
// Reset:
|
||||
if (parametersFlattened != null) {
|
||||
parameters = cameraObject.getParameters();
|
||||
@@ -128,7 +126,7 @@ public final class CameraManager {
|
||||
configManager.setDesiredCameraParameters(theCamera, true);
|
||||
} catch (RuntimeException re2) {
|
||||
// Well, darn. Give up
|
||||
Log.w(TAG, "Camera rejected even safe-mode parameters! No configuration");
|
||||
LogUtils.w("Camera rejected even safe-mode parameters! No configuration");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -360,7 +358,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.d(TAG, "Calculated manual framing rect: " + framingRect);
|
||||
LogUtils.d( "Calculated manual framing rect: " + framingRect);
|
||||
framingRectInPreview = null;
|
||||
} else {
|
||||
requestedFramingRectWidth = width;
|
||||
|
||||
Reference in New Issue
Block a user