Skip to content

Commit 430b35a

Browse files
committed
Hotfix: Fixed an inability to open the file browser
1 parent bd7060d commit 430b35a

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

ADLMIDI-Player/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ android {
1818
applicationId "ru.wohlsoft.adlmidiplayer"
1919
minSdkVersion 14
2020
targetSdkVersion 33
21-
versionCode 1050011
22-
versionName '1.5.0.11'
21+
versionCode 1050012
22+
versionName '1.5.0.12'
2323
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
2424
externalNativeBuild {
2525
cmake {

ADLMIDI-Player/src/main/java/ru/wohlsoft/adlmidiplayer/Player.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -908,8 +908,11 @@ private boolean checkNotificationsPermissions(int requestCode)
908908

909909
private boolean checkFilePermissions(int requestCode)
910910
{
911+
if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN)
912+
return false;
913+
911914
final int grant = PackageManager.PERMISSION_GRANTED;
912-
final String exStorage = Manifest.permission.WRITE_EXTERNAL_STORAGE;
915+
final String exStorage = Manifest.permission.READ_EXTERNAL_STORAGE;
913916

914917
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
915918
return false; /* Has no effect, the manage file storage permission is used instead of this */
@@ -939,6 +942,7 @@ private boolean checkFilePermissions(int requestCode)
939942
"Please, check the External Storage access permission to the application!");
940943
b.setNegativeButton(android.R.string.ok, null);
941944
b.show();
945+
942946
return true;
943947
}
944948
else
@@ -952,9 +956,6 @@ private boolean checkFilePermissions(int requestCode)
952956
}
953957

954958
return true;
955-
// } // if JELLY_BEAN
956-
957-
// return false;
958959
}
959960

960961
public boolean hasManageAppFS()
@@ -988,7 +989,8 @@ public void onClick(DialogInterface dialog, int whichButton)
988989
}
989990

990991
@Override
991-
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
992+
public void onRequestPermissionsResult(int requestCode,
993+
@NonNull String[] permissions,
992994
@NonNull int[] grantResults)
993995
{
994996
super.onRequestPermissionsResult(requestCode, permissions, grantResults);

0 commit comments

Comments
 (0)