History log of /frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
213c0aa34bc54fb1b540a040609f097a4e4f65fa 06-Jul-2017 Chris Craik <ccraik@google.com> Fix OrientationHelper NPE

Fixes: 63386256
Test: RecyclerViewCacheTest#prefetchAfterOrientationChange

Change-Id: I730903f056b51cbd7465077aaf7355966655ae24
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
963facb8fce35022f296c38fadafd9a959ab1655 12-Jun-2017 Aurimas Liutikas <aurimas@google.com> Upgrade from mockito 1.9.5 to 2.7.6

Bug: 62532636
Test: ./gradlew assembleAndroidTest succeeds
Change-Id: I5bd89e5aad7761bbd2a5b188fb0661f1dbf4743b
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
b9d3b54b0b5fa223867cf11e47ee3f31ee474031 28-Mar-2017 Chris Craik <ccraik@google.com> Make prefetch calls trigger isComputingLayout()=true

Fixes: 32735990
Test: adb shell am instrument -w -r -e debug false -e size small android.support.v7.recyclerview.test/android.support.test.runner.AndroidJUnitRunner

Change-Id: I19ba1ecacbc97eeeb7a96d9d9fd401f98d9e6f1b
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
41bcf9b0e4fbfc5902b5cbd17f6ade1c2091d33d 28-Mar-2017 Chris Craik <ccraik@google.com> Merge "Fix stale nested prefetch data leaking out after notifyDataSetChanged" into nyc-support-25.4-dev
0fd482dee2c8c2aa61e59d6501e46864e16fcb04 28-Mar-2017 Dake Gu <dake@google.com> RecyclerView prefetch: dont change mStructureChanged flag

Some LayoutManager(e.g. leanback) is sensitive to mStructureChanged
flag. Though LinearLayoutManager never uses the flag. The reset to
false flag will cause next onLayoutChildren() of leanback LayoutManager
crash.

Bug: 36595030
Test: RecyclerViewCacheTest.nestedPrefetchNotClearInnerStructureChangeFlag
also did manual check with recompiled TVLauncher.

Change-Id: Ia46fe4fd7ccd9fa3b9ce9c30ff98a62158d5817c
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
570ab881350c836743247140a0953f87acc21c8d 24-Mar-2017 Chris Craik <ccraik@google.com> Fix stale nested prefetch data leaking out after notifyDataSetChanged

Bug:36558253
Test: adb shell am instrument -w -r -e debug false -e size small android.support.v7.recyclerview.test/android.support.test.runner.AndroidJUnitRunner

Switches notifyDataSetChanged to always discard all cached views so
content in the cache is always trustworthy.

Also fixes a case where GapWorker attempts to prefetch inner items
before the containing RecyclerView's data is bound.

Change-Id: Iad9974923564a07ae57f1a9084e6cfe6ec560a6f
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
d6696c2abea2771acd000c2269cf9113acc6c0a9 02-Mar-2017 Chris Craik <ccraik@google.com> Fix prefetch item count naming

Fixes: 35855437
Test: adb shell am instrument -w -r -e debug false -e size small android.support.v17.leanback.test/android.support.test.runner.AndroidJUnitRunner
Test: adb shell am instrument -w -r -e debug false -e size small android.support.v7.recyclerview.test/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ifa5afd2260b4705aa9f7b8771cc35b4cb3fc2363
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
bec95cedb8511e1d814181aa518512c7e7fc5cf6 22-Feb-2017 Chris Craik <ccraik@google.com> Filter out RecyclerViews from non-visible windows from prefetch

Bug: 35443218
Test: adb shell am instrument -w -r -e size small -e debug false android.support.v7.recyclerview.test/android.support.test.runner.AndroidJUnitRunner

This also ensures we query the latest available draw time, so that we
don't pick a stale draw time that leaves us with negative time left to
prefetch.

Change-Id: I7e59134f534978d204d8e3cdb40bb8a9bb4ecdf4
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
695d9b8629fa048795298359d4845f0747364faf 15-Dec-2016 Chris Craik <ccraik@google.com> Fix StaggaredGridLayoutManager prefetch crash

Fixes: 33654151
Test: @SmallTests pass

StaggaredGridLayoutManager prefetching would attempt to prefetch in
the wrong direction (and pass a negative distance) if a span had no
content left.

Change-Id: Ia1d8f34436d436b72e37e0058c94c2ccdf51c6ca
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
9ad077f4ba751b392e6f4454b09c2305cdc22b0d 06-Dec-2016 Chris Craik <ccraik@google.com> Reset prefetch cache expansion after initial prefetch

Fixes: 33038996
Test: @SmallTests still passing

Prevents large initial prefetch from permanently expanding the
recycler's cache.

Change-Id: Ie76c73055d6aa071cd0ea31712d7b538b0954821
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
8123166eaf758eacc6ba5854c9b29d99f21388d6 03-Dec-2016 Chris Craik <ccraik@google.com> Switch mNestedRecyclerView to weakref

Fixes: 33278066
Test: new test, @SmallTests still pass

Previously, we cleared a nested RecyclerView to be safe when a holder
failed to recycle. However, this is a common occurrance with
animations, since they will hold onto the holders until they are done,
and return them at the end.

Instead, just keep the nested RecyclerView as a weak ref. Probably
unnecessary, but maintains the guarantee that if someone removes or
swaps an inner RecyclerView (note: a gross case), we won't leak it.

Change-Id: I3ee97608f8fb3687f17d861438bc4bb895d27a65
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
0fab45107f043a4856aad2e1fd785b396898616e 30-Nov-2016 Chris Craik <ccraik@google.com> Detach stale nested RecyclerView content before prefetching

Fixes: 33104285
Test: @SmallTests still passing

Change-Id: Ifddea3131f8c6cb653026956c91eeffd824fcd19
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
3104d446bcf3da9ffb7a761fd30f0506c30f0cc9 21-Nov-2016 Chris Craik <ccraik@google.com> Make RecyclerView prefetch APIs public

Bug: 27106058
Test: @SmallTests still pass

Change-Id: I086b17fb8ba8164a680d03a5b6255670334784a5
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
438379928b7d0a46b26561b299c2b3dc112c3ffb 24-Nov-2016 Chris Craik <ccraik@google.com> Merge "Ignore 0 distance drags for prefetching" into nyc-support-25.1-dev
0951d1a9c3200368a7b19bd272f7d6c266a11869 24-Nov-2016 Chris Craik <ccraik@google.com> Ignore 0 distance drags for prefetching

bug:33111651

Change-Id: I13fb0cacd7e1f0935a18495cd4333a3b7e40285f
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
f2f73b7cc9bed0e7204ba43796bb0112cda27cf1 22-Nov-2016 Chris Craik <ccraik@google.com> Allow prefetching while data set changed after layout

bug:33077209

Prevent prefetch data for nested RecyclerView items from being
discarded upon eventual layout. Treat attached and cached views
differently, since attached represent stale data, and cached holding
prefetched, bound content, ready to be used by the upcoming layout.

Also, if an adapter swap defers deleting a view until layout, it will
be flagged as POSITION_UNKNOWN. We don't want these views to be
cached, so that we can start trusting the cache in these cases for
prefetch purposes.

Change-Id: I8b41c3f129a663215fbb323ebd7a7ed83b7b0c13
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
0ceae57ee14da826c31a66c67e70f7f17108d5ca 29-Oct-2016 Chris Craik <ccraik@google.com> More nested prefetch tests

Bug: 27106058
Test: @SmallTests passing

Change-Id: I5f424dd31279f95929613d11def5644db2c66cc4
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
1e0a453dff8d7bb7a966d006541454c770d1ed05 25-Oct-2016 Chris Craik <ccraik@google.com> Nested RecyclerView Prefetch

Bug: 27106058
Fixes: 32343355
Test: tests added, existing @SmallTests pass

- Stash RecyclerView if found within ViewHolder
- Prefetch nested LinearLayout content based on anchor
- Avoid double query of Display#getRefreshRate()
- Avoid dispatching recycled callbacks for unbound holders
- Reorganized State members based on lifecycle.

Change-Id: I51701576d8f5985e3cab7b684694c50bf03ef280
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
dbf84daff4f8c5a9e1b8cfa63ab14106dbab9038 11-Oct-2016 Chris Craik <ccraik@google.com> Prevent prefetch of attached views.

Bug: 32064637
Test: new test, existing cache tests still pass.

Prevents prefetch from stealing animating/disappearing views.

Manual rebase of 923857de8d8ee9029a80abf808f8dcfa98ade1ee

Change-Id: I42f4821e522c27f4b65679ccfd6808ae85b58cf1
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
47d17a72daeb141148d13a0b0f2df146f6524a9d 07-Oct-2016 Chris Craik <ccraik@google.com> Cleanup RecyclerViewCacheTest GapWorker access

Bug: 32018855
Test: Passes now with timeout

Works around issue in timeout threading.

Change-Id: I1df1b48de21d5ada3c8cbd3094216e2ca37443ce
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
356880d3de117b067522ad452f4e3eed85ce444c 04-Oct-2016 Chris Craik <ccraik@google.com> Add GapWorker task prioritization

Bug: 27106058
Test: new tests, existing caching tests still pass

GapWorker now breaks down all scheduled works (each prefetch itemview
from each RecyclerView) into tasks, which it sorts before starting.

In addition, ignore deadlines for items we expect to need next frame.

Change-Id: I23b5a37925bbf1e392d6c48f5341e1382f5fb89b
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
945dc1e8a9ee0b71e6b2454ccb3e61145d2132f5 30-Sep-2016 Chris Craik <ccraik@google.com> Improve LayoutManager prefetch API

Bug: 27106058
Test: new prefetch test for SGLM, existing caching tests still pass

Additionally, refactors prefetch logic to separate view specific work
from general GapWorker behavior.

Change-Id: I2b98ec689eef606cee7eb3cada92957a0641babd
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
6542412e05d85539609d4b8fe92f0f3f718e3814 29-Sep-2016 Chris Craik <ccraik@google.com> Merge "Gradual prefetching in GapWorker"
a93a0c08b4543401d8e2df9bd4c88f26d3b72c11 26-Sep-2016 Chris Craik <ccraik@google.com> Gradual prefetching in GapWorker

Bug: 27106058
Test: Added prefetchItemsRespectDeadline, all caching tests still pass

Instead of prefetching all of the items at once, we do as much work as
possible before the deadline, based on create/bind cost estimates.

A vertically scrolling 3 column GridLayoutManager, for example, can
create/bind one item, and create one unbounded, if that's all that fits
in between frames. Expensive prefetches like that row are done
gradually, across multiple frames.

Also moves all usage of mPrefetchXXX to be fully owned by GapWorker for
consistency.

Change-Id: I9030b48244d18739f17c3b8503cefc588d462b56
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
754cb29c50f09a83251dd4bb633ba445b2411adb 27-Sep-2016 Aurimas Liutikas <aurimas@google.com> Switch from deprecated size annotations to new ones.

Switching from android.test.suitebuilder.annotation.*Test
to android.support.test.filters.*Test.

Bug: 30074170
Test: manual - ran small appcompat tests, they still run and pass
Change-Id: Idce58b988c8e1a809f7f5fae67e0e235159d9fc5
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
07b2e072ee7e8f424eb95abc77695dc2c5a786bb 24-Sep-2016 Chris Craik <ccraik@google.com> Refactor ViewPrefetcher into GapWorker

Bug: 27106058
Test: Existing caching tests still pass.

Also time bind/create, to know how much gap time we have.

Change-Id: Iaaaf0d59032db4b87370b1a6b3e114a41c4da844
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
ee9f1a3ebd8f071cea11fd97f9a3f3d41027189c 17-Sep-2016 Aurimas Liutikas <aurimas@google.com> Add missing SdkSuppress annotation ot RecyclerViewCacheTest.

Bug: 30198627
Test: None
Change-Id: I4929eac26fc9ff116b21a0115a1aa914169fe4f5
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
e85a5c8c0bfc0aa1ca0796c7bd1f916049e55d68 15-Sep-2016 Aurimas Liutikas <aurimas@google.com> Stop running RecyclerViewCacheTest on pre API21 devices.

Bug: 30198627
Test: did not test, assume this works.
Change-Id: I2cdb14948346e7c650b61c71583d84c1e38e6711
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java
36c4d66a1bc449309f0a3b97d61dd5bf692d181d 03-Sep-2016 Chris Craik <ccraik@google.com> Fix prefetched items being evicted by non-prefetch

fixes:31271889

Prevents insertions into the item cache (e.g. during scroll) for
non-prefetched items from evicting prefetched items.

Previously, prefetched items could thrash when several items were
unloaded and recycled in a single frame.

Change-Id: I1d4a4e8dd18f81db2e494281d75ab72371600512
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewCacheTest.java