Skip to content

Commit ee3834d

Browse files
committed
Hotfix: Fixed an inability to open the file browser
1 parent a84367a commit ee3834d

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

OPNMIDI-Player/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ android {
1919
applicationId "ru.wohlsoft.opnmidiplayer"
2020
minSdkVersion 14
2121
targetSdkVersion 33
22-
versionCode 1050010
23-
versionName '1.5.0.10'
22+
versionCode 1050011
23+
versionName '1.5.0.11'
2424
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
2525
externalNativeBuild {
2626
cmake {

OPNMIDI-Player/src/main/java/ru/wohlsoft/opnmidiplayer/Player.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,11 @@ private void checkNotificationsPermissions(int requestCode)
779779

780780
private boolean checkFilePermissions(int requestCode)
781781
{
782+
if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN)
783+
return false;
784+
782785
final int grant = PackageManager.PERMISSION_GRANTED;
783-
final String exStorage = Manifest.permission.WRITE_EXTERNAL_STORAGE;
786+
final String exStorage = Manifest.permission.READ_EXTERNAL_STORAGE;
784787

785788
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
786789
return false; /* Has no effect, the manage file storage permission is used instead of this */
@@ -849,12 +852,15 @@ public void onClick(DialogInterface dialog, int whichButton)
849852
b.show();
850853
return false;
851854
}
855+
852856
return true;
853857
}
854858

855859
@Override
856-
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
857-
@NonNull int[] grantResults) {
860+
public void onRequestPermissionsResult(int requestCode,
861+
@NonNull String[] permissions,
862+
@NonNull int[] grantResults)
863+
{
858864
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
859865

860866
if(grantResults.length == 0)

0 commit comments

Comments
 (0)