Skip to content

Commit

Permalink
Hotfix: Fixed an inability to open the file browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Wohlstand committed Jul 3, 2023
1 parent a84367a commit ee3834d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions OPNMIDI-Player/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ android {
applicationId "ru.wohlsoft.opnmidiplayer"
minSdkVersion 14
targetSdkVersion 33
versionCode 1050010
versionName '1.5.0.10'
versionCode 1050011
versionName '1.5.0.11'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
externalNativeBuild {
cmake {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,11 @@ private void checkNotificationsPermissions(int requestCode)

private boolean checkFilePermissions(int requestCode)
{
if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN)
return false;

final int grant = PackageManager.PERMISSION_GRANTED;
final String exStorage = Manifest.permission.WRITE_EXTERNAL_STORAGE;
final String exStorage = Manifest.permission.READ_EXTERNAL_STORAGE;

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
return false; /* Has no effect, the manage file storage permission is used instead of this */
Expand Down Expand Up @@ -849,12 +852,15 @@ public void onClick(DialogInterface dialog, int whichButton)
b.show();
return false;
}

return true;
}

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
public void onRequestPermissionsResult(int requestCode,
@NonNull String[] permissions,
@NonNull int[] grantResults)
{
super.onRequestPermissionsResult(requestCode, permissions, grantResults);

if(grantResults.length == 0)
Expand Down

0 comments on commit ee3834d

Please sign in to comment.