Use rotation change to check user rotation support.

Previously it uses whether the new rotation is equal to the expected
rotation. On a device that doesn't support user locked rotation the
screen rotation is always fixed to the rotation when the test starts to
run (usually 0 deg), and the test thinks it should assert config changes
when it happens to set the same rotation and will fail.

Instead, check whether screen rotation really changes and encapsulate it
to a common utility method.

Bug: 110479585
Test: Test passed on devices that don't support user locked rotation,
and still properly run on phones.

Change-Id: I572d297b3c249f1cf460660ba9a4b0263645aef2
2 files changed