Fix "Permission denied" problem due to permission update slow

This is flaky test. After starting a secondary user and installing MEDIA_FULL.apk in the secondary user, the user initialization may cause slow permission update. So make sure user initialization is complete before updating permission.

Bug:153699381
BUG: 158587595
Test: run cts -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.ExternalStorageHostTest#testMediaSandboxed28

Signed-off-by: qianyou <qianyou@xiaomi.com>
Change-Id: If682df221aa8253b244e779d74c1b8aaca82da04
(cherry picked from commit c3966c75e5f03c3085ae6bd5997781acf9e0cdce)
1 file changed