UserDataPrepare: CE storage property set too early.

Set sys.user.[userId].ce_available only after CE
storage has been prepared. This property was being set
too early. This will cause a race for first boot between
preparing these folders and writting to them. If CE
storage is not empty before setting encryption policy
then setting encryption policy would fail.

Also, if setting CE storage fails, we should not destroy
DE storage since recovery is only making call to retry
setting up CE.

Only when userId == UserHandle.USER_SYSTEM then mkdri
should fail when CE property isn't set.

Bug: 76222913
Bug: 76102397
Bug: 78514593
Bug: 78515110
Test: Waiting for property and no longer seeing the race.
Verified below cts failures are now passing.
android.appsecurity.cts.ExternalStorageHostTest#testMultiViewMoveConsistenc
android.appsecurity.cts.ExternalStorageHostTest#testExternalStorageWrite
android.appsecurity.cts.ExternalStorageHostTest#testExternalStorageNone

Change-Id: Ied0308ef099090e8f3954e905f78320214e14335
(cherry picked from commit 420e825111ca5c95c6200c1fb4681c315906e71e)
2 files changed