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

Commit 3aeade44 authored by Tianjie Xu's avatar Tianjie Xu Committed by android-build-merger
Browse files

Merge "Log the error when uncrypt timeouts" am: c1973ecb

am: c68e6d67

Change-Id: I23ee644fb2f73fc3cece4faf59eb63417cfe3ea6
parents 6b32f380 c68e6d67
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -93,6 +93,14 @@ public class RecoverySystem {
     */
     */
    public static final File UNCRYPT_PACKAGE_FILE = new File(RECOVERY_DIR, "uncrypt_file");
    public static final File UNCRYPT_PACKAGE_FILE = new File(RECOVERY_DIR, "uncrypt_file");


    /**
     * UNCRYPT_STATUS_FILE stores the time cost (and error code in the case of a failure)
     * of uncrypt.
     *
     * @hide
     */
    public static final File UNCRYPT_STATUS_FILE = new File(RECOVERY_DIR, "uncrypt_status");

    // Length limits for reading files.
    // Length limits for reading files.
    private static final int LOG_FILE_MAX_LENGTH = 64 * 1024;
    private static final int LOG_FILE_MAX_LENGTH = 64 * 1024;


+8 −0
Original line number Original line Diff line number Diff line
@@ -716,6 +716,14 @@ public final class ShutdownThread extends Thread {
        }
        }
        if (!done[0]) {
        if (!done[0]) {
            Log.w(TAG, "Timed out waiting for uncrypt.");
            Log.w(TAG, "Timed out waiting for uncrypt.");
            final int uncryptTimeoutError = 100;
            String timeoutMessage = String.format("uncrypt_time: %d\n" + "uncrypt_error: %d\n",
                    MAX_UNCRYPT_WAIT_TIME / 1000, uncryptTimeoutError);
            try {
                FileUtils.stringToFile(RecoverySystem.UNCRYPT_STATUS_FILE, timeoutMessage);
            } catch (IOException e) {
                Log.e(TAG, "Failed to write timeout message to uncrypt status", e);
            }
        }
        }
    }
    }
}
}