diff options
Diffstat (limited to 'uncrypt')
-rw-r--r-- | uncrypt/Android.mk | 2 | ||||
-rw-r--r-- | uncrypt/uncrypt.cpp | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/uncrypt/Android.mk b/uncrypt/Android.mk index c7d4d3746..e73c8f1b6 100644 --- a/uncrypt/Android.mk +++ b/uncrypt/Android.mk @@ -16,6 +16,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) +LOCAL_CLANG := true + LOCAL_SRC_FILES := uncrypt.cpp LOCAL_MODULE := uncrypt diff --git a/uncrypt/uncrypt.cpp b/uncrypt/uncrypt.cpp index 1db3013c6..8785b29af 100644 --- a/uncrypt/uncrypt.cpp +++ b/uncrypt/uncrypt.cpp @@ -53,8 +53,10 @@ #include <base/file.h> #include <base/strings.h> +#include <cutils/android_reboot.h> #include <cutils/properties.h> #include <fs_mgr.h> + #define LOG_TAG "uncrypt" #include <log/log.h> @@ -144,7 +146,7 @@ static const char* find_block_device(const char* path, bool* encryptable, bool* (path[len] == '/' || path[len] == 0)) { *encrypted = false; *encryptable = false; - if (fs_mgr_is_encryptable(v)) { + if (fs_mgr_is_encryptable(v) || fs_mgr_is_file_encrypted(v)) { *encryptable = true; char buffer[PROPERTY_VALUE_MAX+1]; if (property_get("ro.crypto.state", buffer, "") && @@ -358,7 +360,9 @@ static void wipe_misc() { static void reboot_to_recovery() { ALOGI("rebooting to recovery"); property_set("sys.powerctl", "reboot,recovery"); - sleep(10); + while (true) { + pause(); + } ALOGE("reboot didn't succeed?"); } |