Add assumption that initial displaySize has changed

The test fails if the same display is used for
both CLOSED and OPENED state: there is no change in
display metrics so the non-resizable activity does
not enter app-compat mode so the restart button is
not shown.

Solution: determine display size before and after
changing to OPENED state and continue the test only
if the two sizes are different.

This is a cherry pick of https://android-review.googlesource.com/c/platform/cts/+/2110365

Fix: 233922949
Test: android.cts.statsdatom.sizecompatrestartbutton.SizeCompatRestartButtonStatsTests#testSizeCompatRestartButtonAppearedButNotClicked
Merged-In: Ib8234de39368660db7727c6e0f1f72769a48f880
Change-Id: If1add825be4dd21c3897b1e48fbd8fea431d62eb
1 file changed