[vlc-devel] [PATCH] Small refactoring in AndroidDevices.getStorageDirectories()

Andrey Khalyavin halyavin at google.com
Tue Nov 25 15:20:29 CET 2014


Could you commit the patch for me (I am not a contributor)?

2014-11-25 16:41 GMT+03:00 Geoffrey Métais <geoffrey.metais at gmail.com>:
> LGTM.
>
> But you should have mailed it to android at videolan.org instead ;)
I didn't found this information on the wiki. Will take into account
the next time.

With best regards,
Andrey Khalyavin
>
> On Tue, Nov 25, 2014 at 2:24 PM, Andrey Khalyavin <halyavin at google.com>
> wrote:
>>
>> This patch makes code nicer and getStorageDirectories() does not
>> return null on exception any more.
>>
>> With best regards,
>>
>> Andrey Khalyavin
>>
>> From 1fb0f9d19fbefbf30e8019a47a3b241c5fe1f6b0 Mon Sep 17 00:00:00 2001
>> From: Andrey Khalyavin <halyavin at google.com>
>> Date: Tue, 25 Nov 2014 15:31:43 +0300
>> Subject: [PATCH] Do not return null on exception in
>>  AndroidDevices.getStorageDirectories().
>>
>> ---
>>  vlc-android/src/org/videolan/vlc/util/AndroidDevices.java | 8 +-------
>>  1 file changed, 1 insertion(+), 7 deletions(-)
>>
>> diff --git a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
>> b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
>> index d71f55f..ae8f473 100644
>> --- a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
>> +++ b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
>> @@ -88,7 +88,6 @@ public class AndroidDevices {
>>      }
>>
>>      public static String[] getStorageDirectories() {
>> -        String[] dirs = null;
>>          BufferedReader bufReader = null;
>>          ArrayList<String> list = new ArrayList<String>();
>>          list.add(Environment.getExternalStorageDirectory().getPath());
>> @@ -127,11 +126,6 @@ public class AndroidDevices {
>>                  if (Strings.StartsWith(deviceWL, device) &&
>> (typeWL.contains(type) || Strings.StartsWith(mountWL, mountpoint)))
>>                      list.add(mountpoint);
>>              }
>> -
>> -            dirs = new String[list.size()];
>> -            for (int i = 0; i < list.size(); i++) {
>> -                dirs[i] = list.get(i);
>> -            }
>>          }
>>          catch (FileNotFoundException e) {}
>>          catch (IOException e) {}
>> @@ -143,7 +137,7 @@ public class AndroidDevices {
>>                  catch (IOException e) {}
>>              }
>>          }
>> -        return dirs;
>> +        return list.toArray(new String[list.size()]);
>>      }
>>
>>      public static String[] getMediaDirectories() {
>> --
>> 2.1.0.rc2.206.gedb03e5
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>



More information about the vlc-devel mailing list