mirror of https://github.com/M66B/FairEmail.git
PagedStorage workarounds
This commit is contained in:
parent
5785890083
commit
577111cf59
|
@ -171,6 +171,10 @@ final class PagedStorage<T> extends AbstractList<T> {
|
||||||
// can only occur in tiled case, with untouched inner/placeholder pages
|
// can only occur in tiled case, with untouched inner/placeholder pages
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (pageInternalIndex >= page.size()) {
|
||||||
|
eu.faircode.email.Log.e("PageStorage pageInternalIndex=" + pageInternalIndex + "/" + page.size());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return page.get(pageInternalIndex);
|
return page.get(pageInternalIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -542,7 +546,12 @@ final class PagedStorage<T> extends AbstractList<T> {
|
||||||
|
|
||||||
// OK only if existing single page, and it's the last one
|
// OK only if existing single page, and it's the last one
|
||||||
if (!onlyEndPagePresent && !addingLastPage) {
|
if (!onlyEndPagePresent && !addingLastPage) {
|
||||||
throw new IllegalArgumentException("page introduces incorrect tiling");
|
//throw new IllegalArgumentException("page introduces incorrect tiling");
|
||||||
|
eu.faircode.email.Log.e("PagedStorage tiling" +
|
||||||
|
" size=" + newPageSize + "/" + mPageSize +
|
||||||
|
" addingLastPage=" + addingLastPage +
|
||||||
|
" onlyEndPagePresent=" + onlyEndPagePresent);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (onlyEndPagePresent) {
|
if (onlyEndPagePresent) {
|
||||||
mPageSize = newPageSize;
|
mPageSize = newPageSize;
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
diff --git a/app/src/main/java/androidx/paging/PagedStorage.java b/app/src/main/java/androidx/paging/PagedStorage.java
|
||||||
|
index c644234c7ed..7b2cc1fc788 100644
|
||||||
|
--- a/app/src/main/java/androidx/paging/PagedStorage.java
|
||||||
|
+++ b/app/src/main/java/androidx/paging/PagedStorage.java
|
||||||
|
@@ -171,6 +171,10 @@ public T get(int i) {
|
||||||
|
// can only occur in tiled case, with untouched inner/placeholder pages
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
+ if (pageInternalIndex >= page.size()) {
|
||||||
|
+ eu.faircode.email.Log.e("PageStorage pageInternalIndex=" + pageInternalIndex + "/" + page.size());
|
||||||
|
+ return null;
|
||||||
|
+ }
|
||||||
|
return page.get(pageInternalIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -542,7 +546,12 @@ public void insertPage(int position, @NonNull List<T> page, @Nullable Callback c
|
||||||
|
|
||||||
|
// OK only if existing single page, and it's the last one
|
||||||
|
if (!onlyEndPagePresent && !addingLastPage) {
|
||||||
|
- throw new IllegalArgumentException("page introduces incorrect tiling");
|
||||||
|
+ //throw new IllegalArgumentException("page introduces incorrect tiling");
|
||||||
|
+ eu.faircode.email.Log.e("PagedStorage tiling" +
|
||||||
|
+ " size=" + newPageSize + "/" + mPageSize +
|
||||||
|
+ " addingLastPage=" + addingLastPage +
|
||||||
|
+ " onlyEndPagePresent=" + onlyEndPagePresent);
|
||||||
|
+ return;
|
||||||
|
}
|
||||||
|
if (onlyEndPagePresent) {
|
||||||
|
mPageSize = newPageSize;
|
Loading…
Reference in New Issue