Add sleep to ensure case sucess

The "dumpsys activity activities | grep Resumed:" is executed before
the activity life cycle is completed, so the activity info is not
obtained.

Solution: let the current thread sleep for 30000 milliseconds before
assertion to ensure that the activity has been displayed in the
foreground.

Bug: 241721521
Test:  run cts -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.ManagedProfileTest pass

Change-Id: I5b09334f83e72e531a0882556c378fe5e4943855
(cherry picked from commit 7b5db62cf218168a90a9d243dff514f232aa156a)
1 file changed