@Override public byte[] listDirectory(String path) throws RemoteException {
  Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
  final File directory=new File(path);
  final File[] files=directory.listFiles();
  final Parcel out=Parcel.obtain();
  if (files == null) {
    out.writeInt(0);
  }
 else {
    out.writeInt(files.length);
    for (    final File file : files) {
      out.writeString(file.getAbsolutePath());
      out.writeString(file.getName());
      out.writeInt(file.isDirectory() ? 1 : 0);
      if (file.isFile()) {
        out.writeInt(1);
        out.writeLong(file.length());
      }
 else {
        out.writeInt(0);
      }
    }
  }
  return out.marshall();
}

@ Override public byte [ ] listDirectory ( String path ) throws RemoteException { Process . setThreadPriority ( Process . THREAD_PRIORITY_BACKGROUND ) ; final File directory = new File ( path ) ; final File [ ] files = directory . listFiles ( ) ; final Parcel out = Parcel . obtain ( ) ; if ( files == null ) { out . writeInt ( 0 ) ; } else { out . writeInt ( files . length ) ; for ( final File file : files ) { out . writeString ( file . getAbsolutePath ( ) ) ; out . writeString ( file . getName ( ) ) ; out . writeInt ( file . isDirectory ( ) ? 1 : 0 ) ; if ( file . isFile ( ) ) { out . writeInt ( 1 ) ; out . writeLong ( file . length ( ) ) ; } else { out . writeInt ( 0 ) ; } } } return out . marshall ( ) ; }
list content of the directory and return as marshalled parcel . used for calculating misc size in settings - > storage
