Files
frameworks_base/core/java/com
Bill Lin fe5a9edac0 Unable to load BRs in SAF of FileSystemProvider
Files.listFiles() indicate if this abstract pathname does "not denote a directory"
It will returns null and cause "NullPointerException: Attempt to get length of null array"
in the queryChildDocuments()

Solution:
    Use FileUtils.listFilesOrEmpty(parent) and check parent.isDirectory() to avoid NPE

Bug: 111565816
Test: Manual, trigger bugreport
      rm -rf /data/user_de/0/com.android.shell/files/bugreports
      launch Files/Bugreport observe there should not happen exception

Change-Id: I9d0835d562af7cf3c9bdaeab52cf41e86e3a8f62
2018-08-23 23:06:17 +08:00
..