Fix strange behaviour when app loses access to saf download folder

This commit is contained in:
Stypox 2021-01-16 15:46:50 +01:00
parent 114dc8ffa0
commit b78ac7d2e9
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
2 changed files with 14 additions and 2 deletions

View file

@ -223,6 +223,15 @@ public class StoredDirectoryHelper {
return docTree == null ? ioTree.canWrite() : docTree.canWrite();
}
/**
* @return {@code false} if the storage is direct, or the SAF storage is valid; {@code true} if
* SAF access to this SAF storage is denied (e.g. the user clicked on {@code Android settings ->
* Apps & notifications -> NewPipe -> Storage & cache -> Clear access});
*/
public boolean isInvalidSafStorage() {
return docTree != null && docTree.getName() == null;
}
@NonNull
@Override
public String toString() {