Status Update
Comments
ra...@google.com <ra...@google.com>
ra...@google.com <ra...@google.com> #2
Are you saying that loadState being null is more correct initial state compared to the current
```
CombinedLoadStates(
refresh = InitialLoadStates.refresh,
prepend = InitialLoadStates.prepend,
append = InitialLoadStates.append,
source = InitialLoadStates
)
private val IncompleteLoadState = LoadState.NotLoading(false)
private val InitialLoadStates = LoadStates(
IncompleteLoadState,
IncompleteLoadState,
IncompleteLoadState
)
```
ma...@google.com <ma...@google.com> #3
Ideally we would not pass any initial state because it will always have some case where it is wrong - we should ideally wait for a real event from Paging before sending it downstream to user.
For example the initial state:
CombinedLoadStates(
refresh = InitialLoadStates.refresh,
prepend = InitialLoadStates.prepend,
append = InitialLoadStates.append,
source = InitialLoadStates
)
...will always have null
mediator states, even if they are using RemoteMediator. This can mess up loadstate logic that is waiting for some combination of source + mediator loads to happen. It's easy to filter the initial case, but it gets complicated if they want to switchMap between multiple streams and they all start with this initial state. Or also consider the case when coming from cached state and needing to filter this out... it's bad developer UX.
So we could either set this to nullable to denote "no state" or we could have some constant we use that can be easily filtered out like "BogusLoadState" and then people can do .filter { it !== BogusLoadState }
ra...@google.com <ra...@google.com> #4
Alternatively, if we can read whether we have RemoteMediator
or not, we could try this for initial state which would be a lot more accurate:
private val InitialLoadStates = LoadStates(
LoadState.Loading,
IncompleteLoadState,
IncompleteLoadState
)
CombinedLoadStates(
refresh = InitialLoadStates.refresh,
prepend = InitialLoadStates.prepend,
append = InitialLoadStates.append,
source = InitialLoadStates,
mediatr = ??
)
Description
In Android 11, native syscalls this commit , which changed
opendir
andaccess
with W_OK on app private directories on external storage fail withEACCES
. From what I can tell, this is caused byisOpendirAllowed
to returnEACCES
on anyAndroid/data
path. That obviously includes app private storage, which should be readable. The same app works fine on internal storage when FUSE isn't involved.Later this appears to have been changed in this commit . Notably, it moves the call to
shouldBypassFuseRestrictions
beforeisDataOrObbPath
. I believe that would allow the app to access it's private storage.Would it be possible to backport that change to Android 11?