Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6668fcaf authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker Committed by Android (Google) Code Review
Browse files

Merge "UserDataPreparer: reboot to recovery if preparing user storage fails"...

Merge "UserDataPreparer: reboot to recovery if preparing user storage fails" into snap-temp-L01900000954560285
parents 2ba316f5 6ba336c0
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.content.Context;
import android.content.pm.UserInfo;
import android.os.Environment;
import android.os.FileUtils;
import android.os.RecoverySystem;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
import android.os.SystemProperties;
@@ -115,6 +116,13 @@ class UserDataPreparer {
                // Try one last time; if we fail again we're really in trouble
                prepareUserDataLI(volumeUuid, userId, userSerial,
                    flags | StorageManager.FLAG_STORAGE_DE, false);
            } else {
                try {
                    Log.e(TAG, "prepareUserData failed", e);
                    RecoverySystem.rebootPromptAndWipeUserData(mContext, "prepareUserData failed");
                } catch (IOException e2) {
                    throw new RuntimeException("error rebooting into recovery", e2);
                }
            }
        }
    }