Handle race between UID state and activty resume

There is a race between the UID turning active and activity
being resume. The proper fix is very risky, so we temporary add
some polling which should hapen pretty rarely anyway as the race
is hard to hit.

Test: camera works fine
      cts-tradefed run cts-dev -m CtsCameraTestCases

bug:77827041

Change-Id: I1768d00dc08e6e49cec0099f0a29b7889f9affad
1 file changed