Reduce unnecessary object creation in relayout test

Also change to use STAY_ON_WHILE_PLUGGED_IN for keeping
device awake. That eliminates the toggle of wakelock by
showing and hiding a window with FLAG_KEEP_SCREEN_ON.

Test: atest RelayoutPerfTest InternalWindowOperationPerfTest
Bug: 131727899
Change-Id: Ib4608aa1a60c7560b39011cfd2e4740680b3c884
2 files changed