fix sometimes file creation fails due to slow permission update

This case first invoke updatePermissions() to update storage permissions for MEDIA_FULL.pkg for secondary user. But when the case goes to testStageFiles, the MEDIA_FULL.apk has not obtained storage permissions, so file creation fails. We could wait and try more times when file creation fails.

Bug: 150910325
Bug: 158037812
Test: atest ExternalStorageHostTest#testMediaSandboxed28

Signed-off-by: qianyou <qianyou@xiaomi.com>
Change-Id: I9e0cd74b2cd41b245413847a15d8a67002cbcf0f
Merged-In: I9e0cd74b2cd41b245413847a15d8a67002cbcf0f
1 file changed