Skip to content

Commit

Permalink
Fixed native reflection warnings in #84
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirkula committed Aug 17, 2023
1 parent db6c74e commit 95a17c7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,21 @@ public static String GetExternalDrives( Context context )
}

// This is the only working method on some Android 11+ devices (when Storage Access Framework isn't used)
if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N )
if( android.os.Build.VERSION.SDK_INT >= 30 )
{
for( StorageVolume volume : ( (StorageManager) context.getSystemService( Context.STORAGE_SERVICE ) ).getStorageVolumes() )
{
File volumeDirectory = volume.getDirectory();
if( volumeDirectory != null )
potentialDrives.add( volumeDirectory.toString() );
}
}
else if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N )
{
try
{
Method getPath = StorageVolume.class.getMethod( "getPath" );
StorageManager storageManager = (StorageManager) context.getSystemService( Context.STORAGE_SERVICE );
for( StorageVolume volume : storageManager.getStorageVolumes() )
for( StorageVolume volume : ( (StorageManager) context.getSystemService( Context.STORAGE_SERVICE ) ).getStorageVolumes() )
potentialDrives.add( (String) getPath.invoke( volume ) );
}
catch( Exception e )
Expand Down
Binary file modified Plugins/SimpleFileBrowser/Android/SimpleFileBrowser.aar
Binary file not shown.
2 changes: 1 addition & 1 deletion Plugins/SimpleFileBrowser/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= Simple File Browser (v1.6.0) =
= Simple File Browser (v1.6.1) =

Online documentation & example code available at: https://github.com/yasirkula/UnitySimpleFileBrowser
E-mail: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.yasirkula.simplefilebrowser",
"displayName": "Simple File Browser",
"version": "1.6.0",
"version": "1.6.1",
"documentationUrl": "https://github.com/yasirkula/UnitySimpleFileBrowser",
"changelogUrl": "https://github.com/yasirkula/UnitySimpleFileBrowser/releases",
"licensesUrl": "https://github.com/yasirkula/UnitySimpleFileBrowser/blob/master/LICENSE.txt",
Expand Down

0 comments on commit 95a17c7

Please sign in to comment.