Avoid changing timezone to the same one and look for the right broadcast.

Currently if the timezone is NY, the test fails because it
attempts to set it to NY and since it is the same timezone,
no broadcast is sent.

To avoid getting the wrong broadcast (e.g. originating from previous
test tearDonw), we now check time-zone extra in the receiver.

+ increased broadcast wait timeout.
+ don't change auto_time_zone in the teardown - there is no need,
  just causes more broadcasts.
+ sleep/retry loop for checking timezone change.

Bug: 110036709
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.DeviceOwnerTest#testSetTime
Change-Id: I9400875ea26b4a3fffe9b5d2a1fe4eedeb4fe9a1
1 file changed