From bad332a3d175687a732cc6e94c34bd38bdef29b8 Mon Sep 17 00:00:00 2001 From: bigbiff bigbiff Date: Fri, 29 Jul 2016 21:18:13 -0400 Subject: Copy Kernel Logs Give user option to copy kernel logs to current storage Change-Id: I0c61122fb34826ddb08977e6cbf98e3adf477acd --- gui/action.cpp | 12 +++++++--- gui/theme/common/landscape.xml | 49 ++++++++++++++++++++++++++++++++------- gui/theme/common/languages/en.xml | 6 +++-- gui/theme/common/portrait.xml | 49 ++++++++++++++++++++++++++++++++------- gui/theme/common/watch.xml | 41 +++++++++++++++++++++++++------- twrp-functions.cpp | 10 ++++++++ twrp-functions.hpp | 1 + 7 files changed, 136 insertions(+), 32 deletions(-) diff --git a/gui/action.cpp b/gui/action.cpp index a96e15ac9..223d75e25 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -639,13 +639,19 @@ int GUIAction::copylog(std::string arg __unused) operation_start("Copy Log"); if (!simulate) { - string dst; + string dst, curr_storage; + int copy_kernel_log = 0; + + DataManager::GetValue("tw_include_kernel_log", copy_kernel_log); PartitionManager.Mount_Current_Storage(true); - dst = DataManager::GetCurrentStoragePath() + "/recovery.log"; + curr_storage = DataManager::GetCurrentStoragePath(); + dst = curr_storage + "/recovery.log"; TWFunc::copy_file("/tmp/recovery.log", dst.c_str(), 0755); tw_set_default_metadata(dst.c_str()); + if (copy_kernel_log) + TWFunc::copy_kernel_log(curr_storage); sync(); - gui_msg(Msg("copy_log=Copied recovery log to {1}.")(DataManager::GetCurrentStoragePath())); + gui_msg(Msg("copy_log=Copied recovery log to {1}")(dst)); } else simulate_progress_bar(); operation_end(0); diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml index 5c92fccd3..3aed1981e 100644 --- a/gui/theme/common/landscape.xml +++ b/gui/theme/common/landscape.xml @@ -3132,6 +3132,45 @@ + +