Skip to content

Commit

Permalink
1. 针对Android9的一些机型处理录制视频后闪退的问题
Browse files Browse the repository at this point in the history
2. 针对Android9的存储权限问题处理
  • Loading branch information
zhongjh committed Jul 25, 2024
1 parent 8dce986 commit 50170b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,10 @@ protected ArrayList<String> 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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 50170b5

Please sign in to comment.