<div dir="ltr"><div><div><div>Actually I did it the opposite way.<br><br></div>This method was used with Arrays.asList() conversion<br><br></div>So I changed it to return the ArrayList directly and avoid two-ways conversion.<br><br>Check the android mailing list.<br><br></div>Anyway thanks for checking this part of code, it was really ugly.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 25, 2014 at 3:20 PM, Andrey Khalyavin <span dir="ltr"><<a href="mailto:halyavin@google.com" target="_blank">halyavin@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Could you commit the patch for me (I am not a contributor)?<br>
<span class=""><br>
2014-11-25 16:41 GMT+03:00 Geoffrey Métais <<a href="mailto:geoffrey.metais@gmail.com">geoffrey.metais@gmail.com</a>>:<br>
> LGTM.<br>
><br>
> But you should have mailed it to <a href="mailto:android@videolan.org">android@videolan.org</a> instead ;)<br>
</span>I didn't found this information on the wiki. Will take into account<br>
the next time.<br>
<div class="HOEnZb"><div class="h5"><br>
With best regards,<br>
Andrey Khalyavin<br>
><br>
> On Tue, Nov 25, 2014 at 2:24 PM, Andrey Khalyavin <<a href="mailto:halyavin@google.com">halyavin@google.com</a>><br>
> wrote:<br>
>><br>
>> This patch makes code nicer and getStorageDirectories() does not<br>
>> return null on exception any more.<br>
>><br>
>> With best regards,<br>
>><br>
>> Andrey Khalyavin<br>
>><br>
>> From 1fb0f9d19fbefbf30e8019a47a3b241c5fe1f6b0 Mon Sep 17 00:00:00 2001<br>
>> From: Andrey Khalyavin <<a href="mailto:halyavin@google.com">halyavin@google.com</a>><br>
>> Date: Tue, 25 Nov 2014 15:31:43 +0300<br>
>> Subject: [PATCH] Do not return null on exception in<br>
>>  AndroidDevices.getStorageDirectories().<br>
>><br>
>> ---<br>
>>  vlc-android/src/org/videolan/vlc/util/AndroidDevices.java | 8 +-------<br>
>>  1 file changed, 1 insertion(+), 7 deletions(-)<br>
>><br>
>> diff --git a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java<br>
>> b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java<br>
>> index d71f55f..ae8f473 100644<br>
>> --- a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java<br>
>> +++ b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java<br>
>> @@ -88,7 +88,6 @@ public class AndroidDevices {<br>
>>      }<br>
>><br>
>>      public static String[] getStorageDirectories() {<br>
>> -        String[] dirs = null;<br>
>>          BufferedReader bufReader = null;<br>
>>          ArrayList<String> list = new ArrayList<String>();<br>
>>          list.add(Environment.getExternalStorageDirectory().getPath());<br>
>> @@ -127,11 +126,6 @@ public class AndroidDevices {<br>
>>                  if (Strings.StartsWith(deviceWL, device) &&<br>
>> (typeWL.contains(type) || Strings.StartsWith(mountWL, mountpoint)))<br>
>>                      list.add(mountpoint);<br>
>>              }<br>
>> -<br>
>> -            dirs = new String[list.size()];<br>
>> -            for (int i = 0; i < list.size(); i++) {<br>
>> -                dirs[i] = list.get(i);<br>
>> -            }<br>
>>          }<br>
>>          catch (FileNotFoundException e) {}<br>
>>          catch (IOException e) {}<br>
>> @@ -143,7 +137,7 @@ public class AndroidDevices {<br>
>>                  catch (IOException e) {}<br>
>>              }<br>
>>          }<br>
>> -        return dirs;<br>
>> +        return list.toArray(new String[list.size()]);<br>
>>      }<br>
>><br>
>>      public static String[] getMediaDirectories() {<br>
>> --<br>
>> 2.1.0.rc2.206.gedb03e5<br>
>> _______________________________________________<br>
>> vlc-devel mailing list<br>
>> To unsubscribe or modify your subscription options:<br>
>> <a href="https://mailman.videolan.org/listinfo/vlc-devel" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> vlc-devel mailing list<br>
> To unsubscribe or modify your subscription options:<br>
> <a href="https://mailman.videolan.org/listinfo/vlc-devel" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a><br>
><br>
_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a><br>
</div></div></blockquote></div><br></div>