Bug: 188081026
Test: no op change, should compile
Test: ReorderWidgets
Change-Id: I20367974e5a4cead406e18eb66dafd4d59651b2a
Merged-In: I20367974e5a4cead406e18eb66dafd4d59651b2a
Recording the screen to investigates flakes on ReorderWidgets
is really useful but it requires changing the code for that and
storing the video and most of the time the useful information
is just the end state so by logging the end state makes resolving
flakes easier
Fix: 261877803
Test: atest ReorderWidgets
Change-Id: If5d9745ebb57826a55b5df9d3599eed56c48298f
If the user is changing the X and Y of the reorder, wich requires
the user to move at least one Workspace cell from the previous
position, then it doesn't make sense to wait for the previous alarm to finish
to start a new reorder.
Also, I added a new test to run on foldable devices.
Fix: 259995663
Fix: 259295374
Test: atest ReorderWidgets (it mostly fails on postsubmit)
Test: modify ReorderWidgets.fullReorder to run 20 times and it should work, before the chagne it would fail.
Change-Id: Ic6b436ea1088f8092c849e9791862947e9035c9f
The function Launchable.startDrag it's supposed to grab and icon or widget
and start the dragging by moving it only in the verticall position but
because it uses the coordinates of the object before entering the
SPRING_LOADED_STATE_ORDINAL state then the coordiates where it moves
are outisde of the cell layout and it moves to a new page. This only happens
if the phone is too slow and it triggers the page change, otherwise it would
be too fast.
To fix it, I'm moving the icon/widget to the center of the screen minus
getStartDragThreshold() to ensure the drag is always triggered.
Fix: 242323136
Fix: 244224955
Fix: 241019568
Fix: 241583798
Test: atest ReorderWidgets
Change-Id: I0e431b994aa4a3d5c8be45b6c73263732553b36c
Now TestWorkspaceBuilder has the logic to add hotseat icons and
the operations to add items to the Workspace is done in batches
which is faster and more stable. To submit everything in batches
it uses the FavoriteItemsTransaction.
This improves the design because TestWorkspaceBuilder and
HomeScreenImageTest belong to the Test layer and they should
only deal with the logic to run a test and TestWorkspaceBuilder
is the Model layer and holds all the logic to interact with the
Launcher model/data, so this separates the concern of each class.
Also, chagned the name from CellLayoutBoardBuilder to
TestWorkspaceBuilder to make it clearer.
Bug: 243440737
Bug: 235518637
Bug: 242323136
Test: atest HomeScreenImageTest
Test: atest ReorderWidgets
Change-Id: I14eef064fade153b8362537743b061958bb3071d
TAPL design chagnes at https://docs.google.com/document/d/1PdJZZIn-85-UMRFGZuqj-tJgruIWcg31lZnrb34iBTY/edit?resourcekey=0-uAZuiLCDFV9YhOtLB7wQHQ
The tests consist of a board representing the widgets on
the CellLayout a position to move the main widget (m) to
and the resulting board.
iiiii iiiii
----- --x--
-xxx- -> -xmx-
--m-- -----
----- -----
Move m to 2,2.
Then whe make sure the device corresponds with the resulting
board.
I had to add the event TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Widgets.onLongClick");
on ItemLongClickListener because the tests where not expecting
a long press on a widget after is being place on the
workspace.
Also, I needed to add the option to drag a widget
to a specific point instead of the previous option
of only dragging to the workspace.
Fix: 231449779
Test: Run the test and make sure they pass.
Change-Id: I58183b7ce2ca64c999e21073cce5e0ba6e6f3a9e