From 50170b5a3a164e45c6ab3adc4405f95e7fcf6010 Mon Sep 17 00:00:00 2001 From: zhongjh <20249019> Date: Thu, 25 Jul 2024 09:01:32 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E9=92=88=E5=AF=B9Android9=E7=9A=84?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E6=9C=BA=E5=9E=8B=E5=A4=84=E7=90=86=E5=BD=95?= =?UTF-8?q?=E5=88=B6=E8=A7=86=E9=A2=91=E5=90=8E=E9=97=AA=E9=80=80=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=202.=20=E9=92=88=E5=AF=B9Android9=E7=9A=84?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zhongjh/albumcamerarecorder/MainActivity.java | 4 +++- .../camera/ui/camera/presenter/BaseCameraVideoPresenter.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/multilibrary/src/main/java/com/zhongjh/albumcamerarecorder/MainActivity.java b/multilibrary/src/main/java/com/zhongjh/albumcamerarecorder/MainActivity.java index c525cbcd..59f7fde6 100644 --- a/multilibrary/src/main/java/com/zhongjh/albumcamerarecorder/MainActivity.java +++ b/multilibrary/src/main/java/com/zhongjh/albumcamerarecorder/MainActivity.java @@ -420,8 +420,10 @@ protected ArrayList getNeedPermissions() { } } } else { - if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { + if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED && + ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { permissions.add(Manifest.permission.READ_EXTERNAL_STORAGE); + permissions.add(Manifest.permission.WRITE_EXTERNAL_STORAGE); } } } diff --git a/multilibrary/src/main/java/com/zhongjh/albumcamerarecorder/camera/ui/camera/presenter/BaseCameraVideoPresenter.java b/multilibrary/src/main/java/com/zhongjh/albumcamerarecorder/camera/ui/camera/presenter/BaseCameraVideoPresenter.java index c59e0818..32b45094 100644 --- a/multilibrary/src/main/java/com/zhongjh/albumcamerarecorder/camera/ui/camera/presenter/BaseCameraVideoPresenter.java +++ b/multilibrary/src/main/java/com/zhongjh/albumcamerarecorder/camera/ui/camera/presenter/BaseCameraVideoPresenter.java @@ -316,7 +316,7 @@ private long getMediaDuration(String filePath) { if (metaData != null) { duration = Long.parseLong(metaData); } - retriever.close(); + retriever.release(); return duration; } catch (Exception exception) { exception.printStackTrace();