Skip to content

Commit 95a17c7

Browse files
committed
Fixed native reflection warnings in #84
1 parent db6c74e commit 95a17c7

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

.github/AAR Source (Android)/java/com/yasirkula/unity/FileBrowser.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,21 @@ public static String GetExternalDrives( Context context )
108108
}
109109

110110
// This is the only working method on some Android 11+ devices (when Storage Access Framework isn't used)
111-
if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N )
111+
if( android.os.Build.VERSION.SDK_INT >= 30 )
112+
{
113+
for( StorageVolume volume : ( (StorageManager) context.getSystemService( Context.STORAGE_SERVICE ) ).getStorageVolumes() )
114+
{
115+
File volumeDirectory = volume.getDirectory();
116+
if( volumeDirectory != null )
117+
potentialDrives.add( volumeDirectory.toString() );
118+
}
119+
}
120+
else if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N )
112121
{
113122
try
114123
{
115124
Method getPath = StorageVolume.class.getMethod( "getPath" );
116-
StorageManager storageManager = (StorageManager) context.getSystemService( Context.STORAGE_SERVICE );
117-
for( StorageVolume volume : storageManager.getStorageVolumes() )
125+
for( StorageVolume volume : ( (StorageManager) context.getSystemService( Context.STORAGE_SERVICE ) ).getStorageVolumes() )
118126
potentialDrives.add( (String) getPath.invoke( volume ) );
119127
}
120128
catch( Exception e )
Binary file not shown.

Plugins/SimpleFileBrowser/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= Simple File Browser (v1.6.0) =
1+
= Simple File Browser (v1.6.1) =
22

33
Online documentation & example code available at: https://github.com/yasirkula/UnitySimpleFileBrowser
44

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.yasirkula.simplefilebrowser",
33
"displayName": "Simple File Browser",
4-
"version": "1.6.0",
4+
"version": "1.6.1",
55
"documentationUrl": "https://github.com/yasirkula/UnitySimpleFileBrowser",
66
"changelogUrl": "https://github.com/yasirkula/UnitySimpleFileBrowser/releases",
77
"licensesUrl": "https://github.com/yasirkula/UnitySimpleFileBrowser/blob/master/LICENSE.txt",

0 commit comments

Comments
 (0)