File tree Expand file tree Collapse file tree
.github/AAR Source (Android)/java/com/yasirkula/unity
Plugins/SimpleFileBrowser Expand file tree Collapse file tree Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change 1- = Simple File Browser (v1.6.0 ) =
1+ = Simple File Browser (v1.6.1 ) =
22
33Online documentation & example code available at: https://github.com/yasirkula/UnitySimpleFileBrowser
44E-mail: yasirkula@gmail.com
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments