From 3c18f8e5f2d54c6cb2e4d2e0e5fc538a6a2ea188 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 13 一月 2025 17:35:03 +0800
Subject: [PATCH] 2025年01月13日17:34:58

---
 app/src/main/java/com/hdl/photovoltaic/ui/device/ScanActivity.java |   66 ++++++++++++++++----------------
 1 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/device/ScanActivity.java b/app/src/main/java/com/hdl/photovoltaic/ui/device/ScanActivity.java
index abecbf3..463ca7d 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/device/ScanActivity.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/device/ScanActivity.java
@@ -253,41 +253,41 @@
     }
 
     private void initCamera(SurfaceHolder surfaceHolder) {
-        PermissionUtils.requestPermissionsResultCallback(this, Manifest.permission.CAMERA, new PermissionUtils.PermissionState() {
-            @Override
-            public void Success(int value) {
-                if (value == PermissionUtils.STATUS_REFUSE_PERMANENT | value == PermissionUtils.STATUS_REFUSE) {
-//                            HdlThreadLogic.toast(_mActivity, R.string.permission_open);
-                    Toast.makeText(ScanActivity.this, R.string.capture_no_camera, Toast.LENGTH_SHORT).show();
-                    return;
-                }
+//        PermissionUtils.requestPermissionsResultCallback(this, Manifest.permission.CAMERA, new PermissionUtils.PermissionState() {
+//            @Override
+//            public void Success(int value) {
+//                if (value == PermissionUtils.STATUS_REFUSE_PERMANENT | value == PermissionUtils.STATUS_REFUSE) {
+////                            HdlThreadLogic.toast(_mActivity, R.string.permission_open);
+//                    Toast.makeText(ScanActivity.this, R.string.capture_no_camera, Toast.LENGTH_SHORT).show();
+//                    return;
+//                }
 
-                if (surfaceHolder == null) {
-                    throw new IllegalStateException("No SurfaceHolder provided");
-                }
-                if (cameraManager.isOpen()) {
-                    Log.w(TAG, "initCamera() while already open -- late SurfaceView callback?");
-                    return;
-                }
-                try {
-                    cameraManager.openDriver(surfaceHolder);
-                    // Creating the handler starts the preview, which can also throw a
-                    // RuntimeException.
-                    if (handler == null) {
-                        handler = new CaptureActivityHandler(ScanActivity.this, cameraManager, DecodeThread.ALL_MODE);
-                    }
-                    initCrop();
-                } catch (IOException ioe) {
-                    Log.w(TAG, ioe);
-                    Toast.makeText(ScanActivity.this, R.string.capture_no_camera, Toast.LENGTH_SHORT).show();
-                    finish();
-                } catch (RuntimeException e) {
-                    Log.w(TAG, "Unexpected error initializing camera", e);
-                    Toast.makeText(ScanActivity.this, R.string.capture_no_camera, Toast.LENGTH_SHORT).show();
-                    finish();
-                }
+        if (surfaceHolder == null) {
+            throw new IllegalStateException("No SurfaceHolder provided");
+        }
+        if (cameraManager.isOpen()) {
+            Log.w(TAG, "initCamera() while already open -- late SurfaceView callback?");
+            return;
+        }
+        try {
+            cameraManager.openDriver(surfaceHolder);
+            // Creating the handler starts the preview, which can also throw a
+            // RuntimeException.
+            if (handler == null) {
+                handler = new CaptureActivityHandler(ScanActivity.this, cameraManager, DecodeThread.ALL_MODE);
             }
-        }, true);
+            initCrop();
+        } catch (IOException ioe) {
+            Log.w(TAG, ioe);
+            Toast.makeText(ScanActivity.this, R.string.capture_no_camera, Toast.LENGTH_SHORT).show();
+            finish();
+        } catch (RuntimeException e) {
+            Log.w(TAG, "Unexpected error initializing camera", e);
+            Toast.makeText(ScanActivity.this, R.string.capture_no_camera, Toast.LENGTH_SHORT).show();
+            finish();
+        }
+//            }
+//        }, true);
     }
 
     public void restartPreviewAfterDelay(long delayMS) {

--
Gitblit v1.8.0