Fix flakiness in LocationAccessCheckTest.

The user sensitive flag is started immediately after package
installation, however it is still asynchronous, so sometimes
LocationAccessCheck may think the location permission for the test app
isn't user sensitive and result in test flakiness. This is the
flakiness confirmed locally and is verified to be fixed this way.

Another popular source of flakiness is caused by the job times being
reported isn't accurate, so that the end time may sometimes come
before start time by around 100 ms and fail the expectation of the
test. To work around this issue, we can sleep 1 second around job
start, and just make sure both the start and end time comes after we
schedule the job.

Meanwhile we are still observing a small number of cases where the job
isn't being run when testing on the cloud, so explicitly wake up the
device to make the job run, and increase some other timeout durations.

Bug: 182960931
Bug: 183459058
Test: atest --rerun-until-failure 10 LocationAccessCheckTest
Change-Id: Ie683fc885a0d18cda1ee65596f3e98f23d098c45
(cherry picked from commit ddb82f2f57b11c85e1daf5fd35ec8656c7a71d97)
1 file changed