This relands commit 8dc06e5335
The Different from the original patch:
Ignore the layers of popup windows.
The original CL description:
Align the long press duration to AutomationUtils.
Bug: 257099231
Bug: 258787797
Test: atest WMShellFlickerTests:CopyContentInSplit
Change-Id: I391e0e4e71aa0ae13221ecd571e187e1c10f7c96